diff --git a/.circleci/config.yml b/.circleci/config.yml
index d2c4906ef6..3019fabd6f 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1475,7 +1475,7 @@ jobs:
- run:
name: Run tests
command: |
- uv run --no-sync python -m pytest -v tests/otel_tests -x --junitxml=test-results/junit.xml --durations=5
+ uv run --no-sync python -m pytest -v tests/otel_tests --junitxml=test-results/junit.xml --durations=5
no_output_timeout: 15m
# Clean up first container
- run:
@@ -1935,7 +1935,7 @@ jobs:
name: Run Vertex AI, Google AI Studio Node.js tests
command: |
cd tests/pass_through_tests
- npx jest . --verbose
+ NODE_OPTIONS=--experimental-vm-modules npx jest . --verbose
no_output_timeout: 30m
- run:
name: Run tests
@@ -2138,17 +2138,23 @@ jobs:
- ~/.cache/uv
- restore_cache:
keys:
- - ui-e2e-node-deps-v1-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
+ - ui-e2e-node-deps-v2-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
- run:
name: Install Node dependencies and Playwright
+ # The cimg/python:3.12-browsers image already ships the Chromium system
+ # libraries Playwright needs (libnss3, libatk-bridge2.0-0, libcups2, etc.).
+ # `--with-deps` triggers a redundant apt-get update + install that adds
+ # 5-10 minutes to the job and frequently stalls on flaky Ubuntu mirrors,
+ # so we install just the browser binary.
command: |
cd ui/litellm-dashboard
npm ci
- npx playwright install chromium --with-deps
+ npx playwright install chromium
- save_cache:
- key: ui-e2e-node-deps-v1-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
+ key: ui-e2e-node-deps-v2-{{ checksum "ui/litellm-dashboard/package-lock.json" }}
paths:
- ui/litellm-dashboard/node_modules
+ - ~/.cache/ms-playwright
- run:
name: Build UI from source
# Prior version used `cp -r out/ ../../litellm/proxy/_experimental/out/`.
diff --git a/.github/workflows/check-lazy-openapi-snapshot.yml b/.github/workflows/check-lazy-openapi-snapshot.yml
deleted file mode 100644
index 2e4ed3637f..0000000000
--- a/.github/workflows/check-lazy-openapi-snapshot.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Check Lazy OpenAPI Snapshot
-
-on:
- pull_request:
- branches:
- - main
- - litellm_internal_staging
- - "litellm_**"
-
-permissions:
- contents: read
- checks: write
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- cancel-in-progress: true
-
-jobs:
- verify:
- runs-on: ubuntu-latest
- timeout-minutes: 10
- steps:
- - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- with:
- persist-credentials: false
-
- - name: Set up Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- with:
- python-version: "3.12"
-
- - name: Set up uv
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- with:
- version: "0.10.9"
-
- - name: Cache uv dependencies
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
- with:
- path: |
- ~/.cache/uv
- .venv
- key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
- restore-keys: |
- ${{ runner.os }}-uv-
-
- - name: Install dependencies
- run: uv sync --frozen --all-groups --all-extras
-
- - name: Regenerate snapshot to /tmp
- id: regen
- run: |
- cp litellm/proxy/_lazy_openapi_snapshot.json /tmp/snapshot.committed.json
- uv run --no-sync python -m litellm.proxy._lazy_openapi_snapshot
- mv litellm/proxy/_lazy_openapi_snapshot.json /tmp/snapshot.fresh.json
- mv /tmp/snapshot.committed.json litellm/proxy/_lazy_openapi_snapshot.json
-
- - name: Compare
- id: diff
- continue-on-error: true
- run: |
- diff -q /tmp/snapshot.fresh.json litellm/proxy/_lazy_openapi_snapshot.json
-
- - name: Mark neutral if drift
- if: steps.diff.outcome == 'failure'
- uses: LouisBrunner/checks-action@6b626ffbad7cc56fd58627f774b9067e6118af23 # v2.0.0
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- name: lazy-openapi-snapshot
- conclusion: neutral
- output: |
- {
- "title": "Lazy openapi snapshot is stale",
- "summary": "Run `python -m litellm.proxy._lazy_openapi_snapshot` and commit the regenerated `litellm/proxy/_lazy_openapi_snapshot.json`. Not blocking — the snapshot will regenerate at release if not committed."
- }
diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml
index 39d078267f..a726a921a2 100644
--- a/.github/workflows/create-release.yml
+++ b/.github/workflows/create-release.yml
@@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
tag:
- description: "Release tag (e.g. 1.84.0, 1.84.0rc1, 1.84.0.dev42, 1.84.0.post1; legacy v1.83.10-stable still accepted)"
+ description: "Release tag (e.g. 1.84.0, 1.84.0rc1, 1.84.0.dev42, 1.84.0-dev.2, 1.84.0.post1; legacy v1.83.10-stable still accepted)"
required: true
type: string
commit_hash:
@@ -46,9 +46,11 @@ jobs:
const commitHash = process.env.COMMIT_HASH;
// Mark RC / dev / nightly / alpha / beta tags as GitHub pre-releases.
+ // Accept both PEP 440 (`.dev`) and SemVer (`-dev`) separators so tags
+ // like `1.84.0.dev2` and `1.84.0-dev.2` are both detected.
// PEP 440 post-releases (e.g. `1.84.0.post1`) and legacy `-stable[.patch.N]`
// are stable maintenance releases, not pre-releases.
- const isPrerelease = /(?:rc|nightly|alpha|beta|\.dev)/i.test(tag);
+ const isPrerelease = /(?:rc|nightly|alpha|beta|[-.]dev)/i.test(tag);
const cosignSection = [
`## Verify Docker Image Signature`,
diff --git a/.gitignore b/.gitignore
index 38bf9554b5..59812ed6ed 100644
--- a/.gitignore
+++ b/.gitignore
@@ -90,7 +90,6 @@ test.py
litellm_config.yaml
!.github/observatory/litellm_config.yaml
.cursor
-.vscode/launch.json
litellm/proxy/to_delete_loadtest_work/*
update_model_cost_map.py
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py
@@ -100,4 +99,5 @@ STABILIZATION_TODO.md
**/test-results
**/playwright-report
**/*.storageState.json
-**/coverage
\ No newline at end of file
+**/coverage
+test-config
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 03779d6c88..915daff999 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,9 @@
# Base image for building
-ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:f26d42a15d09d9a643b231df929fa3cf609bedc58a728eb445be89a9d8d1da9f
+ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
# Runtime image
-ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:f26d42a15d09d9a643b231df929fa3cf609bedc58a728eb445be89a9d8d1da9f
-ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:733b4042187702f832f7fdecb3aff14a61b288c4ca37af188bb5715c1caebaf8
+ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
+ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
diff --git a/Makefile b/Makefile
index b6b674ff3b..5dbd308a3e 100644
--- a/Makefile
+++ b/Makefile
@@ -185,3 +185,6 @@ test-llm-translation-single: install-test-deps
$(UV_RUN) pytest tests/llm_translation/$(FILE) \
--junitxml=test-results/junit.xml \
-v --tb=short --maxfail=100 --timeout=300
+
+test-llm-translation-flush-vcr-cache:
+ $(UV_RUN) python tests/_flush_vcr_cache.py
diff --git a/README.md b/README.md
index d72fb746ed..72fd43925c 100644
--- a/README.md
+++ b/README.md
@@ -68,7 +68,7 @@ Managing LLM calls across providers gets complicated fast — different SDKs, au
 |
 |
 |
-  |
+  |
 |
Netflix |
 |
diff --git a/cookbook/litellm-ollama-docker-image/requirements.txt b/cookbook/litellm-ollama-docker-image/requirements.txt
index 815a42a679..9b9181b236 100644
--- a/cookbook/litellm-ollama-docker-image/requirements.txt
+++ b/cookbook/litellm-ollama-docker-image/requirements.txt
@@ -1 +1 @@
-litellm==1.83.5
\ No newline at end of file
+litellm==1.83.14
diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine
index 2cfc5ef03f..5de588cf4e 100644
--- a/docker/Dockerfile.alpine
+++ b/docker/Dockerfile.alpine
@@ -3,7 +3,7 @@ ARG LITELLM_BUILD_IMAGE=python:3.11-alpine@sha256:f07e2ace46f560f09a6eeec7b4913b
# Runtime image
ARG LITELLM_RUNTIME_IMAGE=python:3.11-alpine@sha256:f07e2ace46f560f09a6eeec7b4913b80ee99546e749ef82342a419a326620856
-ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:733b4042187702f832f7fdecb3aff14a61b288c4ca37af188bb5715c1caebaf8
+ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
diff --git a/docker/Dockerfile.database b/docker/Dockerfile.database
index e3edcece61..671f374ca2 100644
--- a/docker/Dockerfile.database
+++ b/docker/Dockerfile.database
@@ -1,9 +1,9 @@
# Base image for building
-ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:f26d42a15d09d9a643b231df929fa3cf609bedc58a728eb445be89a9d8d1da9f
+ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
# Runtime image
-ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:f26d42a15d09d9a643b231df929fa3cf609bedc58a728eb445be89a9d8d1da9f
-ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:733b4042187702f832f7fdecb3aff14a61b288c4ca37af188bb5715c1caebaf8
+ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
+ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev
index e2dc185783..ebc92a22d5 100644
--- a/docker/Dockerfile.dev
+++ b/docker/Dockerfile.dev
@@ -3,7 +3,7 @@ ARG LITELLM_BUILD_IMAGE=python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973a
# Runtime image
ARG LITELLM_RUNTIME_IMAGE=python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973afcbd606dbf021a589cab77d6b00b579d
-ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:733b4042187702f832f7fdecb3aff14a61b288c4ca37af188bb5715c1caebaf8
+ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
diff --git a/docker/Dockerfile.health_check b/docker/Dockerfile.health_check
index 07d35b5e29..a2e5cb9f71 100644
--- a/docker/Dockerfile.health_check
+++ b/docker/Dockerfile.health_check
@@ -1,4 +1,4 @@
-ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:733b4042187702f832f7fdecb3aff14a61b288c4ca37af188bb5715c1caebaf8
+ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
FROM python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973afcbd606dbf021a589cab77d6b00b579d
diff --git a/docker/Dockerfile.non_root b/docker/Dockerfile.non_root
index 8512ae8ad9..3fa73f4243 100644
--- a/docker/Dockerfile.non_root
+++ b/docker/Dockerfile.non_root
@@ -1,8 +1,8 @@
# Base images
-ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:f26d42a15d09d9a643b231df929fa3cf609bedc58a728eb445be89a9d8d1da9f
-ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:f26d42a15d09d9a643b231df929fa3cf609bedc58a728eb445be89a9d8d1da9f
+ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
+ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
ARG PROXY_EXTRAS_SOURCE=published
-ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:733b4042187702f832f7fdecb3aff14a61b288c4ca37af188bb5715c1caebaf8
+ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a
FROM $UV_IMAGE AS uvbin
@@ -32,7 +32,6 @@ ENV UV_PROJECT_ENVIRONMENT=/app/.venv \
PATH="/app/.venv/bin:${PATH}" \
LITELLM_NON_ROOT=true \
PRISMA_BINARY_CACHE_DIR=/app/.cache/prisma-python/binaries \
- PRISMA_CLI_BINARY_TARGETS="debian-openssl-3.0.x" \
XDG_CACHE_HOME=/app/.cache
# Copy dependency metadata first for layer caching
@@ -114,7 +113,6 @@ COPY --from=builder /app/docker/supervisord.conf /etc/supervisord.conf
ENV PATH="/app/.venv/bin:${PATH}" \
PRISMA_BINARY_CACHE_DIR=/app/.cache/prisma-python/binaries \
- PRISMA_CLI_BINARY_TARGETS="debian-openssl-3.0.x" \
HOME=/app \
LITELLM_NON_ROOT=true \
XDG_CACHE_HOME=/app/.cache \
diff --git a/docs/my-website/docs/providers/crusoe.md b/docs/my-website/docs/providers/crusoe.md
new file mode 100644
index 0000000000..aa737cbdcd
--- /dev/null
+++ b/docs/my-website/docs/providers/crusoe.md
@@ -0,0 +1,196 @@
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Crusoe
+
+## Overview
+
+| Property | Details |
+|-------|-------|
+| Description | Crusoe Cloud provides GPU-accelerated inference for open-source large language models, optimized for performance and cost efficiency. |
+| Provider Route on LiteLLM | `crusoe/` |
+| Link to Provider Doc | [Crusoe Managed Inference Documentation ↗](https://docs.crusoecloud.com/managed-inference/overview/index.html) |
+| Base URL | `https://managed-inference-api-proxy.crusoecloud.com/v1` |
+| Supported Operations | [`/chat/completions`](#sample-usage) |
+
+
+
+
+**We support ALL Crusoe models, just set `crusoe/` as a prefix when sending completion requests**
+
+## Available Models
+
+| Model | Description | Context Window |
+|-------|-------------|----------------|
+| `crusoe/deepseek-ai/DeepSeek-R1-0528` | DeepSeek R1 reasoning model (May 2025) | 163,840 tokens |
+| `crusoe/deepseek-ai/DeepSeek-V3-0324` | DeepSeek V3 chat model (March 2025) | 163,840 tokens |
+| `crusoe/google/gemma-3-12b-it` | Google Gemma 3 12B instruction-tuned | 131,072 tokens |
+| `crusoe/meta-llama/Llama-3.3-70B-Instruct` | Llama 3.3 70B instruction-tuned | 131,072 tokens |
+| `crusoe/moonshotai/Kimi-K2-Thinking` | Kimi K2 extended thinking model | 262,144 tokens |
+| `crusoe/openai/gpt-oss-120b` | OpenAI 120B open-source model | 131,072 tokens |
+| `crusoe/Qwen/Qwen3-235B-A22B-Instruct-2507` | Qwen3 235B MoE instruction-tuned | 262,144 tokens |
+
+## Required Variables
+
+```python showLineNumbers title="Environment Variables"
+os.environ["CRUSOE_API_KEY"] = "" # your Crusoe API key
+```
+
+## Usage - LiteLLM Python SDK
+
+### Non-streaming
+
+```python showLineNumbers title="Crusoe Non-streaming Completion"
+import os
+import litellm
+from litellm import completion
+
+os.environ["CRUSOE_API_KEY"] = "" # your Crusoe API key
+
+messages = [{"content": "Hello, how are you?", "role": "user"}]
+
+# Crusoe call
+response = completion(
+ model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
+ messages=messages
+)
+
+print(response)
+```
+
+### Streaming
+
+```python showLineNumbers title="Crusoe Streaming Completion"
+import os
+import litellm
+from litellm import completion
+
+os.environ["CRUSOE_API_KEY"] = "" # your Crusoe API key
+
+messages = [{"content": "Write a short story about AI", "role": "user"}]
+
+# Crusoe call with streaming
+response = completion(
+ model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
+ messages=messages,
+ stream=True
+)
+
+for chunk in response:
+ print(chunk)
+```
+
+### Function Calling
+
+```python showLineNumbers title="Crusoe Function Calling"
+import os
+import litellm
+from litellm import completion
+
+os.environ["CRUSOE_API_KEY"] = "" # your Crusoe API key
+
+tools = [{
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "description": "Get the current weather in a location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA"
+ }
+ },
+ "required": ["location"]
+ }
+ }
+}]
+
+messages = [{"role": "user", "content": "What's the weather in Boston?"}]
+
+response = completion(
+ model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
+ messages=messages,
+ tools=tools,
+ tool_choice="auto"
+)
+
+print(response)
+```
+
+## Usage - LiteLLM Proxy Server
+
+```yaml showLineNumbers title="config.yaml"
+model_list:
+ - model_name: llama-3.3-70b
+ litellm_params:
+ model: crusoe/meta-llama/Llama-3.3-70B-Instruct
+ api_key: os.environ/CRUSOE_API_KEY
+ - model_name: deepseek-r1
+ litellm_params:
+ model: crusoe/deepseek-ai/DeepSeek-R1-0528
+ api_key: os.environ/CRUSOE_API_KEY
+ - model_name: deepseek-v3
+ litellm_params:
+ model: crusoe/deepseek-ai/DeepSeek-V3-0324
+ api_key: os.environ/CRUSOE_API_KEY
+ - model_name: qwen3-235b
+ litellm_params:
+ model: crusoe/Qwen/Qwen3-235B-A22B-Instruct-2507
+ api_key: os.environ/CRUSOE_API_KEY
+ - model_name: kimi-k2
+ litellm_params:
+ model: crusoe/moonshotai/Kimi-K2-Thinking
+ api_key: os.environ/CRUSOE_API_KEY
+```
+
+## Custom API Base
+
+**Option 1: Environment variable**
+
+```python showLineNumbers title="Custom API Base via env var"
+import os
+from litellm import completion
+
+os.environ["CRUSOE_API_BASE"] = "https://custom.crusoecloud.com/v1"
+os.environ["CRUSOE_API_KEY"] = "" # your API key
+
+response = completion(
+ model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
+ messages=[{"content": "Hello!", "role": "user"}],
+)
+```
+
+**Option 2: Pass directly**
+
+```python showLineNumbers title="Custom API Base via parameter"
+from litellm import completion
+
+response = completion(
+ model="crusoe/meta-llama/Llama-3.3-70B-Instruct",
+ messages=[{"content": "Hello!", "role": "user"}],
+ api_base="https://custom.crusoecloud.com/v1",
+ api_key="your-api-key",
+)
+```
+
+## Supported OpenAI Parameters
+
+- `temperature`
+- `max_tokens`
+- `max_completion_tokens`
+- `top_p`
+- `frequency_penalty`
+- `presence_penalty`
+- `stop`
+- `n`
+- `stream`
+- `tools`
+- `tool_choice`
+- `response_format`
+- `seed`
+- `user`
+- `logit_bias`
+- `logprobs`
+- `top_logprobs`
diff --git a/enterprise/enterprise_hooks/banned_keywords.py b/enterprise/enterprise_hooks/banned_keywords.py
index 4df138939a..47421c9605 100644
--- a/enterprise/enterprise_hooks/banned_keywords.py
+++ b/enterprise/enterprise_hooks/banned_keywords.py
@@ -11,6 +11,10 @@ from typing import Literal
import litellm
from litellm.caching.caching import DualCache
from litellm.proxy._types import UserAPIKeyAuth
+from litellm.proxy.guardrails._content_utils import (
+ is_text_content_call_type,
+ iter_message_text,
+)
from litellm.integrations.custom_logger import CustomLogger
from litellm._logging import verbose_proxy_logger
from fastapi import HTTPException
@@ -73,10 +77,9 @@ class _ENTERPRISE_BannedKeywords(CustomLogger):
- check if user id part of blocked list
"""
self.print_verbose("Inside Banned Keyword List Pre-Call Hook")
- if call_type == "completion" and "messages" in data:
- for m in data["messages"]:
- if "content" in m and isinstance(m["content"], str):
- self.test_violation(test_str=m["content"])
+ if is_text_content_call_type(call_type):
+ for text in iter_message_text(data):
+ self.test_violation(test_str=text)
except HTTPException as e:
raise e
@@ -93,11 +96,16 @@ class _ENTERPRISE_BannedKeywords(CustomLogger):
user_api_key_dict: UserAPIKeyAuth,
response,
):
- if isinstance(response, litellm.ModelResponse) and isinstance(
- response.choices[0], litellm.utils.Choices
- ):
- for word in self.banned_keywords_list:
- self.test_violation(test_str=response.choices[0].message.content or "")
+ if not isinstance(response, litellm.ModelResponse):
+ return
+
+ for choice in response.choices:
+ if not isinstance(choice, litellm.utils.Choices):
+ continue
+ message = getattr(choice, "message", None)
+ content = getattr(message, "content", None)
+ if isinstance(content, str):
+ self.test_violation(test_str=content)
async def async_post_call_streaming_hook(
self,
diff --git a/enterprise/enterprise_hooks/google_text_moderation.py b/enterprise/enterprise_hooks/google_text_moderation.py
index 1f26d52adf..5b2d71c5cc 100644
--- a/enterprise/enterprise_hooks/google_text_moderation.py
+++ b/enterprise/enterprise_hooks/google_text_moderation.py
@@ -12,6 +12,7 @@ import litellm
from litellm._logging import verbose_proxy_logger
from litellm.integrations.custom_logger import CustomLogger
from litellm.proxy._types import UserAPIKeyAuth
+from litellm.proxy.guardrails._content_utils import iter_message_text
from litellm.types.utils import CallTypesLiteral
@@ -94,11 +95,9 @@ class _ENTERPRISE_GoogleTextModeration(CustomLogger):
- Calls Google's Text Moderation API
- Rejects request if it fails safety check
"""
- if "messages" in data and isinstance(data["messages"], list):
- text = ""
- for m in data["messages"]: # assume messages is a list
- if "content" in m and isinstance(m["content"], str):
- text += m["content"]
+ # Covers multimodal list content + Responses-API input.
+ text = "".join(iter_message_text(data))
+ if text:
document = self.language_document(content=text, type_=self.document_type)
request = self.moderate_text_request(
diff --git a/enterprise/enterprise_hooks/openai_moderation.py b/enterprise/enterprise_hooks/openai_moderation.py
index a1db9818e5..2162370804 100644
--- a/enterprise/enterprise_hooks/openai_moderation.py
+++ b/enterprise/enterprise_hooks/openai_moderation.py
@@ -19,6 +19,7 @@ import litellm
from litellm._logging import verbose_proxy_logger
from litellm.integrations.custom_logger import CustomLogger
from litellm.proxy._types import UserAPIKeyAuth
+from litellm.proxy.guardrails._content_utils import iter_message_text
from litellm.types.utils import CallTypesLiteral
@@ -37,11 +38,8 @@ class _ENTERPRISE_OpenAI_Moderation(CustomLogger):
user_api_key_dict: UserAPIKeyAuth,
call_type: CallTypesLiteral,
):
- text = ""
- if "messages" in data and isinstance(data["messages"], list):
- for m in data["messages"]: # assume messages is a list
- if "content" in m and isinstance(m["content"], str):
- text += m["content"]
+ # Covers multimodal list content + Responses-API input.
+ text = "".join(iter_message_text(data))
from litellm.proxy.proxy_server import llm_router
diff --git a/enterprise/litellm_enterprise/enterprise_callbacks/secret_detection.py b/enterprise/litellm_enterprise/enterprise_callbacks/secret_detection.py
index 8a7a82df68..f441ce71ab 100644
--- a/enterprise/litellm_enterprise/enterprise_callbacks/secret_detection.py
+++ b/enterprise/litellm_enterprise/enterprise_callbacks/secret_detection.py
@@ -18,6 +18,7 @@ from litellm._logging import verbose_proxy_logger
from litellm.caching.caching import DualCache
from litellm.integrations.custom_guardrail import CustomGuardrail
from litellm.proxy._types import UserAPIKeyAuth
+from litellm.proxy.guardrails._content_utils import walk_user_text
GUARDRAIL_NAME = "hide_secrets"
@@ -473,23 +474,19 @@ class _ENTERPRISE_SecretDetection(CustomGuardrail):
if await self.should_run_check(user_api_key_dict) is False:
return
- if "messages" in data and isinstance(data["messages"], list):
- for message in data["messages"]:
- if "content" in message and isinstance(message["content"], str):
- detected_secrets = self.scan_message_for_secrets(message["content"])
+ # Covers multimodal list content + Responses-API input.
+ def _redact_message_text(text: str) -> str:
+ detected_secrets = self.scan_message_for_secrets(text)
+ for secret in detected_secrets:
+ text = text.replace(secret["value"], "[REDACTED]")
+ if detected_secrets:
+ secret_types = [secret["type"] for secret in detected_secrets]
+ verbose_proxy_logger.warning(
+ f"Detected and redacted secrets in message: {secret_types}"
+ )
+ return text
- for secret in detected_secrets:
- message["content"] = message["content"].replace(
- secret["value"], "[REDACTED]"
- )
-
- if len(detected_secrets) > 0:
- secret_types = [secret["type"] for secret in detected_secrets]
- verbose_proxy_logger.warning(
- f"Detected and redacted secrets in message: {secret_types}"
- )
- else:
- verbose_proxy_logger.debug("No secrets detected on input.")
+ walk_user_text(data, _redact_message_text)
if "prompt" in data:
if isinstance(data["prompt"], str):
@@ -504,11 +501,15 @@ class _ENTERPRISE_SecretDetection(CustomGuardrail):
f"Detected and redacted secrets in prompt: {secret_types}"
)
elif isinstance(data["prompt"], list):
- for item in data["prompt"]:
+ # Index back into the list — assigning to ``item`` would only
+ # rebind the loop variable and leave ``data["prompt"]``
+ # carrying the unredacted secret.
+ for idx, item in enumerate(data["prompt"]):
if isinstance(item, str):
detected_secrets = self.scan_message_for_secrets(item)
for secret in detected_secrets:
item = item.replace(secret["value"], "[REDACTED]")
+ data["prompt"][idx] = item
if len(detected_secrets) > 0:
secret_types = [
secret["type"] for secret in detected_secrets
@@ -517,31 +518,6 @@ class _ENTERPRISE_SecretDetection(CustomGuardrail):
f"Detected and redacted secrets in prompt: {secret_types}"
)
- if "input" in data:
- if isinstance(data["input"], str):
- detected_secrets = self.scan_message_for_secrets(data["input"])
- for secret in detected_secrets:
- data["input"] = data["input"].replace(secret["value"], "[REDACTED]")
- if len(detected_secrets) > 0:
- secret_types = [secret["type"] for secret in detected_secrets]
- verbose_proxy_logger.warning(
- f"Detected and redacted secrets in input: {secret_types}"
- )
- elif isinstance(data["input"], list):
- _input_in_request = data["input"]
- for idx, item in enumerate(_input_in_request):
- if isinstance(item, str):
- detected_secrets = self.scan_message_for_secrets(item)
- for secret in detected_secrets:
- _input_in_request[idx] = item.replace(
- secret["value"], "[REDACTED]"
- )
- if len(detected_secrets) > 0:
- secret_types = [
- secret["type"] for secret in detected_secrets
- ]
- verbose_proxy_logger.warning(
- f"Detected and redacted secrets in input: {secret_types}"
- )
- verbose_proxy_logger.debug("Data after redacting input %s", data)
+ # ``data["input"]`` (Responses API and embeddings/moderation) is
+ # already covered by ``walk_user_text`` above.
return
diff --git a/enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py b/enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py
index a368232038..e8f104c262 100644
--- a/enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py
+++ b/enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py
@@ -10,28 +10,21 @@ has already authenticated the user) and you need to extract user information fro
custom headers or other request attributes.
"""
-from typing import TYPE_CHECKING, Dict, Optional, Union, cast
+from typing import cast
from fastapi import Request
from fastapi.responses import RedirectResponse
-if TYPE_CHECKING:
- from fastapi_sso.sso.base import OpenID
-else:
- from typing import Any as OpenID
-
-from litellm.proxy.management_endpoints.types import CustomOpenID
-
class EnterpriseCustomSSOHandler:
"""
Enterprise Custom SSO Handler for LiteLLM Proxy
-
+
This class provides methods for handling custom SSO authentication flows
where users can implement their own authentication logic by processing
request headers and returning user information in OpenID format.
"""
-
+
@staticmethod
async def handle_custom_ui_sso_sign_in(
request: Request,
@@ -40,16 +33,16 @@ class EnterpriseCustomSSOHandler:
Allow a user to execute their custom code to parse incoming request headers and return a OpenID object
Use this when you have an OAuth proxy in front of LiteLLM (where the OAuth proxy has already authenticated the user)
-
+
Args:
request: The FastAPI request object containing headers and other request data
-
+
Returns:
RedirectResponse: Redirect response that sends the user to the LiteLLM UI with authentication token
-
+
Raises:
ValueError: If custom_ui_sso_sign_in_handler is not configured
-
+
Example:
This method is typically called when a user has already been authenticated by an
external OAuth proxy and the proxy has added custom headers containing user information.
@@ -60,27 +53,44 @@ class EnterpriseCustomSSOHandler:
from litellm.integrations.custom_sso_handler import CustomSSOLoginHandler
from litellm.proxy.proxy_server import (
CommonProxyErrors,
+ general_settings,
premium_user,
user_custom_ui_sso_sign_in_handler,
)
+ from litellm.proxy.auth.trusted_proxy_utils import (
+ require_trusted_proxy_request,
+ )
+
if premium_user is not True:
raise ValueError(CommonProxyErrors.not_premium_user.value)
-
+
if user_custom_ui_sso_sign_in_handler is None:
- raise ValueError("custom_ui_sso_sign_in_handler is not configured. Please set it in general_settings.")
-
- custom_sso_login_handler = cast(CustomSSOLoginHandler, user_custom_ui_sso_sign_in_handler)
- openid_response: OpenID = await custom_sso_login_handler.handle_custom_ui_sso_sign_in(
+ raise ValueError(
+ "custom_ui_sso_sign_in_handler is not configured. Please set it in general_settings."
+ )
+
+ require_trusted_proxy_request(
request=request,
+ general_settings=general_settings,
+ feature_name="Custom UI SSO",
)
-
+
+ custom_sso_login_handler = cast(
+ CustomSSOLoginHandler, user_custom_ui_sso_sign_in_handler
+ )
+ openid_response: OpenID = (
+ await custom_sso_login_handler.handle_custom_ui_sso_sign_in(
+ request=request,
+ )
+ )
+
# Import here to avoid circular imports
from litellm.proxy.management_endpoints.ui_sso import SSOAuthenticationHandler
-
+
return await SSOAuthenticationHandler.get_redirect_response_from_openid(
result=openid_response,
request=request,
received_response=None,
generic_client_id=None,
ui_access_mode=None,
- )
\ No newline at end of file
+ )
diff --git a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py
index 60c564072a..5ed4907034 100644
--- a/enterprise/litellm_enterprise/proxy/hooks/managed_files.py
+++ b/enterprise/litellm_enterprise/proxy/hooks/managed_files.py
@@ -15,6 +15,11 @@ from litellm.caching.caching import DualCache
from litellm.integrations.custom_logger import CustomLogger
from litellm.litellm_core_utils.prompt_templates.common_utils import extract_file_data
from litellm.llms.base_llm.files.transformation import BaseFileEndpoints
+from litellm.llms.base_llm.managed_resources.isolation import (
+ build_list_page,
+ build_owner_filter,
+ can_access_resource,
+)
from litellm.proxy._types import (
CallTypes,
LiteLLM_ManagedFileTable,
@@ -99,6 +104,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
model_mappings=model_mappings,
flat_model_file_ids=list(model_mappings.values()),
created_by=user_api_key_dict.user_id,
+ team_id=user_api_key_dict.team_id,
updated_by=user_api_key_dict.user_id,
)
await self.internal_usage_cache.async_set_cache(
@@ -114,6 +120,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
"model_mappings": json.dumps(model_mappings),
"flat_model_file_ids": list(model_mappings.values()),
"created_by": user_api_key_dict.user_id,
+ "team_id": user_api_key_dict.team_id,
"updated_by": user_api_key_dict.user_id,
}
@@ -125,7 +132,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
db_data["storage_backend"] = hidden_params["storage_backend"]
if "storage_url" in hidden_params:
db_data["storage_url"] = hidden_params["storage_url"]
-
+
verbose_logger.debug(
f"Storage metadata: storage_backend={db_data.get('storage_backend')}, "
f"storage_url={db_data.get('storage_url')}"
@@ -171,6 +178,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
"model_object_id": model_object_id,
"file_purpose": file_purpose,
"created_by": user_api_key_dict.user_id,
+ "team_id": user_api_key_dict.team_id,
"updated_by": user_api_key_dict.user_id,
"status": file_object.status,
},
@@ -229,15 +237,16 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
async def can_user_call_unified_file_id(
self, unified_file_id: str, user_api_key_dict: UserAPIKeyAuth
) -> bool:
- ## check if the user has access to the unified file id
-
- user_id = user_api_key_dict.user_id
managed_file = await self.prisma_client.db.litellm_managedfiletable.find_first(
where={"unified_file_id": unified_file_id}
)
if managed_file:
- return managed_file.created_by == user_id
+ return can_access_resource(
+ user_api_key_dict=user_api_key_dict,
+ created_by=managed_file.created_by,
+ resource_team_id=managed_file.team_id,
+ )
raise HTTPException(
status_code=404,
detail=f"File not found: {unified_file_id}",
@@ -246,8 +255,6 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
async def can_user_call_unified_object_id(
self, unified_object_id: str, user_api_key_dict: UserAPIKeyAuth
) -> bool:
- ## check if the user has access to the unified object id
- user_id = user_api_key_dict.user_id
managed_object = (
await self.prisma_client.db.litellm_managedobjecttable.find_first(
where={"unified_object_id": unified_object_id}
@@ -255,7 +262,11 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
)
if managed_object:
- return managed_object.created_by == user_id
+ return can_access_resource(
+ user_api_key_dict=user_api_key_dict,
+ created_by=managed_object.created_by,
+ resource_team_id=managed_object.team_id,
+ )
raise HTTPException(
status_code=404,
detail=f"Object not found: {unified_object_id}",
@@ -285,28 +296,27 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
raise Exception(
"Filtering by 'target_model_names' is not supported when using managed batches."
)
-
- where_clause: Dict[str, Any] = {"file_purpose": "batch"}
-
- # Filter by user who created the batch
- if user_api_key_dict.user_id:
- where_clause["created_by"] = user_api_key_dict.user_id
-
+
+ owner_filter = build_owner_filter(user_api_key_dict)
+ if owner_filter is None:
+ return build_list_page([])
+
+ where_clause: Dict[str, Any] = {"file_purpose": "batch", **owner_filter}
+
if after:
where_clause["id"] = {"gt": after}
-
- # Fetch more than needed to allow for post-fetch filtering
+
fetch_limit = limit or 20
if target_model_names:
- # Fetch extra to account for filtering
+ # Oversample so post-fetch model-name filtering still has enough rows.
fetch_limit = max(fetch_limit * 3, 100)
-
+
batches = await self.prisma_client.db.litellm_managedobjecttable.find_many(
where=where_clause,
take=fetch_limit,
order={"created_at": "desc"},
)
-
+
batch_objects: List[LiteLLMBatch] = []
for batch in batches:
try:
@@ -314,7 +324,11 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
if len(batch_objects) >= (limit or 20):
break
- batch_data = json.loads(batch.file_object) if isinstance(batch.file_object, str) else batch.file_object
+ batch_data = (
+ json.loads(batch.file_object)
+ if isinstance(batch.file_object, str)
+ else batch.file_object
+ )
batch_obj = LiteLLMBatch(**batch_data)
batch_obj.id = batch.unified_object_id
batch_objects.append(batch_obj)
@@ -324,27 +338,29 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
f"Failed to parse batch object {batch.unified_object_id}: {e}"
)
continue
-
- return {
- "object": "list",
- "data": batch_objects,
- "first_id": batch_objects[0].id if batch_objects else None,
- "last_id": batch_objects[-1].id if batch_objects else None,
- "has_more": len(batch_objects) == (limit or 20),
- }
+
+ return build_list_page(
+ batch_objects, has_more=len(batch_objects) == (limit or 20)
+ )
async def get_user_created_file_ids(
self, user_api_key_dict: UserAPIKeyAuth, model_object_ids: List[str]
) -> List[OpenAIFileObject]:
"""
- Get all file ids created by the user for a list of model object ids
+ Get all file ids the caller is allowed to see for a list of model
+ object ids. Service-account keys (no user_id) are scoped to their
+ team via ``team_id``; admins see all matches.
Returns:
- List of OpenAIFileObject's
"""
+ owner_filter = build_owner_filter(user_api_key_dict)
+ if owner_filter is None:
+ return []
+
file_ids = await self.prisma_client.db.litellm_managedfiletable.find_many(
where={
- "created_by": user_api_key_dict.user_id,
+ **owner_filter,
"flat_model_file_ids": {"hasSome": model_object_ids},
}
)
@@ -377,11 +393,11 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
"""
Check if the user has access to a list of file IDs.
Only checks managed (unified) file IDs.
-
+
Args:
file_ids: List of file IDs to check access for
user_api_key_dict: User API key authentication details
-
+
Raises:
HTTPException: If user doesn't have access to any of the files
"""
@@ -419,10 +435,10 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
### HANDLE TRANSFORMATIONS ###
# Check both completion and acompletion call types
is_completion_call = (
- call_type == CallTypes.completion.value
+ call_type == CallTypes.completion.value
or call_type == CallTypes.acompletion.value
)
-
+
if is_completion_call:
messages = data.get("messages")
model = data.get("model", "")
@@ -431,22 +447,27 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
if file_ids:
# Check user has access to all managed files
await self.check_file_ids_access(file_ids, user_api_key_dict)
-
+
# Check if any files are stored in storage backends and need base64 conversion
# This is needed for Vertex AI/Gemini which requires base64 content
- is_vertex_ai = model and ("vertex_ai" in model or "gemini" in model.lower())
+ is_vertex_ai = model and (
+ "vertex_ai" in model or "gemini" in model.lower()
+ )
if is_vertex_ai:
await self._convert_storage_files_to_base64(
messages=messages,
file_ids=file_ids,
litellm_parent_otel_span=user_api_key_dict.parent_otel_span,
)
-
+
model_file_id_mapping = await self.get_model_file_id_mapping(
file_ids, user_api_key_dict.parent_otel_span
)
data["model_file_id_mapping"] = model_file_id_mapping
- elif call_type == CallTypes.aresponses.value or call_type == CallTypes.responses.value:
+ elif (
+ call_type == CallTypes.aresponses.value
+ or call_type == CallTypes.responses.value
+ ):
# Handle managed files in responses API input and tools
file_ids = []
@@ -611,7 +632,9 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
if model_id is None:
model_id = cast(
Optional[str],
- kwargs.get("litellm_metadata", {}).get("model_info", {}).get("id", None),
+ kwargs.get("litellm_metadata", {})
+ .get("model_info", {})
+ .get("id", None),
)
mapped_file_id: Optional[str] = None
if input_file_id and model_file_id_mapping and model_id:
@@ -648,7 +671,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
) -> List[str]:
"""
Gets file ids from responses API input.
-
+
The input can be:
- A string (no files)
- A list of input items, where each item can have:
@@ -656,32 +679,35 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
- content: a list that can contain items with type: "input_file" and file_id
"""
file_ids: List[str] = []
-
+
if isinstance(input, str):
return file_ids
-
+
if not isinstance(input, list):
return file_ids
-
+
for item in input:
if not isinstance(item, dict):
continue
-
+
# Check for direct input_file type
if item.get("type") == "input_file":
file_id = item.get("file_id")
if file_id:
file_ids.append(file_id)
-
+
# Check for input_file in content array
content = item.get("content")
if isinstance(content, list):
for content_item in content:
- if isinstance(content_item, dict) and content_item.get("type") == "input_file":
+ if (
+ isinstance(content_item, dict)
+ and content_item.get("type") == "input_file"
+ ):
file_id = content_item.get("file_id")
if file_id:
file_ids.append(file_id)
-
+
return file_ids
def get_file_ids_from_responses_tools(
@@ -689,7 +715,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
) -> List[str]:
"""
Gets file ids from responses API tools parameter.
-
+
The tools can contain code_interpreter with container.file_ids:
[
{
@@ -699,14 +725,14 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
]
"""
file_ids: List[str] = []
-
+
if not isinstance(tools, list):
return file_ids
-
+
for tool in tools:
if not isinstance(tool, dict):
continue
-
+
# Check for code_interpreter with container file_ids
if tool.get("type") == "code_interpreter":
container = tool.get("container")
@@ -716,7 +742,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
for file_id in container_file_ids:
if isinstance(file_id, str):
file_ids.append(file_id)
-
+
return file_ids
def get_vector_store_ids_from_file_search_tools(
@@ -916,10 +942,17 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
# Emit Prometheus metrics for managed file creation
prom_logger = self._get_prometheus_logger()
if prom_logger:
- first_model = target_model_names_list[0] if target_model_names_list else None
+ first_model = (
+ target_model_names_list[0] if target_model_names_list else None
+ )
first_provider = ""
if responses:
- first_provider = getattr(responses[0], "_hidden_params", {}).get("custom_llm_provider") or ""
+ first_provider = (
+ getattr(responses[0], "_hidden_params", {}).get(
+ "custom_llm_provider"
+ )
+ or ""
+ )
prom_logger.record_managed_file_created(
model=first_model or "",
api_provider=first_provider,
@@ -1073,16 +1106,24 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
model_name=resolved_model_name,
)
setattr(response, file_attr, unified_file_id)
-
+
# Use llm_router credentials when available. Without credentials,
# Azure and other auth-required providers return 500/401.
file_object = None
try:
# Import module and use getattr for better testability with mocks
import litellm.proxy.proxy_server as proxy_server_module
- _llm_router = getattr(proxy_server_module, 'llm_router', None)
+
+ _llm_router = getattr(
+ proxy_server_module, "llm_router", None
+ )
if _llm_router is not None and model_id:
- _creds = _llm_router.get_deployment_credentials_with_provider(model_id) or {}
+ _creds = (
+ _llm_router.get_deployment_credentials_with_provider(
+ model_id
+ )
+ or {}
+ )
file_object = await litellm.afile_retrieve(
file_id=original_file_id,
**_creds,
@@ -1099,7 +1140,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
verbose_logger.warning(
f"Failed to retrieve file object for {file_attr}={original_file_id}: {str(e)}. Storing with None and will fetch on-demand."
)
-
+
await self.store_unified_file_id(
file_id=unified_file_id,
file_object=file_object,
@@ -1128,6 +1169,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
from litellm.litellm_core_utils.get_llm_provider_logic import (
get_llm_provider,
)
+
_, batch_provider, _, _ = get_llm_provider(model=model_name)
except Exception:
if "/" in model_name:
@@ -1199,7 +1241,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
# Case 1 : This is not a managed file
if not stored_file_object:
raise Exception(f"LiteLLM Managed File object with id={file_id} not found")
-
+
# Case 2: Managed file and the file object exists in the database
# The stored file_object has the raw provider ID. Replace with the unified ID
# so callers see a consistent ID (matching Case 3 which does response.id = file_id).
@@ -1217,13 +1259,21 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
)
try:
- model_id, model_file_id = next(iter(stored_file_object.model_mappings.items()))
- credentials = llm_router.get_deployment_credentials_with_provider(model_id) or {}
- response = await litellm.afile_retrieve(file_id=model_file_id, **credentials)
+ model_id, model_file_id = next(
+ iter(stored_file_object.model_mappings.items())
+ )
+ credentials = (
+ llm_router.get_deployment_credentials_with_provider(model_id) or {}
+ )
+ response = await litellm.afile_retrieve(
+ file_id=model_file_id, **credentials
+ )
response.id = file_id # Replace with unified ID
return response
except Exception as e:
- raise Exception(f"Failed to retrieve file {file_id} from provider: {str(e)}") from e
+ raise Exception(
+ f"Failed to retrieve file {file_id} from provider: {str(e)}"
+ ) from e
async def afile_list(
self,
@@ -1245,19 +1295,19 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
import litellm.proxy.proxy_server as proxy_server_module
# Check if the scheduler has the batch cost checking job registered
- scheduler = getattr(proxy_server_module, 'scheduler', None)
+ scheduler = getattr(proxy_server_module, "scheduler", None)
if scheduler is None:
return False
-
+
# Check if the check_batch_cost_job exists in the scheduler
try:
- job = scheduler.get_job('check_batch_cost_job')
+ job = scheduler.get_job("check_batch_cost_job")
if job is not None:
return True
except Exception:
# Job not found or scheduler doesn't support get_job
pass
-
+
return False
except Exception as e:
verbose_logger.warning(
@@ -1265,28 +1315,26 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
)
return False
- async def _get_batches_referencing_file(
- self, file_id: str
- ) -> List[Dict[str, Any]]:
+ async def _get_batches_referencing_file(self, file_id: str) -> List[Dict[str, Any]]:
"""
Find batches that reference this file and still need cost tracking.
Find batches that are in non-terminal state and have not yet been processed by CheckBatchCost.
Args:
file_id: The unified file ID to check
-
+
Returns:
List of batch objects referencing this file in non-terminal state
(max 10 for error message display)
"""
# Prepare list of file IDs to check (both unified and provider IDs)
file_ids_to_check = [file_id]
-
+
# Get model-specific file IDs for this unified file ID if it's a managed file
try:
model_file_id_mapping = await self.get_model_file_id_mapping(
[file_id], litellm_parent_otel_span=None
)
-
+
if model_file_id_mapping and file_id in model_file_id_mapping:
# Add all provider file IDs for this unified file
provider_file_ids = list(model_file_id_mapping[file_id].values())
@@ -1296,59 +1344,67 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
f"Could not get model file ID mapping for {file_id}: {e}. "
f"Will only check unified file ID."
)
- MAX_MATCHES_TO_RETURN = 10
-
+ MAX_MATCHES_TO_RETURN = 10
+
batches = await self.prisma_client.db.litellm_managedobjecttable.find_many(
where={
"file_purpose": "batch",
"batch_processed": False,
- "status": {"not_in": ["failed", "expired", "cancelled"]}
+ "status": {"not_in": ["failed", "expired", "cancelled"]},
},
take=MAX_MATCHES_TO_RETURN,
order={"created_at": "desc"},
)
-
+
referencing_batches = []
for batch in batches:
try:
# Parse the batch file_object to check for file references
- batch_data = json.loads(batch.file_object) if isinstance(batch.file_object, str) else batch.file_object
-
+ batch_data = (
+ json.loads(batch.file_object)
+ if isinstance(batch.file_object, str)
+ else batch.file_object
+ )
+
# Extract file IDs from batch
# Batches typically reference the unified file ID in input_file_id
# Output and error files are generated by the provider
input_file_id = batch_data.get("input_file_id")
output_file_id = batch_data.get("output_file_id")
error_file_id = batch_data.get("error_file_id")
-
- referenced_file_ids = [fid for fid in [input_file_id, output_file_id, error_file_id] if fid]
-
+
+ referenced_file_ids = [
+ fid for fid in [input_file_id, output_file_id, error_file_id] if fid
+ ]
+
# Check if any referenced file ID matches the file we're trying to delete
if any(ref_id in file_ids_to_check for ref_id in referenced_file_ids):
- referencing_batches.append({
- "batch_id": batch.unified_object_id,
- "status": batch.status,
- "created_at": batch.created_at,
- })
+ referencing_batches.append(
+ {
+ "batch_id": batch.unified_object_id,
+ "status": batch.status,
+ "created_at": batch.created_at,
+ }
+ )
except Exception as e:
verbose_logger.warning(
f"Error parsing batch object {batch.unified_object_id}: {e}"
)
continue
-
+
return referencing_batches
async def _check_file_deletion_allowed(self, file_id: str) -> None:
"""
Check if file deletion should be blocked due to batch references.
-
+
Blocks deletion if:
1. File is referenced by any batch in non-terminal state, AND
2. Batch polling is configured (user wants cost tracking)
-
+
Args:
file_id: The unified file ID to check
-
+
Raises:
HTTPException: If file deletion should be blocked
"""
@@ -1356,39 +1412,45 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
if not self._is_batch_polling_enabled():
# Batch polling not configured, allow deletion
return
-
+
# Check if file is referenced by any non-terminal batches
referencing_batches = await self._get_batches_referencing_file(file_id)
-
+
if referencing_batches:
# File is referenced by non-terminal batches and polling is enabled
- MAX_BATCHES_IN_ERROR = 5 # Limit batches shown in error message for readability
-
+ MAX_BATCHES_IN_ERROR = (
+ 5 # Limit batches shown in error message for readability
+ )
+
# Show up to MAX_BATCHES_IN_ERROR in the error message
batches_to_show = referencing_batches[:MAX_BATCHES_IN_ERROR]
- batch_statuses = [f"{b['batch_id']}: {b['status']}" for b in batches_to_show]
-
+ batch_statuses = [
+ f"{b['batch_id']}: {b['status']}" for b in batches_to_show
+ ]
+
# Determine the count message
count_message = f"{len(referencing_batches)}"
- if len(referencing_batches) >= 10: # MAX_MATCHES_TO_RETURN from _get_batches_referencing_file
+ if (
+ len(referencing_batches) >= 10
+ ): # MAX_MATCHES_TO_RETURN from _get_batches_referencing_file
count_message = "10+"
-
+
error_message = (
f"Cannot delete file {file_id}. "
f"The file is referenced by {count_message} batch(es) in non-terminal state"
)
-
+
# Add specific batch details if not too many
if len(referencing_batches) <= MAX_BATCHES_IN_ERROR:
error_message += f": {', '.join(batch_statuses)}. "
else:
error_message += f" (showing {MAX_BATCHES_IN_ERROR} most recent): {', '.join(batch_statuses)}. "
-
+
error_message += (
f"To delete this file before complete cost tracking, please delete or cancel the referencing batch(es) first. "
f"Alternatively, wait for all batches to complete and for cost to be computed (batch_processed=true)."
)
-
+
# Record blocked deletion metric
prom_logger = self._get_prometheus_logger()
if prom_logger:
@@ -1419,7 +1481,9 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
specific_model_file_id_mapping = model_file_id_mapping.get(file_id)
if specific_model_file_id_mapping:
# Remove conflicting keys from data to avoid duplicate keyword arguments
- filtered_data = {k: v for k, v in data.items() if k not in ("model", "file_id")}
+ filtered_data = {
+ k: v for k, v in data.items() if k not in ("model", "file_id")
+ }
for model_id, model_file_id in specific_model_file_id_mapping.items():
delete_response = await llm_router.afile_delete(model=model_id, file_id=model_file_id, **filtered_data) # type: ignore
@@ -1480,7 +1544,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
) -> None:
"""
Convert files stored in storage backends to base64 format for Vertex AI/Gemini.
-
+
This method checks if any managed files are stored in storage backends,
downloads them, and converts them to base64 format in the messages.
"""
@@ -1488,29 +1552,29 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
for file_id in file_ids:
# Check if this is a base64 encoded unified file ID
decoded_unified_file_id = _is_base64_encoded_unified_file_id(file_id)
-
+
if not decoded_unified_file_id:
continue
-
+
# Check database for storage backend info
# IMPORTANT: The database stores the base64 encoded unified_file_id (not the decoded version)
# So we query with the original file_id (which is base64 encoded)
db_file = await self.prisma_client.db.litellm_managedfiletable.find_first(
where={"unified_file_id": file_id}
)
-
+
if not db_file or not db_file.storage_backend or not db_file.storage_url:
continue
-
+
# File is stored in a storage backend, download and convert to base64
try:
from litellm.llms.base_llm.files.storage_backend_factory import (
get_storage_backend,
)
-
+
storage_backend_name = db_file.storage_backend
storage_url = db_file.storage_url
-
+
# Get storage backend (uses same env vars as callback)
try:
storage_backend = get_storage_backend(storage_backend_name)
@@ -1519,18 +1583,22 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
f"Storage backend '{storage_backend_name}' error for file {file_id}: {str(e)}"
)
continue
-
+
file_content = await storage_backend.download_file(storage_url)
-
+
# Determine content type from file object
- content_type = self._get_content_type_from_file_object(db_file.file_object)
-
+ content_type = self._get_content_type_from_file_object(
+ db_file.file_object
+ )
+
# Convert to base64
base64_data = base64.b64encode(file_content).decode("utf-8")
base64_data_uri = f"data:{content_type};base64,{base64_data}"
-
+
# Update messages to use base64 instead of file_id
- self._update_messages_with_base64_data(messages, file_id, base64_data_uri, content_type)
+ self._update_messages_with_base64_data(
+ messages, file_id, base64_data_uri, content_type
+ )
except Exception as e:
verbose_logger.exception(
f"Error converting file {file_id} from storage backend to base64: {str(e)}"
@@ -1541,21 +1609,21 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
def _get_content_type_from_file_object(self, file_object: Optional[Any]) -> str:
"""
Determine content type from file object.
-
+
Uses the MIME type utility for consistent detection and normalization.
-
+
Args:
file_object: The file object from the database (can be dict, JSON string, or None)
-
+
Returns:
str: MIME type (defaults to "application/octet-stream" if cannot be determined)
"""
# Use utility function for detection
content_type = get_content_type_from_file_object(file_object)
-
+
# Normalize for Gemini/Vertex AI (requires image/jpeg, not image/jpg)
content_type = normalize_mime_type_for_provider(content_type, provider="gemini")
-
+
return content_type
def _update_messages_with_base64_data(
@@ -1567,7 +1635,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
) -> None:
"""
Update messages to replace file_id with base64 data URI.
-
+
Args:
messages: List of messages to update
file_id: The file ID to replace
@@ -1582,7 +1650,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
if element.get("type") == "file":
file_element = cast(ChatCompletionFileObject, element)
file_element_file = file_element.get("file", {})
-
+
if file_element_file.get("file_id") == file_id:
# Replace file_id with base64 data
file_element_file["file_data"] = base64_data_uri
@@ -1590,7 +1658,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
file_element_file["format"] = content_type
# Remove file_id to ensure only file_data is used
file_element_file.pop("file_id", None)
-
+
verbose_logger.debug(
f"Converted file {file_id} from storage backend to base64 with format {content_type}"
)
diff --git a/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py b/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py
index f6ed7767c4..75229bacc8 100644
--- a/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py
+++ b/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py
@@ -588,24 +588,21 @@ async def update_project( # noqa: PLR0915
param="project_id",
)
- # Validate team exists and get team object for limit + permission checks
- team_id_to_check = data.team_id or existing_project.team_id
- team_obj_for_checks = None
- if team_id_to_check is not None:
- team_obj_for_checks = await _validate_team_exists(
- team_id=team_id_to_check, prisma_client=prisma_client
+ # Permission to *edit* the project must be evaluated against the
+ # project's CURRENT team. Sourcing the team from `data.team_id`
+ # would let an admin of any team pass the check by supplying their
+ # own team_id, hijacking the project (VERIA-55).
+ target_team_id = data.team_id or existing_project.team_id
+ target_team_obj = None
+ if target_team_id is not None:
+ target_team_obj = await _validate_team_exists(
+ team_id=target_team_id, prisma_client=prisma_client
)
- # Check if user has permission to update this project
has_permission = await _check_user_permission_for_project(
user_api_key_dict=user_api_key_dict,
team_id=existing_project.team_id,
prisma_client=prisma_client,
- team_object=(
- LiteLLM_TeamTable(**team_obj_for_checks.model_dump())
- if team_obj_for_checks
- else None
- ),
)
if not has_permission:
@@ -614,10 +611,32 @@ async def update_project( # noqa: PLR0915
detail={"error": "Only admins or team admins can update projects"},
)
+ # Reassigning to a different team also requires admin rights on the
+ # destination team — otherwise a team admin could shed projects into
+ # an unsuspecting team's namespace.
+ if data.team_id is not None and data.team_id != existing_project.team_id:
+ can_assign_to_target = await _check_user_permission_for_project(
+ user_api_key_dict=user_api_key_dict,
+ team_id=data.team_id,
+ prisma_client=prisma_client,
+ team_object=(
+ LiteLLM_TeamTable(**target_team_obj.model_dump())
+ if target_team_obj
+ else None
+ ),
+ )
+ if not can_assign_to_target:
+ raise HTTPException(
+ status_code=403,
+ detail={
+ "error": "Cannot reassign project to a team you are not an admin of"
+ },
+ )
+
# Validate project limits against team limits
- if team_obj_for_checks is not None:
+ if target_team_obj is not None:
_check_team_project_limits(
- team_object=LiteLLM_TeamTable(**team_obj_for_checks.model_dump()),
+ team_object=LiteLLM_TeamTable(**target_team_obj.model_dump()),
data=data,
)
@@ -857,10 +876,16 @@ async def project_info(
where={"team_id": project.team_id}
)
if team:
- is_team_member = (
- user_api_key_dict.user_id in team.admins
- or user_api_key_dict.user_id in team.members
- )
+ caller_user_id = user_api_key_dict.user_id
+ for m in team.members_with_roles or []:
+ m_user_id = (
+ m.get("user_id")
+ if isinstance(m, dict)
+ else getattr(m, "user_id", None)
+ )
+ if m_user_id == caller_user_id:
+ is_team_member = True
+ break
if not (is_admin or is_team_member):
raise HTTPException(
@@ -911,20 +936,20 @@ async def list_projects(
include={"litellm_budget_table": True, "object_permission": True}
)
else:
- # Get projects for teams the user belongs to
- user_teams = await prisma_client.db.litellm_teamtable.find_many(
- where={
- "OR": [
- {"members": {"has": user_api_key_dict.user_id}},
- {"admins": {"has": user_api_key_dict.user_id}},
- ]
- }
+ # Look up the user's team memberships via the reverse-index on
+ # LiteLLM_UserTable.teams (maintained by team_member_add alongside
+ # members_with_roles). This avoids a full scan of all team rows.
+ user_record = await prisma_client.db.litellm_usertable.find_unique(
+ where={"user_id": user_api_key_dict.user_id},
+ )
+ user_team_ids = (
+ user_record.teams
+ if user_record is not None and user_record.teams
+ else []
)
- team_ids = [team.team_id for team in user_teams]
-
projects = await prisma_client.db.litellm_projecttable.find_many(
- where={"team_id": {"in": team_ids}},
+ where={"team_id": {"in": user_team_ids}},
include={"litellm_budget_table": True, "object_permission": True},
)
diff --git a/enterprise/pyproject.toml b/enterprise/pyproject.toml
index cfbbe1f494..9698e7912d 100644
--- a/enterprise/pyproject.toml
+++ b/enterprise/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "litellm-enterprise"
-version = "0.1.39"
+version = "0.1.40"
description = "Package for LiteLLM Enterprise features"
readme = "README.md"
requires-python = ">=3.9"
@@ -16,7 +16,7 @@ Repository = "https://github.com/BerriAI/litellm"
Documentation = "https://docs.litellm.ai"
[build-system]
-requires = ["uv_build==0.10.7"]
+requires = ["uv_build==0.11.8"]
build-backend = "uv_build"
[tool.uv]
@@ -26,7 +26,7 @@ required-version = ">=0.10.9"
module-root = ""
[tool.commitizen]
-version = "0.1.39"
+version = "0.1.40"
version_files = [
"pyproject.toml:^version",
"../pyproject.toml:litellm-enterprise==",
diff --git a/litellm-js/proxy/package-lock.json b/litellm-js/proxy/package-lock.json
new file mode 100644
index 0000000000..0d09fa1a6c
--- /dev/null
+++ b/litellm-js/proxy/package-lock.json
@@ -0,0 +1,2054 @@
+{
+ "name": "proxy",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "hono": "4.12.16",
+ "openai": "4.29.2"
+ },
+ "devDependencies": {
+ "@cloudflare/workers-types": "4.20260501.1",
+ "wrangler": "4.87.0"
+ }
+ },
+ "node_modules/@cloudflare/kv-asset-handler": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.0.tgz",
+ "integrity": "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
+ "node_modules/@cloudflare/unenv-preset": {
+ "version": "2.16.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.1.tgz",
+ "integrity": "sha512-ECxObrMfyTl5bhQf/lZCXwo5G6xX9IAUo+nDMKK4SZ8m4Jvvxp52vilxyySSWh2YTZz8+HQ07qGH/2rEom1vDw==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "peerDependencies": {
+ "unenv": "2.0.0-rc.24",
+ "workerd": ">1.20260305.0 <2.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "workerd": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-64": {
+ "version": "1.20260430.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260430.1.tgz",
+ "integrity": "sha512-ADohZUHf7NBvPp2PdZig2Opxx+hDkk3ve7jrTne3JRx9kDSB73zc4LzcEeEN8LKkbAcqZmvfRJfpChSlusu0lA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-arm64": {
+ "version": "1.20260430.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260430.1.tgz",
+ "integrity": "sha512-/DoYC/1wHs+YRZzzqSQg1/EHB4hiv1yV5U8FnmapRRIzVaPtnt+ApeOXeMrIdKidgKOI8TqQzgBU8xbIM7Cl4Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-64": {
+ "version": "1.20260430.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260430.1.tgz",
+ "integrity": "sha512-koJhBWvEVZPKCVFtMLp2iMHlYr+lFCF47wGbnlKdHVlemV0zTxJEyHI8aLlrhPLhBmOmYLp46rXw09/qJkRIhQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-arm64": {
+ "version": "1.20260430.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260430.1.tgz",
+ "integrity": "sha512-hMdapNAzNQZDXGGkg4Slydc3fRJP5FUZLJVVcZCW/+imhhJro9Z1rv5n/wfR+txKoSWhTYR8eOp8Pyi2bzLzlw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-windows-64": {
+ "version": "1.20260430.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260430.1.tgz",
+ "integrity": "sha512-jS3ffixjb5USOwz4frw4WzCz0HrjVxkgyU3WiYb06N7hBAfN6eOrveAJ4QRef0+suK4V1vQFoB1oKdRBsXe9Dw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workers-types": {
+ "version": "4.20260501.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20260501.1.tgz",
+ "integrity": "sha512-B/VX2w3my/sCqxKyWOX7SxUpFC1uD8Gh7I2zbI1d3zA8p7Tx03AFsnuEx8lYLmcd8yONAA93YsAZb1wAaLK83w==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0"
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@emnapi/runtime": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
+ "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
+ "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
+ "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
+ "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
+ "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
+ "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
+ "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
+ "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
+ "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
+ "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
+ "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
+ "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
+ "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
+ "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
+ "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
+ "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
+ "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
+ "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
+ "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
+ "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
+ "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
+ "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@img/colour": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
+ "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@img/sharp-darwin-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
+ "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-arm64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-darwin-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",
+ "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-darwin-x64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-libvips-darwin-arm64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
+ "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-darwin-x64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",
+ "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-arm": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",
+ "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-arm64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",
+ "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-ppc64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",
+ "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-riscv64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",
+ "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-s390x": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",
+ "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linux-x64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",
+ "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",
+ "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",
+ "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",
+ "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",
+ "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-arm64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-ppc64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",
+ "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-ppc64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-riscv64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",
+ "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-riscv64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-s390x": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",
+ "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-s390x": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linux-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",
+ "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linux-x64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",
+ "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-linuxmusl-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",
+ "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-libvips-linuxmusl-x64": "1.2.4"
+ }
+ },
+ "node_modules/@img/sharp-wasm32": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",
+ "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",
+ "cpu": [
+ "wasm32"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/runtime": "^1.7.0"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-arm64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",
+ "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-ia32": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",
+ "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@img/sharp-win32-x64": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",
+ "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0 AND LGPL-3.0-or-later",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
+ "node_modules/@poppinss/colors": {
+ "version": "4.1.6",
+ "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz",
+ "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^4.1.5"
+ }
+ },
+ "node_modules/@poppinss/dumper": {
+ "version": "0.6.5",
+ "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz",
+ "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@sindresorhus/is": "^7.0.2",
+ "supports-color": "^10.0.0"
+ }
+ },
+ "node_modules/@poppinss/exception": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz",
+ "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@sindresorhus/is": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz",
+ "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/is?sponsor=1"
+ }
+ },
+ "node_modules/@speed-highlight/core": {
+ "version": "1.2.15",
+ "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.15.tgz",
+ "integrity": "sha512-BMq1K3DsElxDWawkX6eLg9+CKJrTVGCBAWVuHXVUV2u0s2711qiChLSId6ikYPfxhdYocLNt3wWwSvDiTvFabw==",
+ "dev": true,
+ "license": "CC0-1.0"
+ },
+ "node_modules/@types/node": {
+ "version": "18.19.130",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz",
+ "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==",
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~5.26.4"
+ }
+ },
+ "node_modules/@types/node-fetch": {
+ "version": "2.6.13",
+ "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz",
+ "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*",
+ "form-data": "^4.0.4"
+ }
+ },
+ "node_modules/abort-controller": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
+ "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
+ "license": "MIT",
+ "dependencies": {
+ "event-target-shim": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=6.5"
+ }
+ },
+ "node_modules/agentkeepalive": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",
+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "humanize-ms": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+ "license": "MIT"
+ },
+ "node_modules/base-64": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz",
+ "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA=="
+ },
+ "node_modules/blake3-wasm": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",
+ "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/charenc": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
+ "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "license": "MIT",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/crypt": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
+ "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/detect-libc": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/digest-fetch": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-1.3.0.tgz",
+ "integrity": "sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==",
+ "license": "ISC",
+ "dependencies": {
+ "base-64": "^0.1.0",
+ "md5": "^2.3.0"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/error-stack-parser-es": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz",
+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-set-tostringtag": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.6",
+ "has-tostringtag": "^1.0.2",
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.3",
+ "@esbuild/android-arm": "0.27.3",
+ "@esbuild/android-arm64": "0.27.3",
+ "@esbuild/android-x64": "0.27.3",
+ "@esbuild/darwin-arm64": "0.27.3",
+ "@esbuild/darwin-x64": "0.27.3",
+ "@esbuild/freebsd-arm64": "0.27.3",
+ "@esbuild/freebsd-x64": "0.27.3",
+ "@esbuild/linux-arm": "0.27.3",
+ "@esbuild/linux-arm64": "0.27.3",
+ "@esbuild/linux-ia32": "0.27.3",
+ "@esbuild/linux-loong64": "0.27.3",
+ "@esbuild/linux-mips64el": "0.27.3",
+ "@esbuild/linux-ppc64": "0.27.3",
+ "@esbuild/linux-riscv64": "0.27.3",
+ "@esbuild/linux-s390x": "0.27.3",
+ "@esbuild/linux-x64": "0.27.3",
+ "@esbuild/netbsd-arm64": "0.27.3",
+ "@esbuild/netbsd-x64": "0.27.3",
+ "@esbuild/openbsd-arm64": "0.27.3",
+ "@esbuild/openbsd-x64": "0.27.3",
+ "@esbuild/openharmony-arm64": "0.27.3",
+ "@esbuild/sunos-x64": "0.27.3",
+ "@esbuild/win32-arm64": "0.27.3",
+ "@esbuild/win32-ia32": "0.27.3",
+ "@esbuild/win32-x64": "0.27.3"
+ }
+ },
+ "node_modules/event-target-shim": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
+ "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/form-data": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
+ "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
+ "license": "MIT",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "hasown": "^2.0.2",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/form-data-encoder": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz",
+ "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==",
+ "license": "MIT"
+ },
+ "node_modules/formdata-node": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz",
+ "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==",
+ "license": "MIT",
+ "dependencies": {
+ "node-domexception": "1.0.0",
+ "web-streams-polyfill": "4.0.0-beta.3"
+ },
+ "engines": {
+ "node": ">= 12.20"
+ }
+ },
+ "node_modules/formdata-node/node_modules/web-streams-polyfill": {
+ "version": "4.0.0-beta.3",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz",
+ "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-tostringtag": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+ "license": "MIT",
+ "dependencies": {
+ "has-symbols": "^1.0.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz",
+ "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/hono": {
+ "version": "4.12.16",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.16.tgz",
+ "integrity": "sha512-jN0ZewiNAWSe5khM3EyCmBb250+b40wWbwNILNfEvq84VREWwOIkuUsFONk/3i3nqkz7Oe1PcpM2mwQEK2L9Kg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.9.0"
+ }
+ },
+ "node_modules/humanize-ms": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.0.0"
+ }
+ },
+ "node_modules/is-buffer": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
+ "license": "MIT"
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/md5": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
+ "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "charenc": "0.0.2",
+ "crypt": "0.0.2",
+ "is-buffer": "~1.1.6"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/miniflare": {
+ "version": "4.20260430.0",
+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260430.0.tgz",
+ "integrity": "sha512-MWvMm3Siho9Yj7lbJZidLs8hbrRvIcOrif2mnsHQZdvoKfedpea+GaN8XJxbpRcq0B2WzNI1BB1ihdnqes3/ZA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "0.8.1",
+ "sharp": "^0.34.5",
+ "undici": "7.24.8",
+ "workerd": "1.20260430.1",
+ "ws": "8.18.0",
+ "youch": "4.1.0-beta.10"
+ },
+ "bin": {
+ "miniflare": "bootstrap.js"
+ },
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/node-domexception": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
+ "deprecated": "Use your platform's native DOMException instead",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "github",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.5.0"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/openai": {
+ "version": "4.29.2",
+ "resolved": "https://registry.npmjs.org/openai/-/openai-4.29.2.tgz",
+ "integrity": "sha512-cPkT6zjEcE4qU5OW/SoDDuXEsdOLrXlAORhzmaguj5xZSPlgKvLhi27sFWhLKj07Y6WKNWxcwIbzm512FzTBNQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/node": "^18.11.18",
+ "@types/node-fetch": "^2.6.4",
+ "abort-controller": "^3.0.0",
+ "agentkeepalive": "^4.2.1",
+ "digest-fetch": "^1.3.0",
+ "form-data-encoder": "1.7.2",
+ "formdata-node": "^4.3.2",
+ "node-fetch": "^2.6.7",
+ "web-streams-polyfill": "^3.2.1"
+ },
+ "bin": {
+ "openai": "bin/cli"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
+ "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/semver": {
+ "version": "7.7.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
+ "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/sharp": {
+ "version": "0.34.5",
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",
+ "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@img/colour": "^1.0.0",
+ "detect-libc": "^2.1.2",
+ "semver": "^7.7.3"
+ },
+ "engines": {
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/libvips"
+ },
+ "optionalDependencies": {
+ "@img/sharp-darwin-arm64": "0.34.5",
+ "@img/sharp-darwin-x64": "0.34.5",
+ "@img/sharp-libvips-darwin-arm64": "1.2.4",
+ "@img/sharp-libvips-darwin-x64": "1.2.4",
+ "@img/sharp-libvips-linux-arm": "1.2.4",
+ "@img/sharp-libvips-linux-arm64": "1.2.4",
+ "@img/sharp-libvips-linux-ppc64": "1.2.4",
+ "@img/sharp-libvips-linux-riscv64": "1.2.4",
+ "@img/sharp-libvips-linux-s390x": "1.2.4",
+ "@img/sharp-libvips-linux-x64": "1.2.4",
+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.4",
+ "@img/sharp-libvips-linuxmusl-x64": "1.2.4",
+ "@img/sharp-linux-arm": "0.34.5",
+ "@img/sharp-linux-arm64": "0.34.5",
+ "@img/sharp-linux-ppc64": "0.34.5",
+ "@img/sharp-linux-riscv64": "0.34.5",
+ "@img/sharp-linux-s390x": "0.34.5",
+ "@img/sharp-linux-x64": "0.34.5",
+ "@img/sharp-linuxmusl-arm64": "0.34.5",
+ "@img/sharp-linuxmusl-x64": "0.34.5",
+ "@img/sharp-wasm32": "0.34.5",
+ "@img/sharp-win32-arm64": "0.34.5",
+ "@img/sharp-win32-ia32": "0.34.5",
+ "@img/sharp-win32-x64": "0.34.5"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "10.2.2",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
+ "license": "MIT"
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "dev": true,
+ "license": "0BSD",
+ "optional": true
+ },
+ "node_modules/undici": {
+ "version": "7.24.8",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.8.tgz",
+ "integrity": "sha512-6KQ/+QxK49Z/p3HO6E5ZCZWNnCasyZLa5ExaVYyvPxUwKtbCPMKELJOqh7EqOle0t9cH/7d2TaaTRRa6Nhs4YQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "5.26.5",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
+ "license": "MIT"
+ },
+ "node_modules/unenv": {
+ "version": "2.0.0-rc.24",
+ "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz",
+ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "pathe": "^2.0.3"
+ }
+ },
+ "node_modules/web-streams-polyfill": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
+ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "license": "MIT",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/workerd": {
+ "version": "1.20260430.1",
+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260430.1.tgz",
+ "integrity": "sha512-KEgIWyiw3Jmn+DCd/L3ePo5fmiiYb/UcwKvDWPf/nLLOiwShDFzDSsegU5NY/JcwgvO/QsLHVi2FYrbkcXNY5Q==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "workerd": "bin/workerd"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "optionalDependencies": {
+ "@cloudflare/workerd-darwin-64": "1.20260430.1",
+ "@cloudflare/workerd-darwin-arm64": "1.20260430.1",
+ "@cloudflare/workerd-linux-64": "1.20260430.1",
+ "@cloudflare/workerd-linux-arm64": "1.20260430.1",
+ "@cloudflare/workerd-windows-64": "1.20260430.1"
+ }
+ },
+ "node_modules/wrangler": {
+ "version": "4.87.0",
+ "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.87.0.tgz",
+ "integrity": "sha512-lfhfKwLfQlowwgV0xhlYgE9fU3n0I30d4ccGY/rTCEm/n42Mjvlr0Ng3ZPNqlsrsKBcDR531V7dsPkgELvrk/Q==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "dependencies": {
+ "@cloudflare/kv-asset-handler": "0.5.0",
+ "@cloudflare/unenv-preset": "2.16.1",
+ "blake3-wasm": "2.1.5",
+ "esbuild": "0.27.3",
+ "miniflare": "4.20260430.0",
+ "path-to-regexp": "6.3.0",
+ "unenv": "2.0.0-rc.24",
+ "workerd": "1.20260430.1"
+ },
+ "bin": {
+ "wrangler": "bin/wrangler.js",
+ "wrangler2": "bin/wrangler.js"
+ },
+ "engines": {
+ "node": ">=22.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ },
+ "peerDependencies": {
+ "@cloudflare/workers-types": "^4.20260430.1"
+ },
+ "peerDependenciesMeta": {
+ "@cloudflare/workers-types": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ws": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
+ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/youch": {
+ "version": "4.1.0-beta.10",
+ "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz",
+ "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@poppinss/dumper": "^0.6.4",
+ "@speed-highlight/core": "^1.2.7",
+ "cookie": "^1.0.2",
+ "youch-core": "^0.3.3"
+ }
+ },
+ "node_modules/youch-core": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz",
+ "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/exception": "^1.2.2",
+ "error-stack-parser-es": "^1.0.5"
+ }
+ }
+ }
+}
diff --git a/litellm-js/proxy/package.json b/litellm-js/proxy/package.json
index 275fd8c20d..9fd94cd882 100644
--- a/litellm-js/proxy/package.json
+++ b/litellm-js/proxy/package.json
@@ -4,11 +4,11 @@
"deploy": "wrangler deploy --minify src/index.ts"
},
"dependencies": {
- "hono": "4.12.12",
+ "hono": "4.12.16",
"openai": "4.29.2"
},
"devDependencies": {
- "@cloudflare/workers-types": "4.20240208.0",
- "wrangler": "3.32.0"
+ "@cloudflare/workers-types": "4.20260501.1",
+ "wrangler": "4.87.0"
}
}
diff --git a/litellm-js/spend-logs/package-lock.json b/litellm-js/spend-logs/package-lock.json
index ce1762f402..e9fc4b00f6 100644
--- a/litellm-js/spend-logs/package-lock.json
+++ b/litellm-js/spend-logs/package-lock.json
@@ -6,7 +6,7 @@
"": {
"dependencies": {
"@hono/node-server": "1.19.13",
- "hono": "4.12.12"
+ "hono": "4.12.16"
},
"devDependencies": {
"@types/node": "20.19.25",
@@ -548,9 +548,9 @@
}
},
"node_modules/hono": {
- "version": "4.12.12",
- "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.12.tgz",
- "integrity": "sha512-p1JfQMKaceuCbpJKAPKVqyqviZdS0eUxH9v82oWo1kb9xjQ5wA6iP3FNVAPDFlz5/p7d45lO+BpSk1tuSZMF4Q==",
+ "version": "4.12.16",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.16.tgz",
+ "integrity": "sha512-jN0ZewiNAWSe5khM3EyCmBb250+b40wWbwNILNfEvq84VREWwOIkuUsFONk/3i3nqkz7Oe1PcpM2mwQEK2L9Kg==",
"license": "MIT",
"engines": {
"node": ">=16.9.0"
diff --git a/litellm-js/spend-logs/package.json b/litellm-js/spend-logs/package.json
index d8e6a89544..5a7a95c5de 100644
--- a/litellm-js/spend-logs/package.json
+++ b/litellm-js/spend-logs/package.json
@@ -4,7 +4,7 @@
},
"dependencies": {
"@hono/node-server": "1.19.13",
- "hono": "4.12.12"
+ "hono": "4.12.16"
},
"devDependencies": {
"@types/node": "20.19.25",
diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260501195714_managed_resource_team_owner/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260501195714_managed_resource_team_owner/migration.sql
new file mode 100644
index 0000000000..d6f236959b
--- /dev/null
+++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260501195714_managed_resource_team_owner/migration.sql
@@ -0,0 +1,20 @@
+-- Adds `team_id` to managed-resource tables so service-account API
+-- keys (no `user_id`) can be scoped by team instead of bypassing the
+-- `created_by` filter entirely. Existing rows keep `team_id = NULL`
+-- and become invisible to team-only callers — that is the intended isolation
+-- outcome; backfill manually if legacy rows must remain visible.
+--
+-- The composite indexes match the listing query: filter by team owner, sort by
+-- created_at DESC. Tables are typically small (resources per tenant, not per
+-- request); a future operator with a large table can switch to
+-- CREATE INDEX CONCURRENTLY in a follow-up migration.
+
+ALTER TABLE "LiteLLM_ManagedFileTable" ADD COLUMN IF NOT EXISTS "team_id" TEXT;
+ALTER TABLE "LiteLLM_ManagedObjectTable" ADD COLUMN IF NOT EXISTS "team_id" TEXT;
+ALTER TABLE "LiteLLM_ManagedVectorStoreTable" ADD COLUMN IF NOT EXISTS "team_id" TEXT;
+
+-- Index names follow Prisma's auto-generated convention so `prisma migrate diff`
+-- against the schema is clean.
+CREATE INDEX IF NOT EXISTS "LiteLLM_ManagedFileTable_team_id_created_at_idx" ON "LiteLLM_ManagedFileTable" ("team_id", "created_at" DESC);
+CREATE INDEX IF NOT EXISTS "LiteLLM_ManagedObjectTable_team_id_created_at_idx" ON "LiteLLM_ManagedObjectTable" ("team_id", "created_at" DESC);
+CREATE INDEX IF NOT EXISTS "LiteLLM_ManagedVectorStoreTable_team_id_created_at_idx" ON "LiteLLM_ManagedVectorStoreTable" ("team_id", "created_at" DESC);
diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma
index a9d3911c07..84ce99557e 100644
--- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma
+++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma
@@ -884,28 +884,32 @@ model LiteLLM_ManagedFileTable {
storage_backend String? // Storage backend name (e.g., "azure_storage", "gcs", "default")
storage_url String? // The actual storage URL where the file is stored
created_at DateTime @default(now())
- created_by String?
+ created_by String?
+ team_id String? // Team that owns the resource; populated for service-account keys without a user_id so listings can isolate by team.
updated_at DateTime @updatedAt
updated_by String?
@@index([unified_file_id])
+ @@index([team_id, created_at(sort: Desc)])
}
-model LiteLLM_ManagedObjectTable { // for batches or finetuning jobs which use the
+model LiteLLM_ManagedObjectTable { // for batches or finetuning jobs which use the
id String @id @default(uuid())
unified_object_id String @unique // The base64 encoded unified file ID
- model_object_id String @unique // the id returned by the backend API provider
+ model_object_id String @unique // the id returned by the backend API provider
file_object Json // Stores the OpenAIFileObject
file_purpose String // either 'batch' or 'fine-tune'
- status String? // check if batch cost has been tracked
+ status String? // check if batch cost has been tracked
batch_processed Boolean @default(false) // set to true by CheckBatchCost after cost is computed
created_at DateTime @default(now())
created_by String?
+ team_id String?
updated_at DateTime @updatedAt
- updated_by String?
+ updated_by String?
@@index([unified_object_id])
@@index([model_object_id])
+ @@index([team_id, created_at(sort: Desc)])
}
model LiteLLM_ManagedVectorStoreTable {
@@ -918,10 +922,12 @@ model LiteLLM_ManagedVectorStoreTable {
storage_url String? // Storage URL (if applicable)
created_at DateTime @default(now())
created_by String?
+ team_id String?
updated_at DateTime @updatedAt
updated_by String?
@@index([unified_resource_id])
+ @@index([team_id, created_at(sort: Desc)])
}
model LiteLLM_ManagedVectorStoresTable {
diff --git a/litellm-proxy-extras/pyproject.toml b/litellm-proxy-extras/pyproject.toml
index b8710da343..cd569ca08e 100644
--- a/litellm-proxy-extras/pyproject.toml
+++ b/litellm-proxy-extras/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "litellm-proxy-extras"
-version = "0.4.70"
+version = "0.4.71"
description = "Additional files for the LiteLLM Proxy. Reduces the size of the main litellm package."
readme = "README.md"
requires-python = ">=3.9"
@@ -16,7 +16,7 @@ Repository = "https://github.com/BerriAI/litellm"
Documentation = "https://docs.litellm.ai"
[build-system]
-requires = ["uv_build==0.10.7"]
+requires = ["uv_build==0.11.8"]
build-backend = "uv_build"
[tool.uv]
@@ -26,7 +26,7 @@ required-version = ">=0.10.9"
module-root = ""
[tool.commitizen]
-version = "0.4.70"
+version = "0.4.71"
version_files = [
"pyproject.toml:^version",
"../pyproject.toml:litellm-proxy-extras==",
diff --git a/litellm/__init__.py b/litellm/__init__.py
index 77fa48625d..5305edc9be 100644
--- a/litellm/__init__.py
+++ b/litellm/__init__.py
@@ -166,7 +166,7 @@ langfuse_default_tags: Optional[List[str]] = None
langsmith_batch_size: Optional[int] = None
prometheus_initialize_budget_metrics: Optional[bool] = False
prometheus_latency_buckets: Optional[List[float]] = None
-require_auth_for_metrics_endpoint: Optional[bool] = False
+require_auth_for_metrics_endpoint: Optional[bool] = True
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] = (
@@ -280,6 +280,7 @@ ssl_security_level: Optional[str] = None
ssl_certificate: Optional[str] = None
user_url_validation: bool = True
user_url_allowed_hosts: List[str] = []
+provider_url_destination_allowed_hosts: List[str] = []
ssl_ecdh_curve: Optional[str] = (
None # Set to 'X25519' to disable PQC and improve performance
)
@@ -288,6 +289,7 @@ disable_token_counter: bool = False
disable_add_transform_inline_image_block: bool = False
disable_add_user_agent_to_request_tags: bool = False
disable_anthropic_gemini_context_caching_transform: bool = False
+disable_vertex_batch_output_transformation: bool = False
extra_spend_tag_headers: Optional[List[str]] = None
in_memory_llm_clients_cache: "LLMClientCache"
safe_memory_mode: bool = False
@@ -330,6 +332,9 @@ enable_model_config_credential_overrides: bool = False
enable_key_alias_format_validation: bool = (
False # opt-in validation of key_alias format on /key/generate and /key/update
)
+enable_gemini_default_thinking_level_low: bool = (
+ False # opt-in: force thinkingLevel low/minimal for Gemini 3 thinking param mapping
+)
####################
logging: bool = True
enable_loadbalancing_on_batch_endpoints: Optional[bool] = None
diff --git a/litellm/_logging.py b/litellm/_logging.py
index d072cc549d..5ddafd6c6a 100644
--- a/litellm/_logging.py
+++ b/litellm/_logging.py
@@ -1,12 +1,12 @@
import ast
import logging
import os
-import re
import sys
from datetime import datetime
from logging import Formatter
-from typing import Any, Dict, List, Optional
+from typing import Any, Dict, Optional
+from litellm.litellm_core_utils.secret_redaction import redact_string
from litellm.litellm_core_utils.safe_json_dumps import safe_dumps
from litellm.litellm_core_utils.safe_json_loads import safe_json_loads
@@ -21,74 +21,11 @@ _ENABLE_SECRET_REDACTION = (
os.getenv("LITELLM_DISABLE_REDACT_SECRETS", "").lower() != "true"
)
-_REDACTED = "REDACTED"
-
-
-def _build_secret_patterns() -> re.Pattern:
- patterns: List[str] = [
- # ── PEM private key / certificate blocks ──
- r"-----BEGIN[A-Z \-]*PRIVATE KEY-----[\s\S]*?-----END[A-Z \-]*PRIVATE KEY-----",
- # ── GCP OAuth2 access tokens (ya29.*) ──
- r"\bya29\.[A-Za-z0-9_.~+/-]+",
- # ── Credential %s formatting (space separator, no key= prefix) ──
- r"(?:client_secret|azure_password|azure_username)\s+[^\s,'\"})\]{}>]+",
- # AWS access key IDs
- r"(?:AKIA|ASIA)[0-9A-Z]{16}",
- # AWS secrets / session tokens / access key IDs (key=value)
- r"(?:aws_secret_access_key|aws_session_token|aws_access_key_id)"
- r"\s*[:=]\s*[A-Za-z0-9/+=]{20,}",
- # Bearer tokens (OAuth, JWT, etc.)
- r"Bearer\s+[A-Za-z0-9\-._~+/]{10,}=*",
- # Basic auth headers
- r"Basic\s+[A-Za-z0-9+/]{10,}={0,2}",
- # OpenAI / Anthropic sk- prefixed keys
- r"sk-[A-Za-z0-9\-_]{20,}",
- # Generic api_key / api-key / apikey (handles 'key': 'value' dict repr)
- r"(?:api[_-]?key)['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]{8,}",
- # x-api-key / api-key header values (handles 'key': 'value' dict repr)
- r"(?:x-api-key|api-key)['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]+",
- # Anthropic internal header keys
- r"x-ak-[A-Za-z0-9\-_]{20,}",
- # Google API keys
- r"AIza[0-9A-Za-z\-_]{35}",
- # Password / secret params (handles key=value and 'key': 'value')
- # Word boundary prevents O(n^2) backtracking on long word-char runs.
- r"(?:^|(?<=\W))\w*(?:password|passwd|client_secret|secret_key|_secret)"
- r"['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]+",
- # Database connection string credentials (scheme://user:pass@host)
- r"(?<=://)[^\s'\"]*:[^\s'\"@]+(?=@)",
- # Databricks personal access tokens
- r"dapi[0-9a-f]{32}",
- # ── Key-name-based redaction ──
- # Catches secrets inside dicts/config dumps by matching on the KEY name
- # regardless of what the value looks like.
- # e.g. 'master_key': 'any-value-here', "database_url": "postgres://..."
- # private_key with PEM-aware value capture
- r"""private_key['\"]?\s*[:=]\s*['\"]?(?:-----BEGIN[A-Z \-]*PRIVATE KEY-----[\s\S]*?-----END[A-Z \-]*PRIVATE KEY-----|[^\s,'\"})\]{}>]+)""",
- r"(?:master_key|database_url|db_url|connection_string|"
- r"signing_key|encryption_key|"
- r"auth_token|access_token|refresh_token|"
- r"slack_webhook_url|webhook_url|"
- r"database_connection_string|"
- r"huggingface_token|jwt_secret)"
- r"""['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]+""",
- # ── Raw JWTs (without Bearer prefix) ──
- r"\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*",
- # ── Azure SAS tokens in URLs ──
- r"[?&]sig=[A-Za-z0-9%+/=]+",
- # ── Full JSON service-account blobs (single-line and multi-line) ──
- r'\{[^{}]*"type"\s*:\s*"service_account"[^{}]*(?:\{[^{}]*\}[^{}]*)*\}',
- ]
- return re.compile("|".join(patterns), re.IGNORECASE)
-
-
-_SECRET_RE = _build_secret_patterns()
-
def _redact_string(value: str) -> str:
if not _ENABLE_SECRET_REDACTION:
return value
- return _SECRET_RE.sub(_REDACTED, value)
+ return redact_string(value)
def redact_secrets(value: str) -> str:
diff --git a/litellm/anthropic_beta_headers_config.json b/litellm/anthropic_beta_headers_config.json
index 662b62cf20..d02afe3756 100644
--- a/litellm/anthropic_beta_headers_config.json
+++ b/litellm/anthropic_beta_headers_config.json
@@ -72,7 +72,7 @@
"computer-use-2025-11-24": "computer-use-2025-11-24",
"context-1m-2025-08-07": "context-1m-2025-08-07",
"context-management-2025-06-27": null,
- "effort-2025-11-24": null,
+ "effort-2025-11-24": "effort-2025-11-24",
"fast-mode-2026-02-01": null,
"files-api-2025-04-14": null,
"fine-grained-tool-streaming-2025-05-14": null,
@@ -103,7 +103,7 @@
"computer-use-2025-11-24": "computer-use-2025-11-24",
"context-1m-2025-08-07": "context-1m-2025-08-07",
"context-management-2025-06-27": null,
- "effort-2025-11-24": null,
+ "effort-2025-11-24": "effort-2025-11-24",
"fast-mode-2026-02-01": null,
"files-api-2025-04-14": null,
"fine-grained-tool-streaming-2025-05-14": null,
diff --git a/litellm/batches/batch_utils.py b/litellm/batches/batch_utils.py
index 4b965d4e63..aaf083e75d 100644
--- a/litellm/batches/batch_utils.py
+++ b/litellm/batches/batch_utils.py
@@ -387,6 +387,27 @@ def _get_batch_job_total_usage_from_file_content(
)
+def _get_models_from_batch_input_file_content(
+ file_content_dictionary: List[dict],
+) -> List[str]:
+ """Extract the distinct ``body.model`` values from a batch *input* file.
+
+ Used by the proxy's batch pre-call hook to enforce that the caller is
+ authorized for every model named inside the JSONL — not just the one
+ on the outer request — so the proxy's per-key model allowlist isn't
+ bypassed by smuggling expensive models into the batch file.
+ """
+ models: List[str] = []
+ seen: set = set()
+ for _item in file_content_dictionary:
+ body = _item.get("body") or {}
+ model = body.get("model")
+ if model and model not in seen:
+ seen.add(model)
+ models.append(model)
+ return models
+
+
def _get_batch_job_input_file_usage(
file_content_dictionary: List[dict],
custom_llm_provider: Literal["openai", "azure", "vertex_ai"] = "openai",
@@ -403,11 +424,25 @@ def _get_batch_job_input_file_usage(
for _item in file_content_dictionary:
body = _item.get("body", {})
model = body.get("model", model_name or "")
- messages = body.get("messages", [])
+ # Chat completion payloads.
+ messages = body.get("messages")
if messages:
- item_tokens = token_counter(model=model, messages=messages)
- prompt_tokens += item_tokens
+ prompt_tokens += token_counter(model=model, messages=messages)
+ continue
+
+ # Text completion payloads (`prompt`).
+ prompt = body.get("prompt")
+ if prompt:
+ prompt_tokens += _count_prompt_or_input_tokens(model=model, value=prompt)
+ continue
+
+ # Embedding payloads (`input`).
+ input_data = body.get("input")
+ if input_data:
+ prompt_tokens += _count_prompt_or_input_tokens(
+ model=model, value=input_data
+ )
return Usage(
total_tokens=prompt_tokens + completion_tokens,
@@ -416,6 +451,43 @@ def _get_batch_job_input_file_usage(
)
+def _count_prompt_or_input_tokens(model: str, value: Any) -> int:
+ """Token-count a ``prompt`` / ``input`` field that the OpenAI batch
+ schema allows in four shapes:
+
+ - ``str``: a single text prompt.
+ - ``list[str]``: multiple text prompts.
+ - ``list[int]``: a pre-tokenized prompt (each int counts as 1 token).
+ - ``list[list[int]]``: multiple pre-tokenized prompts.
+
+ Pre-fix only the string shapes were counted, so a caller could send
+ a large ``list[list[int]]`` payload and slip past TPM rate limits
+ with a recorded cost of zero tokens.
+ """
+ if isinstance(value, str):
+ return token_counter(model=model, text=value)
+ if isinstance(value, list):
+ total = 0
+ for chunk in value:
+ if isinstance(chunk, str):
+ total += token_counter(model=model, text=chunk)
+ elif isinstance(chunk, int):
+ # Single pre-tokenized prompt at the top level: each
+ # int counts as one token.
+ total += 1
+ elif isinstance(chunk, list):
+ # Nested pre-tokenized prompt: every int contributes a
+ # token. Mixed string/int items still count.
+ total += sum(1 if isinstance(t, int) else 0 for t in chunk)
+ total += sum(
+ token_counter(model=model, text=t)
+ for t in chunk
+ if isinstance(t, str)
+ )
+ return total
+ return 0
+
+
def _get_batch_job_usage_from_response_body(response_body: dict) -> Usage:
"""
Get the tokens of a batch job from the response body
diff --git a/litellm/caching/caching.py b/litellm/caching/caching.py
index ce1bc26c5e..11733ce4ce 100644
--- a/litellm/caching/caching.py
+++ b/litellm/caching/caching.py
@@ -432,9 +432,10 @@ class Cache:
str: The final hashed cache key with the redis namespace.
"""
dynamic_cache_control: DynamicCacheControl = kwargs.get("cache", {})
+ metadata = kwargs.get("metadata") or {}
namespace = (
dynamic_cache_control.get("namespace")
- or kwargs.get("metadata", {}).get("redis_namespace")
+ or metadata.get("redis_namespace")
or self.namespace
)
if namespace:
diff --git a/litellm/caching/caching_handler.py b/litellm/caching/caching_handler.py
index 7d514e648f..3cf1d911d7 100644
--- a/litellm/caching/caching_handler.py
+++ b/litellm/caching/caching_handler.py
@@ -87,6 +87,18 @@ class CachingHandlerResponse(BaseModel):
in_memory_cache_obj = InMemoryCache()
+def _should_defer_streaming_cache_hit_callbacks(*, kwargs: Dict[str, Any]) -> bool:
+ """
+ When stream=True, do not run success callbacks at cache-hit time.
+
+ Cached chat/text completion replay uses CustomStreamWrapper; cached Responses
+ replay uses CachedResponsesAPIStreamingIterator. Both invoke logging success
+ handlers when the stream finishes; firing them here too would double-count
+ spend and callback records.
+ """
+ return kwargs.get("stream", False) is True
+
+
class LLMCachingHandler:
def __init__(
self,
@@ -99,6 +111,7 @@ class LLMCachingHandler:
self.async_streaming_chunks: List[ModelResponse] = []
self.sync_streaming_chunks: List[ModelResponse] = []
self.request_kwargs = request_kwargs
+ self.preset_cache_key: Optional[str] = None
self.original_function = original_function
self.start_time = start_time
if litellm.cache is not None and isinstance(litellm.cache.cache, RedisCache):
@@ -206,7 +219,7 @@ class LLMCachingHandler:
custom_llm_provider=kwargs.get("custom_llm_provider", None),
args=args,
)
- if kwargs.get("stream", False) is False:
+ if not _should_defer_streaming_cache_hit_callbacks(kwargs=kwargs):
# LOG SUCCESS
self._async_log_cache_hit_on_callbacks(
logging_obj=logging_obj,
@@ -215,11 +228,12 @@ class LLMCachingHandler:
end_time=end_time,
cache_hit=cache_hit,
)
- cache_key = litellm.cache.get_cache_key(**kwargs)
- if (
- isinstance(cached_result, BaseModel)
- or isinstance(cached_result, CustomStreamWrapper)
- ) and hasattr(cached_result, "_hidden_params"):
+ cache_key = (
+ self.preset_cache_key
+ or self.request_kwargs.get("cache_key")
+ or litellm.cache.get_cache_key(**self.request_kwargs)
+ )
+ if hasattr(cached_result, "_hidden_params"):
cached_result._hidden_params["cache_key"] = cache_key # type: ignore
return CachingHandlerResponse(cached_result=cached_result)
elif (
@@ -265,8 +279,6 @@ class LLMCachingHandler:
kwargs: Dict[str, Any],
args: Optional[Tuple[Any, ...]] = None,
) -> CachingHandlerResponse:
- from litellm.utils import CustomStreamWrapper
-
cached_result: Optional[Any] = None
# Check if caching should be performed BEFORE doing expensive kwargs copy
@@ -282,6 +294,11 @@ class LLMCachingHandler:
args,
)
)
+ if new_kwargs.get("metadata") is None:
+ new_kwargs.pop("metadata", None)
+ if new_kwargs.get("stream") is True and "cache_key" not in new_kwargs:
+ new_kwargs["cache_key"] = litellm.cache.get_cache_key(**new_kwargs)
+ self.request_kwargs = new_kwargs
print_verbose("Checking Sync Cache")
cached_result = litellm.cache.get_cache(**new_kwargs)
if cached_result is not None:
@@ -322,17 +339,19 @@ class LLMCachingHandler:
is_async=False,
)
- logging_obj.handle_sync_success_callbacks_for_async_calls(
- result=cached_result,
- start_time=start_time,
- end_time=end_time,
- cache_hit=cache_hit,
+ if not _should_defer_streaming_cache_hit_callbacks(kwargs=kwargs):
+ logging_obj.handle_sync_success_callbacks_for_async_calls(
+ result=cached_result,
+ start_time=start_time,
+ end_time=end_time,
+ cache_hit=cache_hit,
+ )
+ cache_key = (
+ self.preset_cache_key
+ or self.request_kwargs.get("cache_key")
+ or litellm.cache.get_cache_key(**self.request_kwargs)
)
- cache_key = litellm.cache.get_cache_key(**kwargs)
- if (
- isinstance(cached_result, BaseModel)
- or isinstance(cached_result, CustomStreamWrapper)
- ) and hasattr(cached_result, "_hidden_params"):
+ if hasattr(cached_result, "_hidden_params"):
cached_result._hidden_params["cache_key"] = cache_key # type: ignore
return CachingHandlerResponse(cached_result=cached_result)
return CachingHandlerResponse(cached_result=cached_result)
@@ -686,6 +705,11 @@ class LLMCachingHandler:
args,
)
)
+ if new_kwargs.get("metadata") is None:
+ new_kwargs.pop("metadata", None)
+ if new_kwargs.get("stream") is True and "cache_key" not in new_kwargs:
+ new_kwargs["cache_key"] = litellm.cache.get_cache_key(**new_kwargs)
+ self.request_kwargs = new_kwargs
cached_result: Optional[Any] = None
if call_type == CallTypes.aembedding.value:
if isinstance(new_kwargs["input"], str):
@@ -710,14 +734,26 @@ class LLMCachingHandler:
if all(result is None for result in cached_result):
cached_result = None
else:
+ request_kwargs = new_kwargs.copy()
+ request_cache_key = request_kwargs.pop("cache_key", None)
if litellm.cache._supports_async() is True:
## check if dual cache is supported ##
+ self.preset_cache_key = (
+ request_cache_key or litellm.cache.get_cache_key(**request_kwargs)
+ )
cached_result = await litellm.cache.async_get_cache(
- dynamic_cache_object=self.dual_cache, **new_kwargs
+ dynamic_cache_object=self.dual_cache,
+ cache_key=self.preset_cache_key,
+ **request_kwargs,
)
else: # fallback for caches that don't support async
+ self.preset_cache_key = (
+ request_cache_key or litellm.cache.get_cache_key(**request_kwargs)
+ )
cached_result = litellm.cache.get_cache(
- dynamic_cache_object=self.dual_cache, **new_kwargs
+ dynamic_cache_object=self.dual_cache,
+ cache_key=self.preset_cache_key,
+ **request_kwargs,
)
return cached_result
@@ -825,8 +861,27 @@ class LLMCachingHandler:
elif (call_type == "aresponses" or call_type == "responses") and isinstance(
cached_result, dict
):
- # Convert cached dict back to ResponsesAPIResponse object
- cached_result = ResponsesAPIResponse(**cached_result)
+ from litellm.responses.streaming_iterator import (
+ CachedResponsesAPIStreamingIterator,
+ )
+
+ response_obj = ResponsesAPIResponse(**cached_result)
+ if (
+ hasattr(response_obj, "_hidden_params")
+ and response_obj._hidden_params is not None
+ and isinstance(response_obj._hidden_params, dict)
+ ):
+ response_obj._hidden_params["cache_hit"] = True
+
+ if kwargs.get("stream", False) is True:
+ cached_result = CachedResponsesAPIStreamingIterator(
+ response=response_obj,
+ logging_obj=logging_obj,
+ request_data=kwargs,
+ call_type=call_type,
+ )
+ else:
+ cached_result = response_obj
if (
hasattr(cached_result, "_hidden_params")
diff --git a/litellm/caching/dual_cache.py b/litellm/caching/dual_cache.py
index 6115a444ce..8060a65b78 100644
--- a/litellm/caching/dual_cache.py
+++ b/litellm/caching/dual_cache.py
@@ -92,6 +92,25 @@ class DualCache(BaseCache):
if default_redis_ttl is not None:
self.default_redis_ttl = default_redis_ttl
+ def attach_redis_cache(
+ self,
+ redis_cache: Optional[RedisCache] = None,
+ *,
+ default_redis_ttl: Optional[float] = None,
+ ) -> None:
+ """
+ Attach a Redis backend if this DualCache does not already have one.
+
+ No-op when ``redis_cache`` is None or when Redis was already set (constructor
+ or a prior attach). Use this for lazy wiring after a shared Redis client exists.
+ Does not backfill in-memory-only keys to Redis.
+ """
+ if redis_cache is None or self.redis_cache is not None:
+ return
+ self.redis_cache = redis_cache
+ if default_redis_ttl is not None:
+ self.default_redis_ttl = default_redis_ttl
+
def set_cache(self, key, value, local_only: bool = False, **kwargs):
# Update both Redis and in-memory cache
try:
diff --git a/litellm/caching/qdrant_semantic_cache.py b/litellm/caching/qdrant_semantic_cache.py
index 5e3713e5a1..cb521efca0 100644
--- a/litellm/caching/qdrant_semantic_cache.py
+++ b/litellm/caching/qdrant_semantic_cache.py
@@ -11,17 +11,23 @@ Has 4 methods:
import ast
import asyncio
import json
-from typing import Any, cast
+import os
+from typing import Any, Dict, cast
import litellm
from litellm._logging import print_verbose
from litellm.constants import QDRANT_SCALAR_QUANTILE, QDRANT_VECTOR_SIZE
+from litellm.litellm_core_utils.prompt_templates.common_utils import (
+ get_str_from_messages,
+)
from litellm.types.utils import EmbeddingResponse
from .base_cache import BaseCache
class QdrantSemanticCache(BaseCache):
+ CACHE_KEY_FIELD_NAME = "litellm_cache_key"
+
def __init__( # noqa: PLR0915
self,
qdrant_api_base=None,
@@ -33,8 +39,6 @@ class QdrantSemanticCache(BaseCache):
host_type=None,
vector_size=None,
):
- import os
-
from litellm.llms.custom_httpx.http_handler import (
_get_httpx_client,
get_async_httpx_client,
@@ -115,7 +119,9 @@ class QdrantSemanticCache(BaseCache):
print_verbose(
f"Collection already exists.\nCollection details:{self.collection_info}"
)
+ self._ensure_cache_key_payload_index()
else:
+ quantization_params: Dict[str, Any]
if quantization_config is None or quantization_config == "binary":
quantization_params = {
"binary": {
@@ -156,6 +162,7 @@ class QdrantSemanticCache(BaseCache):
print_verbose(
f"New collection created.\nCollection details:{self.collection_info}"
)
+ self._ensure_cache_key_payload_index()
else:
raise Exception("Error while creating new collection")
@@ -170,15 +177,94 @@ class QdrantSemanticCache(BaseCache):
cached_response = ast.literal_eval(cached_response)
return cached_response
+ def _get_qdrant_cache_key_filter(self, key: str) -> dict:
+ return {
+ "must": [
+ {
+ "key": self.CACHE_KEY_FIELD_NAME,
+ "match": {"value": str(key)},
+ }
+ ]
+ }
+
+ def _add_cache_key_filter_to_search_data(self, data: dict, key: str) -> None:
+ data["filter"] = self._get_qdrant_cache_key_filter(key)
+
+ def _ensure_cache_key_payload_index(self) -> None:
+ try:
+ response = self.sync_client.put(
+ url=f"{self.qdrant_api_base}/collections/{self.collection_name}/index",
+ headers=self.headers,
+ json={
+ "field_name": self.CACHE_KEY_FIELD_NAME,
+ "field_schema": "keyword",
+ },
+ )
+ if response.status_code not in (200, 201):
+ print_verbose(
+ "Qdrant semantic-cache could not create cache-key payload index: "
+ f"{response.text}"
+ )
+ except Exception as exc:
+ print_verbose(
+ "Qdrant semantic-cache could not create cache-key payload index: "
+ f"{str(exc)}"
+ )
+
+ def _payload_matches_cache_key(self, payload: dict, key: str) -> bool:
+ # Pre-isolation points stored only prompt + response with no cache-key
+ # payload field. Reassigning them to a caller's key would risk
+ # cross-scope hits, so they're treated as misses and re-populated on
+ # the next set_cache.
+ cached_key = payload.get(self.CACHE_KEY_FIELD_NAME)
+ return cached_key is not None and str(cached_key) == str(key)
+
+ async def _get_async_embedding(self, prompt: str, **kwargs) -> Any:
+ llm_model_list = None
+ llm_router = None
+
+ try:
+ from litellm.proxy.proxy_server import (
+ llm_model_list as proxy_llm_model_list,
+ llm_router as proxy_llm_router,
+ )
+
+ llm_model_list = proxy_llm_model_list
+ llm_router = proxy_llm_router
+ except ImportError:
+ pass
+
+ router_model_names = (
+ [m["model_name"] for m in llm_model_list]
+ if llm_model_list is not None
+ else []
+ )
+ if llm_router is not None and self.embedding_model in router_model_names:
+ user_api_key = kwargs.get("metadata", {}).get("user_api_key", "")
+ return await llm_router.aembedding(
+ model=self.embedding_model,
+ input=prompt,
+ cache={"no-store": True, "no-cache": True},
+ metadata={
+ "user_api_key": user_api_key,
+ "semantic-cache-embedding": True,
+ "trace_id": kwargs.get("metadata", {}).get("trace_id", None),
+ },
+ )
+
+ return await litellm.aembedding(
+ model=self.embedding_model,
+ input=prompt,
+ cache={"no-store": True, "no-cache": True},
+ )
+
def set_cache(self, key, value, **kwargs):
print_verbose(f"qdrant semantic-cache set_cache, kwargs: {kwargs}")
from litellm._uuid import uuid
# get the prompt
messages = kwargs["messages"]
- prompt = ""
- for message in messages:
- prompt += message["content"]
+ prompt = get_str_from_messages(messages)
# create an embedding for prompt
embedding_response = cast(
@@ -202,6 +288,7 @@ class QdrantSemanticCache(BaseCache):
"id": str(uuid.uuid4()),
"vector": embedding,
"payload": {
+ self.CACHE_KEY_FIELD_NAME: str(key),
"text": prompt,
"response": value,
},
@@ -220,9 +307,7 @@ class QdrantSemanticCache(BaseCache):
# get the messages
messages = kwargs["messages"]
- prompt = ""
- for message in messages:
- prompt += message["content"]
+ prompt = get_str_from_messages(messages)
# convert to embedding
embedding_response = cast(
@@ -249,6 +334,7 @@ class QdrantSemanticCache(BaseCache):
"limit": 1,
"with_payload": True,
}
+ self._add_cache_key_filter_to_search_data(data=data, key=key)
search_response = self.sync_client.post(
url=f"{self.qdrant_api_base}/collections/{self.collection_name}/points/search",
@@ -258,21 +344,33 @@ class QdrantSemanticCache(BaseCache):
results = search_response.json()["result"]
if results is None:
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
return None
if isinstance(results, list):
if len(results) == 0:
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
return None
similarity = results[0]["score"]
- cached_prompt = results[0]["payload"]["text"]
+ payload = results[0]["payload"]
+ if not self._payload_matches_cache_key(payload=payload, key=key):
+ print_verbose("Qdrant semantic-cache hit did not match cache key scope")
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
+ return None
+
+ cached_prompt = payload["text"]
# check similarity, if more than self.similarity_threshold, return results
print_verbose(
f"semantic cache: similarity threshold: {self.similarity_threshold}, similarity: {similarity}, prompt: {prompt}, closest_cached_prompt: {cached_prompt}"
)
+
+ # update kwargs["metadata"] with similarity, don't rewrite the original metadata
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = similarity
+
if similarity >= self.similarity_threshold:
# cache hit !
- cached_value = results[0]["payload"]["response"]
+ cached_value = payload["response"]
print_verbose(
f"got a cache hit, similarity: {similarity}, Current prompt: {prompt}, cached_prompt: {cached_prompt}"
)
@@ -285,40 +383,12 @@ class QdrantSemanticCache(BaseCache):
async def async_set_cache(self, key, value, **kwargs):
from litellm._uuid import uuid
- from litellm.proxy.proxy_server import llm_model_list, llm_router
-
print_verbose(f"async qdrant semantic-cache set_cache, kwargs: {kwargs}")
# get the prompt
messages = kwargs["messages"]
- prompt = ""
- for message in messages:
- prompt += message["content"]
- # create an embedding for prompt
- router_model_names = (
- [m["model_name"] for m in llm_model_list]
- if llm_model_list is not None
- else []
- )
- if llm_router is not None and self.embedding_model in router_model_names:
- user_api_key = kwargs.get("metadata", {}).get("user_api_key", "")
- embedding_response = await llm_router.aembedding(
- model=self.embedding_model,
- input=prompt,
- cache={"no-store": True, "no-cache": True},
- metadata={
- "user_api_key": user_api_key,
- "semantic-cache-embedding": True,
- "trace_id": kwargs.get("metadata", {}).get("trace_id", None),
- },
- )
- else:
- # convert to embedding
- embedding_response = await litellm.aembedding(
- model=self.embedding_model,
- input=prompt,
- cache={"no-store": True, "no-cache": True},
- )
+ prompt = get_str_from_messages(messages)
+ embedding_response = await self._get_async_embedding(prompt, **kwargs)
# get the embedding
embedding = embedding_response["data"][0]["embedding"]
@@ -332,6 +402,7 @@ class QdrantSemanticCache(BaseCache):
"id": str(uuid.uuid4()),
"vector": embedding,
"payload": {
+ self.CACHE_KEY_FIELD_NAME: str(key),
"text": prompt,
"response": value,
},
@@ -348,38 +419,12 @@ class QdrantSemanticCache(BaseCache):
async def async_get_cache(self, key, **kwargs):
print_verbose(f"async qdrant semantic-cache get_cache, kwargs: {kwargs}")
- from litellm.proxy.proxy_server import llm_model_list, llm_router
# get the messages
messages = kwargs["messages"]
- prompt = ""
- for message in messages:
- prompt += message["content"]
+ prompt = get_str_from_messages(messages)
- router_model_names = (
- [m["model_name"] for m in llm_model_list]
- if llm_model_list is not None
- else []
- )
- if llm_router is not None and self.embedding_model in router_model_names:
- user_api_key = kwargs.get("metadata", {}).get("user_api_key", "")
- embedding_response = await llm_router.aembedding(
- model=self.embedding_model,
- input=prompt,
- cache={"no-store": True, "no-cache": True},
- metadata={
- "user_api_key": user_api_key,
- "semantic-cache-embedding": True,
- "trace_id": kwargs.get("metadata", {}).get("trace_id", None),
- },
- )
- else:
- # convert to embedding
- embedding_response = await litellm.aembedding(
- model=self.embedding_model,
- input=prompt,
- cache={"no-store": True, "no-cache": True},
- )
+ embedding_response = await self._get_async_embedding(prompt, **kwargs)
# get the embedding
embedding = embedding_response["data"][0]["embedding"]
@@ -396,6 +441,7 @@ class QdrantSemanticCache(BaseCache):
"limit": 1,
"with_payload": True,
}
+ self._add_cache_key_filter_to_search_data(data=data, key=key)
search_response = await self.async_client.post(
url=f"{self.qdrant_api_base}/collections/{self.collection_name}/points/search",
@@ -414,7 +460,13 @@ class QdrantSemanticCache(BaseCache):
return None
similarity = results[0]["score"]
- cached_prompt = results[0]["payload"]["text"]
+ payload = results[0]["payload"]
+ if not self._payload_matches_cache_key(payload=payload, key=key):
+ print_verbose("Qdrant semantic-cache hit did not match cache key scope")
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
+ return None
+
+ cached_prompt = payload["text"]
# check similarity, if more than self.similarity_threshold, return results
print_verbose(
@@ -426,7 +478,7 @@ class QdrantSemanticCache(BaseCache):
if similarity >= self.similarity_threshold:
# cache hit !
- cached_value = results[0]["payload"]["response"]
+ cached_value = payload["response"]
print_verbose(
f"got a cache hit, similarity: {similarity}, Current prompt: {prompt}, cached_prompt: {cached_prompt}"
)
diff --git a/litellm/caching/redis_cache.py b/litellm/caching/redis_cache.py
index deee4f6ea4..cb9ce475d3 100644
--- a/litellm/caching/redis_cache.py
+++ b/litellm/caching/redis_cache.py
@@ -551,6 +551,13 @@ class RedisCache(BaseCache):
async def async_set_cache(self, key, value, **kwargs):
from redis.asyncio import Redis
+ if key is None:
+ verbose_logger.debug(
+ "LiteLLM Redis Caching: async set() skipped — key is None, value=%r",
+ value,
+ )
+ return None
+
start_time = time.time()
try:
_redis_client: Redis = self.init_async_client() # type: ignore
@@ -569,8 +576,9 @@ class RedisCache(BaseCache):
)
)
verbose_logger.error(
- "LiteLLM Redis Caching: async set() - Got exception from REDIS %s, Writing value=%s",
+ "LiteLLM Redis Caching: async set() - Got exception from REDIS %s, key=%r, value=%r",
str(e),
+ key,
value,
)
raise e
diff --git a/litellm/caching/redis_semantic_cache.py b/litellm/caching/redis_semantic_cache.py
index c76f27377d..da9e7b1e58 100644
--- a/litellm/caching/redis_semantic_cache.py
+++ b/litellm/caching/redis_semantic_cache.py
@@ -35,6 +35,7 @@ class RedisSemanticCache(BaseCache):
"""
DEFAULT_REDIS_INDEX_NAME: str = "litellm_semantic_cache_index"
+ CACHE_KEY_FIELD_NAME: str = "litellm_cache_key"
def __init__(
self,
@@ -66,8 +67,8 @@ class RedisSemanticCache(BaseCache):
Exception: If similarity_threshold is not provided or required Redis
connection information is missing
"""
- from redisvl.extensions.llmcache import SemanticCache
- from redisvl.utils.vectorize import CustomTextVectorizer
+ from redisvl.extensions.llmcache import SemanticCache # type: ignore[import-not-found, import-untyped]
+ from redisvl.utils.vectorize import CustomTextVectorizer # type: ignore[import-not-found, import-untyped]
if index_name is None:
index_name = self.DEFAULT_REDIS_INDEX_NAME
@@ -109,14 +110,94 @@ class RedisSemanticCache(BaseCache):
# Initialize the Redis vectorizer and cache
cache_vectorizer = CustomTextVectorizer(self._get_embedding)
- self.llmcache = SemanticCache(
- name=index_name,
+ self.llmcache = self._init_semantic_cache(
+ semantic_cache_cls=SemanticCache,
+ index_name=index_name,
redis_url=redis_url,
- vectorizer=cache_vectorizer,
- distance_threshold=self.distance_threshold,
- overwrite=False,
+ cache_vectorizer=cache_vectorizer,
)
+ @classmethod
+ def _cache_key_filterable_field(cls) -> Dict[str, str]:
+ return {
+ "name": cls.CACHE_KEY_FIELD_NAME,
+ "type": "tag",
+ }
+
+ def _init_semantic_cache(
+ self,
+ semantic_cache_cls: Any,
+ index_name: str,
+ redis_url: str,
+ cache_vectorizer: Any,
+ ) -> Any:
+ def _is_schema_mismatch(exc: ValueError) -> bool:
+ error_message = str(exc).lower()
+ return any(
+ phrase in error_message
+ for phrase in ("schema does not match", "index schema")
+ )
+
+ try:
+ return semantic_cache_cls(
+ name=index_name,
+ redis_url=redis_url,
+ vectorizer=cache_vectorizer,
+ distance_threshold=self.distance_threshold,
+ filterable_fields=[self._cache_key_filterable_field()],
+ overwrite=False,
+ )
+ except ValueError as exc:
+ if not _is_schema_mismatch(exc):
+ raise
+
+ isolated_index_name = f"{index_name}_isolated"
+ print_verbose(
+ "Redis semantic-cache existing index schema is not isolated; "
+ f"using isolated index - {isolated_index_name}"
+ )
+ try:
+ return semantic_cache_cls(
+ name=isolated_index_name,
+ redis_url=redis_url,
+ vectorizer=cache_vectorizer,
+ distance_threshold=self.distance_threshold,
+ filterable_fields=[self._cache_key_filterable_field()],
+ overwrite=False,
+ )
+ except ValueError as isolated_exc:
+ if not _is_schema_mismatch(isolated_exc):
+ raise
+
+ print_verbose(
+ "Redis semantic-cache isolated index schema is stale; "
+ f"recreating isolated index - {isolated_index_name}"
+ )
+ return semantic_cache_cls(
+ name=isolated_index_name,
+ redis_url=redis_url,
+ vectorizer=cache_vectorizer,
+ distance_threshold=self.distance_threshold,
+ filterable_fields=[self._cache_key_filterable_field()],
+ overwrite=True,
+ )
+
+ def _get_cache_filters(self, key: str) -> Dict[str, str]:
+ return {self.CACHE_KEY_FIELD_NAME: str(key)}
+
+ def _get_cache_key_filter_expression(self, key: str) -> Any:
+ from redisvl.query.filter import Tag # type: ignore[import-not-found, import-untyped]
+
+ return Tag(self.CACHE_KEY_FIELD_NAME) == str(key)
+
+ def _cache_hit_matches_key(self, cache_hit: Dict[str, Any], key: str) -> bool:
+ # Pre-isolation entries with no ``litellm_cache_key`` field cannot be
+ # safely reassigned to a caller's scope and are treated as misses.
+ cached_key = cache_hit.get(self.CACHE_KEY_FIELD_NAME)
+ if isinstance(cached_key, bytes):
+ cached_key = cached_key.decode("utf-8")
+ return cached_key is not None and str(cached_key) == str(key)
+
def _get_ttl(self, **kwargs) -> Optional[int]:
"""
Get the TTL (time-to-live) value for cache entries.
@@ -188,7 +269,7 @@ class RedisSemanticCache(BaseCache):
Store a value in the semantic cache.
Args:
- key: The cache key (not directly used in semantic caching)
+ key: The cache key used to isolate semantic cache entries
value: The response value to cache
**kwargs: Additional arguments including 'messages' for the prompt
and optional 'ttl' for time-to-live
@@ -206,12 +287,15 @@ class RedisSemanticCache(BaseCache):
prompt = get_str_from_messages(messages)
value_str = str(value)
+ store_kwargs: Dict[str, Any] = {
+ "filters": self._get_cache_filters(key),
+ }
+
# Get TTL and store in Redis semantic cache
ttl = self._get_ttl(**kwargs)
if ttl is not None:
- self.llmcache.store(prompt, value_str, ttl=int(ttl))
- else:
- self.llmcache.store(prompt, value_str)
+ store_kwargs["ttl"] = int(ttl)
+ self.llmcache.store(prompt, value_str, **store_kwargs)
except Exception as e:
print_verbose(
f"Error setting {value_str or value} in the Redis semantic cache: {str(e)}"
@@ -222,7 +306,7 @@ class RedisSemanticCache(BaseCache):
Retrieve a semantically similar cached response.
Args:
- key: The cache key (not directly used in semantic caching)
+ key: The cache key used to isolate semantic cache entries
**kwargs: Additional arguments including 'messages' for the prompt
Returns:
@@ -235,18 +319,29 @@ class RedisSemanticCache(BaseCache):
messages = kwargs.get("messages", [])
if not messages:
print_verbose("No messages provided for semantic cache lookup")
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
return None
prompt = get_str_from_messages(messages)
- # Check the cache for semantically similar prompts
- results = self.llmcache.check(prompt=prompt)
+ # Check the cache for semantically similar prompts in this exact
+ # LiteLLM cache-key scope.
+ check_kwargs: Dict[str, Any] = {
+ "prompt": prompt,
+ "filter_expression": self._get_cache_key_filter_expression(key),
+ }
+ results = self.llmcache.check(**check_kwargs)
# Return None if no similar prompts found
if not results:
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
return None
# Process the best matching result
cache_hit = results[0]
+ if not self._cache_hit_matches_key(cache_hit=cache_hit, key=key):
+ print_verbose("Redis semantic-cache hit did not match cache key scope")
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
+ return None
vector_distance = float(cache_hit["vector_distance"])
# Convert vector distance back to similarity score
@@ -257,6 +352,9 @@ class RedisSemanticCache(BaseCache):
cached_prompt = cache_hit["prompt"]
cached_response = cache_hit["response"]
+ # update kwargs["metadata"] with similarity, don't rewrite the original metadata
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = similarity
+
print_verbose(
f"Cache hit: similarity threshold: {self.similarity_threshold}, "
f"actual similarity: {similarity}, "
@@ -267,6 +365,7 @@ class RedisSemanticCache(BaseCache):
return self._get_cache_logic(cached_response=cached_response)
except Exception as e:
print_verbose(f"Error retrieving from Redis semantic cache: {str(e)}")
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
async def _get_async_embedding(self, prompt: str, **kwargs) -> List[float]:
"""
@@ -321,7 +420,7 @@ class RedisSemanticCache(BaseCache):
Asynchronously store a value in the semantic cache.
Args:
- key: The cache key (not directly used in semantic caching)
+ key: The cache key used to isolate semantic cache entries
value: The response value to cache
**kwargs: Additional arguments including 'messages' for the prompt
and optional 'ttl' for time-to-live
@@ -341,21 +440,20 @@ class RedisSemanticCache(BaseCache):
# Generate embedding for the value (response) to cache
prompt_embedding = await self._get_async_embedding(prompt, **kwargs)
+ store_kwargs: Dict[str, Any] = {
+ "vector": prompt_embedding,
+ "filters": self._get_cache_filters(key),
+ }
+
# Get TTL and store in Redis semantic cache
ttl = self._get_ttl(**kwargs)
if ttl is not None:
- await self.llmcache.astore(
- prompt,
- value_str,
- vector=prompt_embedding, # Pass through custom embedding
- ttl=ttl,
- )
- else:
- await self.llmcache.astore(
- prompt,
- value_str,
- vector=prompt_embedding, # Pass through custom embedding
- )
+ store_kwargs["ttl"] = ttl
+ await self.llmcache.astore(
+ prompt,
+ value_str,
+ **store_kwargs,
+ )
except Exception as e:
print_verbose(f"Error in async_set_cache: {str(e)}")
@@ -364,7 +462,7 @@ class RedisSemanticCache(BaseCache):
Asynchronously retrieve a semantically similar cached response.
Args:
- key: The cache key (not directly used in semantic caching)
+ key: The cache key used to isolate semantic cache entries
**kwargs: Additional arguments including 'messages' for the prompt
Returns:
@@ -385,17 +483,25 @@ class RedisSemanticCache(BaseCache):
# Generate embedding for the prompt
prompt_embedding = await self._get_async_embedding(prompt, **kwargs)
- # Check the cache for semantically similar prompts
- results = await self.llmcache.acheck(prompt=prompt, vector=prompt_embedding)
+ # Check the cache for semantically similar prompts in this exact
+ # LiteLLM cache-key scope.
+ check_kwargs: Dict[str, Any] = {
+ "prompt": prompt,
+ "vector": prompt_embedding,
+ "filter_expression": self._get_cache_key_filter_expression(key),
+ }
+ results = await self.llmcache.acheck(**check_kwargs)
# handle results / cache hit
if not results:
- kwargs.setdefault("metadata", {})[
- "semantic-similarity"
- ] = 0.0 # TODO why here but not above??
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
return None
cache_hit = results[0]
+ if not self._cache_hit_matches_key(cache_hit=cache_hit, key=key):
+ print_verbose("Redis semantic-cache hit did not match cache key scope")
+ kwargs.setdefault("metadata", {})["semantic-similarity"] = 0.0
+ return None
vector_distance = float(cache_hit["vector_distance"])
# Convert vector distance back to similarity
diff --git a/litellm/constants.py b/litellm/constants.py
index 6c889a317b..6918e40cad 100644
--- a/litellm/constants.py
+++ b/litellm/constants.py
@@ -202,6 +202,12 @@ DEFAULT_REASONING_EFFORT_MEDIUM_THINKING_BUDGET = int(
DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET = int(
os.getenv("DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET", 4096)
)
+DEFAULT_REASONING_EFFORT_XHIGH_THINKING_BUDGET = int(
+ os.getenv("DEFAULT_REASONING_EFFORT_XHIGH_THINKING_BUDGET", 8192)
+)
+DEFAULT_REASONING_EFFORT_MAX_THINKING_BUDGET = int(
+ os.getenv("DEFAULT_REASONING_EFFORT_MAX_THINKING_BUDGET", 16384)
+)
MAX_TOKEN_TRIMMING_ATTEMPTS = int(
os.getenv("MAX_TOKEN_TRIMMING_ATTEMPTS", 10)
) # Maximum number of attempts to trim the message
@@ -399,6 +405,8 @@ BEDROCK_MAX_POLICY_SIZE = int(os.getenv("BEDROCK_MAX_POLICY_SIZE", 75))
BEDROCK_MIN_THINKING_BUDGET_TOKENS = int(
os.getenv("BEDROCK_MIN_THINKING_BUDGET_TOKENS", 1024)
)
+# Anthropic's Messages API rejects thinking.budget_tokens < 1024.
+ANTHROPIC_MIN_THINKING_BUDGET_TOKENS = 1024
REPLICATE_POLLING_DELAY_SECONDS = float(
os.getenv("REPLICATE_POLLING_DELAY_SECONDS", 0.5)
)
@@ -419,9 +427,6 @@ CACHED_STREAMING_CHUNK_DELAY = float(os.getenv("CACHED_STREAMING_CHUNK_DELAY", 0
AUDIO_SPEECH_CHUNK_SIZE = int(
os.getenv("AUDIO_SPEECH_CHUNK_SIZE", 8192)
) # chunk_size for audio speech streaming. Balance between latency and memory usage
-MAX_SIZE_PER_ITEM_IN_MEMORY_CACHE_IN_KB = int(
- os.getenv("MAX_SIZE_PER_ITEM_IN_MEMORY_CACHE_IN_KB", 512)
-)
DEFAULT_MAX_TOKENS_FOR_TRITON = int(os.getenv("DEFAULT_MAX_TOKENS_FOR_TRITON", 2000))
#### Networking settings ####
# Sentinel used when `REQUEST_TIMEOUT` is unset: `litellm.request_timeout` keeps this
diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py
index 8a68d74be5..9b4dd80265 100644
--- a/litellm/cost_calculator.py
+++ b/litellm/cost_calculator.py
@@ -513,7 +513,10 @@ def cost_per_token( # noqa: PLR0915
return fireworks_ai_cost_per_token(model=model, usage=usage_block)
elif custom_llm_provider == "azure":
return azure_openai_cost_per_token(
- model=model, usage=usage_block, response_time_ms=response_time_ms
+ model=model,
+ usage=usage_block,
+ response_time_ms=response_time_ms,
+ service_tier=service_tier,
)
elif custom_llm_provider == "gemini":
return gemini_cost_per_token(
@@ -539,6 +542,7 @@ def cost_per_token( # noqa: PLR0915
usage=usage_block,
response_time_ms=response_time_ms,
request_model=request_model,
+ service_tier=service_tier,
)
else:
model_info = _cached_get_model_info_helper(
diff --git a/litellm/files/main.py b/litellm/files/main.py
index ceccba8d80..669d50dde4 100644
--- a/litellm/files/main.py
+++ b/litellm/files/main.py
@@ -10,6 +10,7 @@ import contextvars
import time
import uuid as uuid_module
from functools import partial
+from types import MappingProxyType
from typing import Any, Coroutine, Dict, Literal, Optional, Union, cast
import httpx
@@ -85,6 +86,16 @@ bedrock_files_instance = BedrockFilesHandler()
#################################################
+def _add_trusted_model_credentials_to_litellm_params(
+ litellm_params_dict: Dict[str, Any], kwargs: Dict[str, Any]
+) -> None:
+ trusted_model_credentials = kwargs.get("_litellm_internal_model_credentials")
+ if isinstance(trusted_model_credentials, type(MappingProxyType({}))):
+ litellm_params_dict["_litellm_internal_model_credentials"] = (
+ trusted_model_credentials
+ )
+
+
@client
async def acreate_file(
file: FileTypes,
@@ -373,6 +384,10 @@ def file_retrieve(
)
if provider_config is not None:
litellm_params_dict = get_litellm_params(**kwargs)
+ _add_trusted_model_credentials_to_litellm_params(
+ litellm_params_dict=litellm_params_dict,
+ kwargs=kwargs,
+ )
litellm_params_dict["api_key"] = optional_params.api_key
litellm_params_dict["api_base"] = optional_params.api_base
@@ -497,6 +512,10 @@ def file_delete(
pass
optional_params = GenericLiteLLMParams(**kwargs)
litellm_params_dict = get_litellm_params(**kwargs)
+ _add_trusted_model_credentials_to_litellm_params(
+ litellm_params_dict=litellm_params_dict,
+ kwargs=kwargs,
+ )
### TIMEOUT LOGIC ###
timeout = optional_params.timeout or kwargs.get("request_timeout", 600) or 600
# set timeout for 10 minutes by default
@@ -846,6 +865,10 @@ def file_content(
try:
optional_params = GenericLiteLLMParams(**kwargs)
litellm_params_dict = get_litellm_params(**kwargs)
+ _add_trusted_model_credentials_to_litellm_params(
+ litellm_params_dict=litellm_params_dict,
+ kwargs=kwargs,
+ )
### TIMEOUT LOGIC ###
timeout = optional_params.timeout or kwargs.get("request_timeout", 600) or 600
client = kwargs.get("client")
@@ -993,6 +1016,7 @@ def file_content(
vertex_location=vertex_ai_location,
timeout=timeout,
max_retries=optional_params.max_retries,
+ litellm_params=litellm_params_dict,
)
elif custom_llm_provider == "bedrock":
response = bedrock_files_instance.file_content(
diff --git a/litellm/integrations/arize/_utils.py b/litellm/integrations/arize/_utils.py
index 8dfaa8b142..a1bf65141c 100644
--- a/litellm/integrations/arize/_utils.py
+++ b/litellm/integrations/arize/_utils.py
@@ -220,23 +220,57 @@ def _set_structured_outputs(span: "Span", response_obj, msg_attrs, span_attrs):
safe_set_attribute(span, f"{prefix}.{msg_attrs.MESSAGE_ROLE}", message_role)
+def _safe_get(obj, key, default=None):
+ """Read ``key`` from a dict-like or Pydantic-model-like object.
+
+ The arize/langfuse_otel logger receives ``usage`` objects from many sources:
+ plain dicts, litellm ``Usage`` (which exposes ``.get``), and raw OpenAI
+ Pydantic models (e.g. ``openai.types.completion_usage.CompletionUsage`` and
+ nested ``CompletionTokensDetails`` / ``OutputTokensDetails``) which do NOT
+ expose ``.get``. Calling ``.get`` on the latter raised ``AttributeError`` —
+ see https://github.com/BerriAI/litellm/issues/13672.
+ """
+ if obj is None:
+ return default
+ getter = getattr(obj, "get", None)
+ if callable(getter):
+ try:
+ return getter(key, default)
+ except TypeError:
+ # Some objects expose `.get` with a different signature
+ pass
+ return getattr(obj, key, default)
+
+
def _set_usage_outputs(span: "Span", response_obj, span_attrs):
usage = response_obj and response_obj.get("usage")
if not usage:
return
safe_set_attribute(
- span, span_attrs.LLM_TOKEN_COUNT_TOTAL, usage.get("total_tokens")
+ span, span_attrs.LLM_TOKEN_COUNT_TOTAL, _safe_get(usage, "total_tokens")
+ )
+ completion_tokens = _safe_get(usage, "completion_tokens") or _safe_get(
+ usage, "output_tokens"
)
- completion_tokens = usage.get("completion_tokens") or usage.get("output_tokens")
if completion_tokens:
safe_set_attribute(
span, span_attrs.LLM_TOKEN_COUNT_COMPLETION, completion_tokens
)
- prompt_tokens = usage.get("prompt_tokens") or usage.get("input_tokens")
+ prompt_tokens = _safe_get(usage, "prompt_tokens") or _safe_get(
+ usage, "input_tokens"
+ )
if prompt_tokens:
safe_set_attribute(span, span_attrs.LLM_TOKEN_COUNT_PROMPT, prompt_tokens)
- reasoning_tokens = usage.get("output_tokens_details", {}).get("reasoning_tokens")
+
+ # Reasoning tokens live in `completion_tokens_details` for Chat Completions
+ # API (Usage) and in `output_tokens_details` for Responses API
+ # (ResponseAPIUsage). Both nested objects may be plain Pydantic models
+ # without `.get`.
+ token_details = _safe_get(usage, "completion_tokens_details") or _safe_get(
+ usage, "output_tokens_details"
+ )
+ reasoning_tokens = _safe_get(token_details, "reasoning_tokens")
if reasoning_tokens:
safe_set_attribute(
span,
diff --git a/litellm/integrations/arize/arize_phoenix_client.py b/litellm/integrations/arize/arize_phoenix_client.py
index 3c83517bb5..8c3c2a5ff0 100644
--- a/litellm/integrations/arize/arize_phoenix_client.py
+++ b/litellm/integrations/arize/arize_phoenix_client.py
@@ -2,11 +2,23 @@
Arize Phoenix API client for fetching prompt versions from Arize Phoenix.
"""
+import urllib.parse
from typing import Any, Dict, Optional
from litellm.llms.custom_httpx.http_handler import HTTPHandler
+def _sanitize_id(identifier: str) -> str:
+ """Reject path traversal characters and URL-encode the identifier."""
+ if any(c in identifier for c in ("/", "\\", "#", "?")):
+ raise ValueError(
+ f"Invalid identifier {identifier!r}: contains disallowed characters"
+ )
+ if ".." in identifier:
+ raise ValueError(f"Invalid identifier {identifier!r}: path traversal detected")
+ return urllib.parse.quote(identifier, safe="")
+
+
class ArizePhoenixClient:
"""
Client for interacting with Arize Phoenix API to fetch prompt versions.
@@ -53,7 +65,8 @@ class ArizePhoenixClient:
Returns:
Dictionary containing prompt version data, or None if not found
"""
- url = f"{self.api_base}/v1/prompt_versions/{prompt_version_id}"
+ safe_id = _sanitize_id(prompt_version_id)
+ url = f"{self.api_base}/v1/prompt_versions/{safe_id}"
try:
# Use the underlying httpx client directly to avoid query param extraction
diff --git a/litellm/integrations/arize/arize_phoenix_prompt_manager.py b/litellm/integrations/arize/arize_phoenix_prompt_manager.py
index 19af0bb955..df56d7bd39 100644
--- a/litellm/integrations/arize/arize_phoenix_prompt_manager.py
+++ b/litellm/integrations/arize/arize_phoenix_prompt_manager.py
@@ -5,7 +5,8 @@ Fetches prompt versions from Arize Phoenix and provides workspace-based access c
from typing import Any, Dict, List, Optional, Tuple, Union
-from jinja2 import DictLoader, Environment, select_autoescape
+from jinja2 import DictLoader, select_autoescape
+from jinja2.sandbox import ImmutableSandboxedEnvironment
from litellm.integrations.custom_prompt_management import CustomPromptManagement
from litellm.integrations.prompt_management_base import (
@@ -74,7 +75,13 @@ class ArizePhoenixTemplateManager:
api_key=self.api_key, api_base=self.api_base
)
- self.jinja_env = Environment(
+ # Templates fetched from Arize Phoenix come from external workspace
+ # users; in a plain `Environment()` a malicious template could reach
+ # `__class__.__init__.__globals__` and execute arbitrary code on the
+ # proxy host. The sandbox blocks that attribute traversal while
+ # leaving normal `{{ var }}` substitution intact. Matches the
+ # dotprompt manager's hardening.
+ self.jinja_env = ImmutableSandboxedEnvironment(
loader=DictLoader({}),
autoescape=select_autoescape(["html", "xml"]),
# Use Mustache/Handlebars-style delimiters
diff --git a/litellm/integrations/bitbucket/bitbucket_client.py b/litellm/integrations/bitbucket/bitbucket_client.py
index 0502422cf8..e742cc14b7 100644
--- a/litellm/integrations/bitbucket/bitbucket_client.py
+++ b/litellm/integrations/bitbucket/bitbucket_client.py
@@ -3,11 +3,27 @@ BitBucket API client for fetching .prompt files from BitBucket repositories.
"""
import base64
+import urllib.parse
from typing import Any, Dict, List, Optional
from litellm.llms.custom_httpx.http_handler import HTTPHandler
+def _sanitize_file_path(file_path: str) -> str:
+ """Reject path traversal and URL-encode each path segment."""
+ if "#" in file_path or "?" in file_path:
+ raise ValueError(
+ f"Invalid file path {file_path!r}: contains URL special characters"
+ )
+ parts = file_path.split("/")
+ for part in parts:
+ if part == "..":
+ raise ValueError(
+ f"Invalid file path {file_path!r}: path traversal detected"
+ )
+ return "/".join(urllib.parse.quote(part, safe="") for part in parts)
+
+
class BitBucketClient:
"""
Client for interacting with BitBucket API to fetch .prompt files.
@@ -72,7 +88,8 @@ class BitBucketClient:
Returns:
File content as string, or None if file not found
"""
- url = f"{self.base_url}/repositories/{self.workspace}/{self.repository}/src/{self.branch}/{file_path}"
+ safe_path = _sanitize_file_path(file_path)
+ url = f"{self.base_url}/repositories/{self.workspace}/{self.repository}/src/{self.branch}/{safe_path}"
try:
response = self.http_handler.get(url, headers=self.headers)
@@ -119,7 +136,8 @@ class BitBucketClient:
Returns:
List of file paths
"""
- url = f"{self.base_url}/repositories/{self.workspace}/{self.repository}/src/{self.branch}/{directory_path}"
+ safe_dir = _sanitize_file_path(directory_path) if directory_path else ""
+ url = f"{self.base_url}/repositories/{self.workspace}/{self.repository}/src/{self.branch}/{safe_dir}"
try:
response = self.http_handler.get(url, headers=self.headers)
@@ -211,7 +229,8 @@ class BitBucketClient:
Returns:
Dictionary containing file metadata, or None if file not found
"""
- url = f"{self.base_url}/repositories/{self.workspace}/{self.repository}/src/{self.branch}/{file_path}"
+ safe_path = _sanitize_file_path(file_path)
+ url = f"{self.base_url}/repositories/{self.workspace}/{self.repository}/src/{self.branch}/{safe_path}"
try:
# Use GET with Range header to get just the headers (HEAD equivalent)
diff --git a/litellm/integrations/bitbucket/bitbucket_prompt_manager.py b/litellm/integrations/bitbucket/bitbucket_prompt_manager.py
index 701f227364..844fa9f38c 100644
--- a/litellm/integrations/bitbucket/bitbucket_prompt_manager.py
+++ b/litellm/integrations/bitbucket/bitbucket_prompt_manager.py
@@ -5,7 +5,8 @@ Fetches .prompt files from BitBucket repositories and provides team-based access
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
-from jinja2 import DictLoader, Environment, select_autoescape
+from jinja2 import DictLoader, select_autoescape
+from jinja2.sandbox import ImmutableSandboxedEnvironment
from litellm.integrations.custom_prompt_management import CustomPromptManagement
@@ -74,7 +75,13 @@ class BitBucketTemplateManager:
self.prompts: Dict[str, BitBucketPromptTemplate] = {}
self.bitbucket_client = BitBucketClient(bitbucket_config)
- self.jinja_env = Environment(
+ # Templates fetched from a BitBucket repo are not trustworthy:
+ # anyone with repo write access can ship Jinja syntax that, in a
+ # plain `Environment()`, would reach `__class__.__init__.__globals__`
+ # and pivot into RCE on the proxy host. The sandbox blocks that
+ # attribute traversal while leaving normal `{{ var }}` substitution
+ # intact. Matches the dotprompt manager's hardening.
+ self.jinja_env = ImmutableSandboxedEnvironment(
loader=DictLoader({}),
autoescape=select_autoescape(["html", "xml"]),
# Use Handlebars-style delimiters to match Dotprompt spec
diff --git a/litellm/integrations/custom_sso_handler.py b/litellm/integrations/custom_sso_handler.py
index 7f60decabc..202e488e0e 100644
--- a/litellm/integrations/custom_sso_handler.py
+++ b/litellm/integrations/custom_sso_handler.py
@@ -18,6 +18,17 @@ class CustomSSOLoginHandler(CustomLogger):
self,
request: Request,
) -> OpenID:
+ from litellm.proxy.auth.trusted_proxy_utils import (
+ require_trusted_proxy_request,
+ )
+ from litellm.proxy.proxy_server import general_settings
+
+ require_trusted_proxy_request(
+ request=request,
+ general_settings=general_settings,
+ feature_name="Custom UI SSO",
+ )
+
request_headers_dict = dict(request.headers)
return OpenID(
id=request_headers_dict.get("x-litellm-user-id"),
diff --git a/litellm/integrations/gcs_bucket/gcs_bucket.py b/litellm/integrations/gcs_bucket/gcs_bucket.py
index 65296bafcf..9005798423 100644
--- a/litellm/integrations/gcs_bucket/gcs_bucket.py
+++ b/litellm/integrations/gcs_bucket/gcs_bucket.py
@@ -6,12 +6,14 @@ import time
from litellm._uuid import uuid
from datetime import datetime, timedelta, timezone
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
-from urllib.parse import quote
from litellm._logging import verbose_logger
from litellm.constants import LITELLM_ASYNCIO_QUEUE_MAXSIZE
from litellm.integrations.additional_logging_utils import AdditionalLoggingUtils
from litellm.integrations.gcs_bucket.gcs_bucket_base import GCSBucketBase
+from litellm.litellm_core_utils.cloud_storage_security import (
+ sanitize_cloud_object_component,
+)
from litellm.proxy._types import CommonProxyErrors
from litellm.types.integrations.base_health_check import IntegrationHealthCheckStatus
from litellm.types.integrations.gcs_bucket import *
@@ -335,7 +337,11 @@ class GCSBucketLogger(GCSBucketBase, AdditionalLoggingUtils):
_litellm_params = kwargs.get("litellm_params", None) or {}
_metadata = _litellm_params.get("metadata", None) or {}
if "gcs_log_id" in _metadata:
- object_name = _metadata["gcs_log_id"]
+ safe_log_id = sanitize_cloud_object_component(
+ _metadata.get("gcs_log_id"), fallback=""
+ )
+ if safe_log_id:
+ object_name = f"{current_date}/custom-{uuid.uuid4().hex}-{safe_log_id}"
return object_name
@@ -367,8 +373,7 @@ class GCSBucketLogger(GCSBucketBase, AdditionalLoggingUtils):
request_date_str=date_str,
response_id=request_id,
)
- encoded_object_name = quote(object_name, safe="")
- response = await self.download_gcs_object(encoded_object_name)
+ response = await self.download_gcs_object(object_name)
if response is not None:
loaded_response = json.loads(response)
diff --git a/litellm/integrations/gcs_bucket/gcs_bucket_base.py b/litellm/integrations/gcs_bucket/gcs_bucket_base.py
index e84b37e689..1c5e30777a 100644
--- a/litellm/integrations/gcs_bucket/gcs_bucket_base.py
+++ b/litellm/integrations/gcs_bucket/gcs_bucket_base.py
@@ -11,6 +11,10 @@ from litellm.integrations.gcs_bucket.gcs_bucket_mock_client import (
from litellm._logging import verbose_logger
from litellm.integrations.custom_batch_logger import CustomBatchLogger
+from litellm.litellm_core_utils.cloud_storage_security import (
+ encode_gcs_object_name_for_url,
+ split_configured_cloud_bucket_name,
+)
from litellm.llms.custom_httpx.http_handler import (
get_async_httpx_client,
httpxSpecialProvider,
@@ -133,8 +137,8 @@ class GCSBucketBase(CustomBatchLogger):
- Returns: bucket_name="my-bucket", object_name="my-folder/dev/my-object"
"""
- if "/" in bucket_name:
- bucket_name, prefix = bucket_name.split("/", 1)
+ bucket_name, prefix = split_configured_cloud_bucket_name(bucket_name)
+ if prefix:
object_name = f"{prefix}/{object_name}"
return bucket_name, object_name
return bucket_name, object_name
@@ -248,6 +252,7 @@ class GCSBucketBase(CustomBatchLogger):
bucket_name=bucket_name,
object_name=object_name,
)
+ object_name = encode_gcs_object_name_for_url(object_name)
url = f"https://storage.googleapis.com/storage/v1/b/{bucket_name}/o/{object_name}?alt=media"
@@ -288,6 +293,7 @@ class GCSBucketBase(CustomBatchLogger):
bucket_name=bucket_name,
object_name=object_name,
)
+ object_name = encode_gcs_object_name_for_url(object_name)
url = f"https://storage.googleapis.com/storage/v1/b/{bucket_name}/o/{object_name}"
@@ -334,10 +340,11 @@ class GCSBucketBase(CustomBatchLogger):
bucket_name=bucket_name,
object_name=object_name,
)
+ encoded_object_name = encode_gcs_object_name_for_url(object_name)
response = await self.async_httpx_client.post(
headers=headers,
- url=f"https://storage.googleapis.com/upload/storage/v1/b/{bucket_name}/o?uploadType=media&name={object_name}",
+ url=f"https://storage.googleapis.com/upload/storage/v1/b/{bucket_name}/o?uploadType=media&name={encoded_object_name}",
data=json_logged_payload,
)
diff --git a/litellm/integrations/gitlab/gitlab_prompt_manager.py b/litellm/integrations/gitlab/gitlab_prompt_manager.py
index b073948d76..a468741aea 100644
--- a/litellm/integrations/gitlab/gitlab_prompt_manager.py
+++ b/litellm/integrations/gitlab/gitlab_prompt_manager.py
@@ -4,7 +4,8 @@ GitLab prompt manager with configurable prompts folder.
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
-from jinja2 import DictLoader, Environment, select_autoescape
+from jinja2 import DictLoader, select_autoescape
+from jinja2.sandbox import ImmutableSandboxedEnvironment
from litellm.integrations.custom_prompt_management import CustomPromptManagement
@@ -90,7 +91,13 @@ class GitLabTemplateManager:
or ""
).strip("/")
- self.jinja_env = Environment(
+ # Templates fetched from a GitLab repo are not trustworthy:
+ # anyone with repo write access can ship Jinja syntax that, in a
+ # plain `Environment()`, would reach `__class__.__init__.__globals__`
+ # and pivot into RCE on the proxy host. The sandbox blocks that
+ # attribute traversal while leaving normal `{{ var }}` substitution
+ # intact. Matches the dotprompt manager's hardening.
+ self.jinja_env = ImmutableSandboxedEnvironment(
loader=DictLoader({}),
autoescape=select_autoescape(["html", "xml"]),
variable_start_string="{{",
diff --git a/litellm/integrations/langfuse/langfuse.py b/litellm/integrations/langfuse/langfuse.py
index e691c490c8..0efc7d6687 100644
--- a/litellm/integrations/langfuse/langfuse.py
+++ b/litellm/integrations/langfuse/langfuse.py
@@ -90,6 +90,29 @@ def _extract_cache_read_input_tokens(usage_obj) -> int:
return cache_read_input_tokens
+def resolve_langfuse_credentials(
+ langfuse_public_key=None,
+ langfuse_secret=None,
+ langfuse_secret_key=None,
+ langfuse_host=None,
+ allow_env_credentials: bool = True,
+):
+ if allow_env_credentials is False and langfuse_host is not None:
+ secret_key = langfuse_secret or langfuse_secret_key
+ public_key = langfuse_public_key
+ else:
+ secret_key = (
+ langfuse_secret or langfuse_secret_key or os.getenv("LANGFUSE_SECRET_KEY")
+ )
+ public_key = langfuse_public_key or os.getenv("LANGFUSE_PUBLIC_KEY")
+
+ resolved_host = langfuse_host or os.getenv(
+ "LANGFUSE_HOST", "https://cloud.langfuse.com"
+ )
+
+ return public_key, secret_key, resolved_host
+
+
class LangFuseLogger:
# Class variables or attributes
def __init__(
@@ -98,6 +121,7 @@ class LangFuseLogger:
langfuse_secret=None,
langfuse_host=None,
flush_interval=1,
+ allow_env_credentials: bool = True,
):
try:
import langfuse
@@ -106,11 +130,13 @@ class LangFuseLogger:
raise Exception(
f"\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: {e}\n{traceback.format_exc()}\033[0m"
)
- # Instance variables
- self.secret_key = langfuse_secret or os.getenv("LANGFUSE_SECRET_KEY")
- self.public_key = langfuse_public_key or os.getenv("LANGFUSE_PUBLIC_KEY")
- self.langfuse_host = langfuse_host or os.getenv(
- "LANGFUSE_HOST", "https://cloud.langfuse.com"
+ self.public_key, self.secret_key, self.langfuse_host = (
+ resolve_langfuse_credentials(
+ langfuse_public_key=langfuse_public_key,
+ langfuse_secret=langfuse_secret,
+ langfuse_host=langfuse_host,
+ allow_env_credentials=allow_env_credentials,
+ )
)
if not (
self.langfuse_host.startswith("http://")
@@ -160,9 +186,10 @@ class LangFuseLogger:
project_id = None
if os.getenv("UPSTREAM_LANGFUSE_SECRET_KEY") is not None:
+ upstream_langfuse_debug_env = os.getenv("UPSTREAM_LANGFUSE_DEBUG")
upstream_langfuse_debug = (
- str_to_bool(self.upstream_langfuse_debug)
- if self.upstream_langfuse_debug is not None
+ str_to_bool(upstream_langfuse_debug_env)
+ if upstream_langfuse_debug_env is not None
else None
)
self.upstream_langfuse_secret_key = os.getenv(
@@ -173,7 +200,7 @@ class LangFuseLogger:
)
self.upstream_langfuse_host = os.getenv("UPSTREAM_LANGFUSE_HOST")
self.upstream_langfuse_release = os.getenv("UPSTREAM_LANGFUSE_RELEASE")
- self.upstream_langfuse_debug = os.getenv("UPSTREAM_LANGFUSE_DEBUG")
+ self.upstream_langfuse_debug = upstream_langfuse_debug_env
self.upstream_langfuse = Langfuse(
public_key=self.upstream_langfuse_public_key,
secret_key=self.upstream_langfuse_secret_key,
diff --git a/litellm/integrations/langfuse/langfuse_handler.py b/litellm/integrations/langfuse/langfuse_handler.py
index fbadf1a2fc..4a80972642 100644
--- a/litellm/integrations/langfuse/langfuse_handler.py
+++ b/litellm/integrations/langfuse/langfuse_handler.py
@@ -115,8 +115,10 @@ class LangFuseHandler:
langfuse_logger = LangFuseLogger(
langfuse_public_key=credentials.get("langfuse_public_key"),
- langfuse_secret=credentials.get("langfuse_secret"),
+ langfuse_secret=credentials.get("langfuse_secret")
+ or credentials.get("langfuse_secret_key"),
langfuse_host=credentials.get("langfuse_host"),
+ allow_env_credentials=credentials.get("langfuse_host") is None,
)
in_memory_dynamic_logger_cache.set_cache(
credentials=credentials,
diff --git a/litellm/integrations/langfuse/langfuse_prompt_management.py b/litellm/integrations/langfuse/langfuse_prompt_management.py
index 5f4ced3a5c..b7a565512c 100644
--- a/litellm/integrations/langfuse/langfuse_prompt_management.py
+++ b/litellm/integrations/langfuse/langfuse_prompt_management.py
@@ -20,7 +20,7 @@ from ...litellm_core_utils.specialty_caches.dynamic_logging_cache import (
DynamicLoggingCache,
)
from ..prompt_management_base import PromptManagementBase
-from .langfuse import LangFuseLogger
+from .langfuse import LangFuseLogger, resolve_langfuse_credentials
from .langfuse_handler import LangFuseHandler
if TYPE_CHECKING:
@@ -46,6 +46,7 @@ def langfuse_client_init(
langfuse_secret_key=None,
langfuse_host=None,
flush_interval=1,
+ allow_env_credentials: bool = True,
) -> LangfuseClass:
"""
Initialize Langfuse client with caching to prevent multiple initializations.
@@ -70,14 +71,12 @@ def langfuse_client_init(
f"\033[91mLangfuse not installed, try running 'pip install langfuse' to fix this error: {e}\n\033[0m"
)
- # Instance variables
-
- secret_key = (
- langfuse_secret or langfuse_secret_key or os.getenv("LANGFUSE_SECRET_KEY")
- )
- public_key = langfuse_public_key or os.getenv("LANGFUSE_PUBLIC_KEY")
- langfuse_host = langfuse_host or os.getenv(
- "LANGFUSE_HOST", "https://cloud.langfuse.com"
+ public_key, secret_key, langfuse_host = resolve_langfuse_credentials(
+ langfuse_public_key=langfuse_public_key,
+ langfuse_secret=langfuse_secret,
+ langfuse_secret_key=langfuse_secret_key,
+ langfuse_host=langfuse_host,
+ allow_env_credentials=allow_env_credentials,
)
if not (
@@ -222,6 +221,7 @@ class LangfusePromptManagement(LangFuseLogger, PromptManagementBase, CustomLogge
langfuse_secret=dynamic_callback_params.get("langfuse_secret"),
langfuse_secret_key=dynamic_callback_params.get("langfuse_secret_key"),
langfuse_host=dynamic_callback_params.get("langfuse_host"),
+ allow_env_credentials=dynamic_callback_params.get("langfuse_host") is None,
)
langfuse_prompt_client = self._get_prompt_from_id(
langfuse_prompt_id=prompt_id,
@@ -246,6 +246,7 @@ class LangfusePromptManagement(LangFuseLogger, PromptManagementBase, CustomLogge
langfuse_secret=dynamic_callback_params.get("langfuse_secret"),
langfuse_secret_key=dynamic_callback_params.get("langfuse_secret_key"),
langfuse_host=dynamic_callback_params.get("langfuse_host"),
+ allow_env_credentials=dynamic_callback_params.get("langfuse_host") is None,
)
langfuse_prompt_client = self._get_prompt_from_id(
langfuse_prompt_id=prompt_id,
diff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.py
index 3d4fd39ebe..81570e462c 100644
--- a/litellm/integrations/langsmith.py
+++ b/litellm/integrations/langsmith.py
@@ -19,6 +19,7 @@ from litellm.integrations.langsmith_mock_client import (
create_mock_langsmith_client,
should_use_langsmith_mock,
)
+from litellm.litellm_core_utils.redact_messages import redact_user_api_key_info
from litellm.llms.custom_httpx.http_handler import (
get_async_httpx_client,
httpxSpecialProvider,
@@ -112,17 +113,28 @@ class LangsmithLogger(CustomBatchLogger):
langsmith_project: Optional[str] = None,
langsmith_base_url: Optional[str] = None,
langsmith_tenant_id: Optional[str] = None,
+ allow_env_credentials: bool = True,
) -> LangsmithCredentialsObject:
- _credentials_api_key = langsmith_api_key or os.getenv("LANGSMITH_API_KEY")
- _credentials_project = (
- langsmith_project or os.getenv("LANGSMITH_PROJECT") or "litellm-completion"
- )
- _credentials_base_url = (
- langsmith_base_url
- or os.getenv("LANGSMITH_BASE_URL")
- or "https://api.smith.langchain.com"
- )
- _credentials_tenant_id = langsmith_tenant_id or os.getenv("LANGSMITH_TENANT_ID")
+ if allow_env_credentials is False and langsmith_base_url is not None:
+ _credentials_api_key = langsmith_api_key
+ _credentials_project = langsmith_project or "litellm-completion"
+ _credentials_base_url = langsmith_base_url
+ _credentials_tenant_id = langsmith_tenant_id
+ else:
+ _credentials_api_key = langsmith_api_key or os.getenv("LANGSMITH_API_KEY")
+ _credentials_project = (
+ langsmith_project
+ or os.getenv("LANGSMITH_PROJECT")
+ or "litellm-completion"
+ )
+ _credentials_base_url = (
+ langsmith_base_url
+ or os.getenv("LANGSMITH_BASE_URL")
+ or "https://api.smith.langchain.com"
+ )
+ _credentials_tenant_id = langsmith_tenant_id or os.getenv(
+ "LANGSMITH_TENANT_ID"
+ )
return LangsmithCredentialsObject(
LANGSMITH_API_KEY=_credentials_api_key,
@@ -153,6 +165,15 @@ class LangsmithLogger(CustomBatchLogger):
for key in ("session_id", "thread_id", "conversation_id"):
if key in requester_metadata and key not in extra_metadata:
extra_metadata[key] = requester_metadata[key]
+
+ # helper is shallow; also scrub nested requester_metadata since
+ # LangSmith forwards the whole dict into `extra`
+ extra_metadata = redact_user_api_key_info(metadata=extra_metadata)
+ nested = extra_metadata.get("requester_metadata")
+ if isinstance(nested, dict):
+ extra_metadata["requester_metadata"] = redact_user_api_key_info(
+ metadata=nested
+ )
return extra_metadata
def _build_outputs_with_usage(
@@ -540,6 +561,10 @@ class LangsmithLogger(CustomBatchLogger):
langsmith_tenant_id=standard_callback_dynamic_params.get(
"langsmith_tenant_id", None
),
+ allow_env_credentials=standard_callback_dynamic_params.get(
+ "langsmith_base_url", None
+ )
+ is None,
)
else:
credentials = self.default_credentials
diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py
index b6d91d0b76..77833e5de0 100644
--- a/litellm/integrations/opentelemetry.py
+++ b/litellm/integrations/opentelemetry.py
@@ -69,6 +69,8 @@ class OpenTelemetryConfig:
deployment_environment: Optional[str] = None
model_id: Optional[str] = None
ignore_context_propagation: Optional[bool] = None
+ # When True, create a private TracerProvider instead of reusing or setting the global one.
+ skip_set_global: bool = False
def __post_init__(self) -> None:
# If endpoint is specified but exporter is still the default "console",
@@ -259,16 +261,21 @@ class OpenTelemetry(CustomLogger):
try:
existing_provider = get_existing_provider_fn()
- # If a real SDK provider exists (set by another SDK like Langfuse), use it
- # This uses a positive check for SDK providers instead of a negative check for proxy providers
if isinstance(existing_provider, sdk_provider_class):
- verbose_logger.debug(
- "OpenTelemetry: Using existing %s: %s",
- provider_name,
- type(existing_provider).__name__,
- )
- provider = existing_provider
- # Don't call set_provider to preserve existing context
+ if skip_set_global:
+ verbose_logger.debug(
+ "OpenTelemetry: existing %s found but skip_set_global=True; creating private %s for isolation",
+ provider_name,
+ provider_name,
+ )
+ provider = create_new_provider_fn()
+ else:
+ verbose_logger.debug(
+ "OpenTelemetry: Using existing %s: %s",
+ provider_name,
+ type(existing_provider).__name__,
+ )
+ provider = existing_provider
else:
# Default proxy provider or unknown type, create our own
verbose_logger.debug("OpenTelemetry: Creating new %s", provider_name)
@@ -293,6 +300,12 @@ class OpenTelemetry(CustomLogger):
return provider
+ def _skip_set_global(self) -> bool:
+ # langfuse_otel relies on the Langfuse SDK's providers; don't overwrite them.
+ return self.config.skip_set_global or (
+ hasattr(self, "callback_name") and self.callback_name == "langfuse_otel"
+ )
+
def _init_tracing(self, tracer_provider):
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
@@ -303,11 +316,6 @@ class OpenTelemetry(CustomLogger):
provider.add_span_processor(self._get_span_processor())
return provider
- # CRITICAL FIX: For Langfuse OTEL, skip setting global provider to prevent interference
- skip_global = (
- hasattr(self, "callback_name") and self.callback_name == "langfuse_otel"
- )
-
tracer_provider = self._get_or_create_provider(
provider=tracer_provider,
provider_name="TracerProvider",
@@ -315,16 +323,18 @@ class OpenTelemetry(CustomLogger):
sdk_provider_class=TracerProvider,
create_new_provider_fn=create_tracer_provider,
set_provider_fn=trace.set_tracer_provider,
- skip_set_global=skip_global,
+ skip_set_global=self._skip_set_global(),
)
# Grab our tracer from the TracerProvider (not from global context)
# This ensures we use the provided TracerProvider (e.g., for testing)
self.tracer = tracer_provider.get_tracer(LITELLM_TRACER_NAME)
+ self._tracer_provider = tracer_provider
self.span_kind = SpanKind
def _init_metrics(self, meter_provider):
if not self.config.enable_metrics:
+ self._meter_provider = None
self._operation_duration_histogram = None
self._token_usage_histogram = None
self._cost_histogram = None
@@ -350,7 +360,9 @@ class OpenTelemetry(CustomLogger):
sdk_provider_class=MeterProvider,
create_new_provider_fn=create_meter_provider,
set_provider_fn=metrics.set_meter_provider,
+ skip_set_global=self._skip_set_global(),
)
+ self._meter_provider = meter_provider
meter = meter_provider.get_meter(__name__)
@@ -388,6 +400,7 @@ class OpenTelemetry(CustomLogger):
def _init_logs(self, logger_provider):
# nothing to do if events disabled
if not self.config.enable_events:
+ self._logger_provider = None
return
from opentelemetry._logs import get_logger_provider, set_logger_provider
@@ -404,13 +417,14 @@ class OpenTelemetry(CustomLogger):
)
return provider
- self._get_or_create_provider(
+ self._logger_provider = self._get_or_create_provider(
provider=logger_provider,
provider_name="LoggerProvider",
get_existing_provider_fn=get_logger_provider,
sdk_provider_class=OTLoggerProvider,
create_new_provider_fn=create_logger_provider,
set_provider_fn=set_logger_provider,
+ skip_set_global=self._skip_set_global(),
)
def log_success_event(self, kwargs, response_obj, start_time, end_time):
@@ -1073,7 +1087,7 @@ class OpenTelemetry(CustomLogger):
# See: https://github.com/open-telemetry/opentelemetry-python/pull/4676
# TODO: Refactor to use the proper OTEL Logs API instead of directly creating SDK LogRecords
- from opentelemetry._logs import SeverityNumber, get_logger
+ from opentelemetry._logs import SeverityNumber
try:
from opentelemetry.sdk._logs import ( # type: ignore[attr-defined] # OTEL < 1.39.0
@@ -1084,7 +1098,10 @@ class OpenTelemetry(CustomLogger):
LogRecord as SdkLogRecord, # type: ignore[attr-defined] # OTEL >= 1.39.0
)
- otel_logger = get_logger(LITELLM_LOGGER_NAME)
+ # Resolve through the handler's own LoggerProvider (which may be a
+ # private one when skip_set_global=True) rather than the module-level
+ # get_logger() which always goes through the global provider.
+ otel_logger = self._logger_provider.get_logger(LITELLM_LOGGER_NAME)
parent_ctx = span.get_span_context()
provider = (kwargs.get("litellm_params") or {}).get(
diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py
index 723b142dfa..7d3856ea63 100644
--- a/litellm/integrations/prometheus.py
+++ b/litellm/integrations/prometheus.py
@@ -265,6 +265,7 @@ class PrometheusLogger(CustomLogger):
########################################
# LiteLLM Virtual API KEY metrics
########################################
+
# Remaining MODEL RPM limit for API Key
self.litellm_remaining_api_key_requests_for_model = self._gauge_factory(
"litellm_remaining_api_key_requests_for_model",
@@ -1928,7 +1929,7 @@ class PrometheusLogger(CustomLogger):
or _litellm_params_metadata.get("user_agent"),
}
- def set_llm_deployment_failure_metrics(self, request_kwargs: dict):
+ def set_llm_deployment_failure_metrics(self, request_kwargs: dict): # noqa: PLR0915
"""
Sets Failure metrics when an LLM API call fails
@@ -2006,17 +2007,32 @@ class PrometheusLogger(CustomLogger):
if code is not None:
exception_status = str(code)
- # Create enum_values for the label factory (always create for use in different metrics)
+ # On LiteLLM-side rejects (no deployment picked), route request_kwargs["model"]
+ # into requested_model and leave deployment-scoped labels empty.
+ deployment_selected = bool(model_id)
+ if deployment_selected:
+ label_litellm_model_name = litellm_model_name
+ label_model_id = model_id
+ label_api_base = api_base
+ label_api_provider = llm_provider
+ label_requested_model = model_group or litellm_model_name
+ else:
+ label_litellm_model_name = ""
+ label_model_id = ""
+ label_api_base = ""
+ label_api_provider = ""
+ label_requested_model = litellm_model_name or model_group or ""
+
enum_values = UserAPIKeyLabelValues(
- litellm_model_name=litellm_model_name,
- model_id=model_id,
- api_base=api_base,
- api_provider=llm_provider,
+ litellm_model_name=label_litellm_model_name,
+ model_id=label_model_id,
+ api_base=label_api_base,
+ api_provider=label_api_provider,
exception_status=exception_status,
exception_class=(
self._get_exception_class_name(exception) if exception else None
),
- requested_model=model_group or litellm_model_name,
+ requested_model=label_requested_model,
hashed_api_key=hashed_api_key,
api_key_alias=api_key_alias,
team=team,
@@ -2030,12 +2046,14 @@ class PrometheusLogger(CustomLogger):
log these labels
["litellm_model_name", "model_id", "api_base", "api_provider"]
"""
- self.set_deployment_partial_outage(
- litellm_model_name=litellm_model_name or "",
- model_id=model_id,
- api_base=api_base,
- api_provider=llm_provider or "",
- )
+ # Only mark a deployment outage when one was actually picked.
+ if deployment_selected:
+ self.set_deployment_partial_outage(
+ litellm_model_name=litellm_model_name or "",
+ model_id=model_id,
+ api_base=api_base,
+ api_provider=llm_provider or "",
+ )
_deployment_label_ctx = PrometheusLabelFactoryContext(enum_values)
if exception is not None:
PrometheusLogger._inc_labeled_counter(
diff --git a/litellm/integrations/prometheus_helpers/prometheus_api.py b/litellm/integrations/prometheus_helpers/prometheus_api.py
index b25da57723..0901d7b680 100644
--- a/litellm/integrations/prometheus_helpers/prometheus_api.py
+++ b/litellm/integrations/prometheus_helpers/prometheus_api.py
@@ -2,6 +2,7 @@
Helper functions to query prometheus API
"""
+import json
import time
from datetime import datetime, timedelta
from typing import Optional
@@ -81,6 +82,24 @@ def is_prometheus_connected() -> bool:
return False
+def _quote_promql_string_literal(value: str) -> str:
+ """Render ``value`` as a PromQL double-quoted string literal.
+
+ PromQL string literals follow Go's escape rules
+ (https://prometheus.io/docs/prometheus/latest/querying/basics/): a
+ backslash begins an escape sequence and a bare ``"`` ends the literal.
+ Without escaping, callers that accept arbitrary user-supplied values
+ (like the ``api_key`` filter on ``/global/spend/logs``) can inject extra
+ label matchers or selectors and read cross-tenant metrics.
+
+ JSON's quoting rules are a strict subset of Go's, so ``json.dumps`` of
+ a Python string produces a literal Prometheus accepts: ``\\``, ``\\"``,
+ and the standard ``\\n`` / ``\\t`` / ``\\uNNNN`` control-character
+ escapes. The returned value already includes the surrounding quotes.
+ """
+ return json.dumps(value, ensure_ascii=False)
+
+
async def get_daily_spend_from_prometheus(api_key: Optional[str]):
"""
Expected Response Format:
@@ -109,8 +128,11 @@ async def get_daily_spend_from_prometheus(api_key: Optional[str]):
if api_key is None:
query = "sum(delta(litellm_spend_metric_total[1d]))"
else:
+ quoted_api_key = _quote_promql_string_literal(api_key)
query = (
- f'sum(delta(litellm_spend_metric_total{{hashed_api_key="{api_key}"}}[1d]))'
+ "sum(delta(litellm_spend_metric_total{"
+ f"hashed_api_key={quoted_api_key}"
+ "}[1d]))"
)
params = {
diff --git a/litellm/litellm_core_utils/cli_token_utils.py b/litellm/litellm_core_utils/cli_token_utils.py
index e2e304931a..3776d27691 100644
--- a/litellm/litellm_core_utils/cli_token_utils.py
+++ b/litellm/litellm_core_utils/cli_token_utils.py
@@ -31,15 +31,23 @@ def load_cli_token() -> Optional[dict]:
return None
-def get_litellm_gateway_api_key() -> Optional[str]:
+def get_litellm_gateway_api_key(
+ expected_base_url: Optional[str] = None,
+) -> Optional[str]:
"""
Get the stored CLI API key for use with LiteLLM SDK.
This function reads the token file created by `litellm-proxy login`
and returns the API key for use in Python scripts.
+ Args:
+ expected_base_url: When provided, the key is only returned if it was
+ originally issued for this URL. Pass the target server URL to
+ prevent credential leakage when the client is pointed at a
+ different (possibly malicious) server.
+
Returns:
- str: The API key if found, None otherwise
+ str: The API key if found (and origin matches), None otherwise
Example:
>>> import litellm
@@ -53,6 +61,10 @@ def get_litellm_gateway_api_key() -> Optional[str]:
>>> )
"""
token_data = load_cli_token()
- if token_data and "key" in token_data:
- return token_data["key"]
- return None
+ if not token_data or "key" not in token_data:
+ return None
+ if expected_base_url is not None:
+ stored_url = token_data.get("base_url")
+ if stored_url != expected_base_url.rstrip("/"):
+ return None
+ return token_data["key"]
diff --git a/litellm/litellm_core_utils/cloud_storage_security.py b/litellm/litellm_core_utils/cloud_storage_security.py
new file mode 100644
index 0000000000..daa3dc6032
--- /dev/null
+++ b/litellm/litellm_core_utils/cloud_storage_security.py
@@ -0,0 +1,175 @@
+import posixpath
+import re
+from types import MappingProxyType
+from typing import Any, Mapping, Optional, Sequence, Tuple, cast
+from urllib.parse import quote, unquote
+
+from litellm._uuid import uuid
+
+VERTEX_AI_MANAGED_GCS_PREFIX = "litellm-vertex-files/"
+BEDROCK_MANAGED_S3_BATCH_PREFIX = "litellm-bedrock-files-"
+BEDROCK_MANAGED_S3_UPLOAD_PREFIX = "litellm-bedrock-files/"
+BEDROCK_MANAGED_S3_OUTPUT_PREFIX = "litellm-batch-outputs/"
+BEDROCK_MANAGED_S3_PREFIXES = (
+ BEDROCK_MANAGED_S3_BATCH_PREFIX,
+ BEDROCK_MANAGED_S3_UPLOAD_PREFIX,
+ BEDROCK_MANAGED_S3_OUTPUT_PREFIX,
+)
+_MAPPING_PROXY_TYPE: type = type(MappingProxyType({}))
+
+_SAFE_OBJECT_COMPONENT_PATTERN = re.compile(r"[^A-Za-z0-9._-]+")
+
+
+def sanitize_cloud_object_component(
+ value: Optional[str], fallback: str = "file"
+) -> str:
+ if not isinstance(value, str):
+ return fallback
+
+ component = posixpath.basename(value.replace("\\", "/")).strip()
+ if component in {"", ".", ".."}:
+ return fallback
+
+ component = "".join(
+ "_" if ord(char) < 32 or ord(char) == 127 else char for char in component
+ )
+ component = _SAFE_OBJECT_COMPONENT_PATTERN.sub("_", component)
+ component = component.strip("._")
+ if not component:
+ return fallback
+ return component[:255]
+
+
+def sanitize_cloud_object_path(value: Optional[str], fallback: str = "file") -> str:
+ if not isinstance(value, str):
+ return fallback
+
+ segments = []
+ for segment in value.replace("\\", "/").split("/"):
+ sanitized_segment = sanitize_cloud_object_component(segment, fallback="")
+ if sanitized_segment:
+ segments.append(sanitized_segment)
+
+ if not segments:
+ return fallback
+ return "/".join(segments)
+
+
+def build_managed_cloud_object_name(
+ prefix: str, filename: Optional[str], fallback_filename: str = "file"
+) -> str:
+ safe_filename = sanitize_cloud_object_component(
+ filename, fallback=fallback_filename
+ )
+ return f"{prefix}{uuid.uuid4().hex}-{safe_filename}"
+
+
+def _validate_cloud_object_path(object_name: str) -> None:
+ if not object_name:
+ raise ValueError("Cloud storage object name is required")
+ if object_name.startswith("/"):
+ raise ValueError("Cloud storage object name must be relative")
+ if any(ord(char) < 32 or ord(char) == 127 for char in object_name):
+ raise ValueError("Cloud storage object name contains control characters")
+ segments = object_name.split("/")
+ if any(segment in {".", ".."} for segment in segments):
+ raise ValueError("Cloud storage object name contains an invalid path segment")
+ if "" in segments[:-1]:
+ raise ValueError("Cloud storage object name contains an invalid path segment")
+
+
+def split_configured_cloud_bucket_name(bucket_name: str) -> Tuple[str, str]:
+ if not isinstance(bucket_name, str) or not bucket_name.strip():
+ raise ValueError("Cloud storage bucket name is required")
+
+ bucket_name = bucket_name.strip()
+ if "://" in bucket_name or "?" in bucket_name or "#" in bucket_name:
+ raise ValueError(
+ "Cloud storage bucket name must not include a URI scheme or query"
+ )
+ if any(ord(char) < 32 or ord(char) == 127 for char in bucket_name):
+ raise ValueError("Cloud storage bucket name contains control characters")
+
+ bucket, _, prefix = bucket_name.partition("/")
+ if not bucket:
+ raise ValueError("Cloud storage bucket name is required")
+ if "\\" in bucket:
+ raise ValueError("Cloud storage bucket name contains an invalid separator")
+
+ prefix = prefix.strip("/")
+ if prefix:
+ _validate_cloud_object_path(prefix)
+
+ return bucket, prefix
+
+
+def encode_gcs_object_name_for_url(object_name: str) -> str:
+ return quote(unquote(object_name), safe="")
+
+
+def encode_s3_object_key_for_url(object_key: str) -> str:
+ return quote(unquote(object_key), safe="/")
+
+
+def should_allow_legacy_cloud_file_ids(
+ litellm_params: Optional[Mapping[str, Any]] = None,
+) -> bool:
+ value = None
+ if isinstance(litellm_params, Mapping):
+ trusted_model_credentials = litellm_params.get(
+ "_litellm_internal_model_credentials"
+ )
+ if isinstance(trusted_model_credentials, _MAPPING_PROXY_TYPE):
+ value = cast(Mapping[str, Any], trusted_model_credentials).get(
+ "allow_legacy_cloud_file_ids"
+ )
+
+ if isinstance(value, bool):
+ return value
+ if isinstance(value, str):
+ return value.strip().lower() in {"1", "true", "yes", "on"}
+ return False
+
+
+def validate_managed_cloud_file_id(
+ file_id: str,
+ scheme: str,
+ configured_bucket_name: str,
+ allowed_object_prefixes: Sequence[str],
+ allow_legacy_cloud_file_ids: bool = False,
+) -> Tuple[str, str]:
+ decoded_file_id = unquote(file_id)
+ if not decoded_file_id.startswith(scheme):
+ raise ValueError(f"file_id must be a {scheme} URI")
+
+ full_path = decoded_file_id[len(scheme) :]
+ if "/" not in full_path:
+ raise ValueError("file_id must include a cloud storage object name")
+
+ bucket_name, object_name = full_path.split("/", 1)
+ configured_bucket, configured_prefix = split_configured_cloud_bucket_name(
+ configured_bucket_name
+ )
+ if bucket_name != configured_bucket:
+ raise ValueError("file_id bucket does not match the configured storage bucket")
+
+ _validate_cloud_object_path(object_name)
+ allowed_prefixes = tuple(allowed_object_prefixes)
+ if configured_prefix:
+ allowed_prefixes = tuple(
+ f"{configured_prefix.rstrip('/')}/{prefix}" for prefix in allowed_prefixes
+ )
+
+ if object_name.startswith(allowed_prefixes):
+ return bucket_name, object_name
+
+ if allow_legacy_cloud_file_ids:
+ if configured_prefix and not object_name.startswith(
+ f"{configured_prefix.rstrip('/')}/"
+ ):
+ raise ValueError(
+ "file_id object does not match the configured storage prefix"
+ )
+ return bucket_name, object_name
+
+ raise ValueError("file_id must reference a LiteLLM-managed storage object")
diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py
index 5a7d4e33b6..2c1d92920a 100644
--- a/litellm/litellm_core_utils/exception_mapping_utils.py
+++ b/litellm/litellm_core_utils/exception_mapping_utils.py
@@ -6,7 +6,8 @@ from typing import Any, Optional
import httpx
import litellm
-from litellm._logging import _redact_string, verbose_logger
+from litellm._logging import _ENABLE_SECRET_REDACTION, _redact_string, verbose_logger
+from litellm.litellm_core_utils.secret_redaction import redact_string
from litellm.types.utils import LlmProviders
from ..exceptions import (
@@ -261,10 +262,18 @@ def exception_type( # type: ignore # noqa: PLR0915
original_exception=original_exception
)
try:
- error_str = str(original_exception)
+ error_str = (
+ redact_string(str(original_exception))
+ if _ENABLE_SECRET_REDACTION
+ else str(original_exception)
+ )
if model:
if hasattr(original_exception, "message"):
- error_str = str(original_exception.message)
+ error_str = (
+ redact_string(str(original_exception.message))
+ if _ENABLE_SECRET_REDACTION
+ else str(original_exception.message)
+ )
if isinstance(original_exception, BaseException):
exception_type = type(original_exception).__name__
else:
@@ -2431,7 +2440,8 @@ def exception_type( # type: ignore # noqa: PLR0915
else:
raise APIConnectionError(
message="{}\n{}".format(
- str(original_exception), _redact_string(traceback.format_exc())
+ str(original_exception),
+ _redact_string(traceback.format_exc()),
),
llm_provider=custom_llm_provider,
model=model,
@@ -2461,7 +2471,8 @@ def exception_type( # type: ignore # noqa: PLR0915
raise e # it's already mapped
raised_exc = APIConnectionError(
message="{}\n{}".format(
- original_exception, _redact_string(traceback.format_exc())
+ original_exception,
+ _redact_string(traceback.format_exc()),
),
llm_provider="",
model="",
diff --git a/litellm/litellm_core_utils/initialize_dynamic_callback_params.py b/litellm/litellm_core_utils/initialize_dynamic_callback_params.py
index ffb6436f38..a89dae5231 100644
--- a/litellm/litellm_core_utils/initialize_dynamic_callback_params.py
+++ b/litellm/litellm_core_utils/initialize_dynamic_callback_params.py
@@ -37,8 +37,6 @@ _supported_callback_params = [
"langfuse_secret_key",
"langfuse_host",
"langfuse_prompt_version",
- "gcs_bucket_name",
- "gcs_path_service_account",
"langsmith_api_key",
"langsmith_project",
"langsmith_base_url",
@@ -57,6 +55,11 @@ _supported_callback_params = [
"lunary_public_key",
]
+_request_blocked_callback_params = {
+ "gcs_bucket_name",
+ "gcs_path_service_account",
+}
+
def initialize_standard_callback_dynamic_params(
kwargs: Optional[Dict] = None,
@@ -64,13 +67,15 @@ def initialize_standard_callback_dynamic_params(
"""
Initialize the standard callback dynamic params from the kwargs
- checks if langfuse_secret_key, gcs_bucket_name in kwargs and sets the corresponding attributes in StandardCallbackDynamicParams
+ checks supported request callback params in kwargs and sets the corresponding attributes in StandardCallbackDynamicParams
"""
standard_callback_dynamic_params = StandardCallbackDynamicParams()
if kwargs:
# 1. Check top-level kwargs
for param in _supported_callback_params:
+ if param in _request_blocked_callback_params:
+ continue
if param in kwargs:
_param_value = kwargs.get(param)
validate_no_callback_env_reference(
@@ -86,6 +91,8 @@ def initialize_standard_callback_dynamic_params(
if isinstance(metadata, dict):
for param in _supported_callback_params:
+ if param in _request_blocked_callback_params:
+ continue
if param not in standard_callback_dynamic_params and param in metadata:
_param_value = metadata.get(param)
validate_no_callback_env_reference(
diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py
index 829c1c9ca0..a815442c2f 100644
--- a/litellm/litellm_core_utils/litellm_logging.py
+++ b/litellm/litellm_core_utils/litellm_logging.py
@@ -3242,10 +3242,15 @@ class Logging(LiteLLMLoggingBaseClass):
),
langfuse_secret=self.standard_callback_dynamic_params.get(
"langfuse_secret"
- ),
+ )
+ or self.standard_callback_dynamic_params.get("langfuse_secret_key"),
langfuse_host=self.standard_callback_dynamic_params.get(
"langfuse_host"
),
+ allow_env_credentials=self.standard_callback_dynamic_params.get(
+ "langfuse_host"
+ )
+ is None,
)
return langFuseLogger
@@ -4720,7 +4725,7 @@ class StandardLoggingPayloadSetup:
):
for key, value in litellm_params["metadata"].items():
# Skip non-serializable objects like UserAPIKeyAuth
- if key == "user_api_key_auth":
+ if key in {"user_api_key_auth", "user_api_key_budget_reservation"}:
continue
merged_metadata[key] = value
diff --git a/litellm/litellm_core_utils/llm_request_utils.py b/litellm/litellm_core_utils/llm_request_utils.py
index f5f28822ca..7be7085297 100644
--- a/litellm/litellm_core_utils/llm_request_utils.py
+++ b/litellm/litellm_core_utils/llm_request_utils.py
@@ -77,8 +77,8 @@ def get_proxy_server_request_headers(litellm_params: Optional[dict]) -> dict:
if litellm_params is None:
return {}
- proxy_request_headers = (
- litellm_params.get("proxy_server_request", {}).get("headers", {}) or {}
- )
+ proxy_request_headers = (litellm_params.get("proxy_server_request") or {}).get(
+ "headers"
+ ) or {}
return proxy_request_headers
diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py
index 3a83162fb2..ba840bc3d8 100644
--- a/litellm/litellm_core_utils/prompt_templates/factory.py
+++ b/litellm/litellm_core_utils/prompt_templates/factory.py
@@ -4582,6 +4582,11 @@ class BedrockConverseMessagesProcessor:
message=cast(ChatCompletionFileObject, element)
)
_parts.append(_part)
+ elif element["type"] == "document":
+ _part = BedrockConverseMessagesProcessor._process_document_message(
+ element
+ )
+ _parts.append(_part)
_cache_point_block = (
litellm.AmazonConverseConfig()._get_cache_point_block(
message_block=cast(
@@ -4864,6 +4869,44 @@ class BedrockConverseMessagesProcessor:
image_url=cast(str, file_id or file_data), format=format
)
+ @staticmethod
+ def _process_document_message(element: dict) -> BedrockContentBlock:
+ """Convert a document content block to a Bedrock DocumentBlock.
+
+ Handles the Anthropic-style document format:
+ {"type": "document", "source": {"type": "base64", "media_type": "application/pdf", "data": "..."}}
+ """
+ source = element["source"]
+ source_type = source.get("type")
+ if source_type != "base64":
+ raise ValueError(
+ f"Bedrock Converse only supports base64-encoded document sources, got '{source_type}'. "
+ "Please convert the document to base64 before sending to Bedrock."
+ )
+ media_type: str = source["media_type"]
+ data: str = source["data"]
+ doc_format = BedrockImageProcessor._validate_format(
+ mime_type=media_type, image_format=media_type.split("/")[1]
+ )
+
+ # Deterministic name using the same hashing pattern as _create_bedrock_block
+ HASH_SAMPLE_BYTES = 64 * 1024
+ normalized = "".join(data.split()).encode("utf-8")
+ sample = normalized[:HASH_SAMPLE_BYTES]
+ hasher = hashlib.sha256()
+ hasher.update(sample)
+ hasher.update(str(len(normalized)).encode("utf-8"))
+ content_hash = hasher.hexdigest()[:16]
+ document_name = f"Document_{content_hash}_{doc_format}"
+
+ return BedrockContentBlock(
+ document=BedrockDocumentBlock(
+ source=BedrockSourceBlock(bytes=data),
+ format=doc_format,
+ name=document_name,
+ )
+ )
+
@staticmethod
def add_thinking_blocks_to_assistant_content(
thinking_blocks: List[BedrockContentBlock],
@@ -4961,6 +5004,11 @@ def _bedrock_converse_messages_pt( # noqa: PLR0915
)
)
_parts.append(_part)
+ elif element["type"] == "document":
+ _part = BedrockConverseMessagesProcessor._process_document_message(
+ element
+ )
+ _parts.append(_part)
_cache_point_block = (
litellm.AmazonConverseConfig()._get_cache_point_block(
message_block=cast(
diff --git a/litellm/litellm_core_utils/secret_redaction.py b/litellm/litellm_core_utils/secret_redaction.py
new file mode 100644
index 0000000000..5c4e3e3dac
--- /dev/null
+++ b/litellm/litellm_core_utils/secret_redaction.py
@@ -0,0 +1,81 @@
+"""
+Credential/secret redaction utilities.
+
+This module owns the compiled regex and the public `redact_string` helper so
+that any part of the codebase (logging, exception mapping, etc.) can scrub
+secrets from strings without depending on the logging-configuration module.
+"""
+
+import re
+from typing import List
+
+_REDACTED = "REDACTED"
+
+
+def _build_secret_patterns() -> "re.Pattern[str]":
+ patterns: List[str] = [
+ # PEM private key / certificate blocks
+ r"-----BEGIN[A-Z \-]*PRIVATE KEY-----[\s\S]*?-----END[A-Z \-]*PRIVATE KEY-----",
+ # GCP OAuth2 access tokens (ya29.*)
+ r"\bya29\.[A-Za-z0-9_.~+/-]+",
+ # Credential %s formatting (space separator, no key= prefix)
+ r"(?:client_secret|azure_password|azure_username)\s+[^\s,'\"})\]{}>]+",
+ # AWS access key IDs
+ r"(?:AKIA|ASIA)[0-9A-Z]{16}",
+ # AWS secrets / session tokens / access key IDs (key=value)
+ r"(?:aws_secret_access_key|aws_session_token|aws_access_key_id)"
+ r"\s*[:=]\s*[A-Za-z0-9/+=]{20,}",
+ # Bearer tokens (OAuth, JWT, etc.)
+ r"Bearer\s+[A-Za-z0-9\-._~+/]{10,}=*",
+ # Basic auth headers
+ r"Basic\s+[A-Za-z0-9+/]{10,}={0,2}",
+ # OpenAI / Anthropic sk- prefixed keys
+ r"sk-[A-Za-z0-9\-_]{20,}",
+ # Generic api_key / api-key / apikey (handles 'key': 'value' dict repr)
+ r"(?:api[_-]?key)['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]{8,}",
+ # x-api-key / api-key header values (handles 'key': 'value' dict repr)
+ r"(?:x-api-key|api-key)['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]+",
+ # Anthropic internal header keys
+ r"x-ak-[A-Za-z0-9\-_]{20,}",
+ # Google API keys (bare key value)
+ r"AIza[0-9A-Za-z\-_]{35}",
+ # URL query-param key=VALUE (e.g. ?key=AIza... or &key=...) — catches the
+ # full "key=" fragment so the value is redacted regardless of format.
+ r"(?<=[?&])key=[^\s&'\"]{8,}",
+ # Password / secret params (handles key=value and 'key': 'value')
+ # Word boundary prevents O(n^2) backtracking on long word-char runs.
+ r"(?:^|(?<=\W))\w*(?:password|passwd|client_secret|secret_key|_secret)"
+ r"['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]+",
+ # Database connection string credentials (scheme://user:pass@host)
+ r"(?<=://)[^\s'\"]*:[^\s'\"@]+(?=@)",
+ # Databricks personal access tokens
+ r"dapi[0-9a-f]{32}",
+ # ── Key-name-based redaction ──
+ # Catches secrets inside dicts/config dumps by matching on the KEY name
+ # regardless of what the value looks like.
+ # e.g. 'master_key': 'any-value-here', "database_url": "postgres://..."
+ # private_key with PEM-aware value capture
+ r"""private_key['\"]?\s*[:=]\s*['\"]?(?:-----BEGIN[A-Z \-]*PRIVATE KEY-----[\s\S]*?-----END[A-Z \-]*PRIVATE KEY-----|[^\s,'\"})\]{}>]+)""",
+ r"(?:master_key|database_url|db_url|connection_string|"
+ r"signing_key|encryption_key|"
+ r"auth_token|access_token|refresh_token|"
+ r"slack_webhook_url|webhook_url|"
+ r"database_connection_string|"
+ r"huggingface_token|jwt_secret)"
+ r"""['\"]?\s*[:=]\s*['\"]?[^\s,'\"})\]{}>]+""",
+ # Raw JWTs (without Bearer prefix)
+ r"\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*",
+ # Azure SAS tokens in URLs
+ r"[?&]sig=[A-Za-z0-9%+/=]+",
+ # Full JSON service-account blobs (single-line and multi-line)
+ r'\{[^{}]*"type"\s*:\s*"service_account"[^{}]*(?:\{[^{}]*\}[^{}]*)*\}',
+ ]
+ return re.compile("|".join(patterns), re.IGNORECASE)
+
+
+_SECRET_RE = _build_secret_patterns()
+
+
+def redact_string(value: str) -> str:
+ """Scrub known secret/credential patterns from *value* and return the result."""
+ return _SECRET_RE.sub(_REDACTED, value)
diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py
index e281b17268..fa7faf3035 100644
--- a/litellm/litellm_core_utils/streaming_handler.py
+++ b/litellm/litellm_core_utils/streaming_handler.py
@@ -2244,7 +2244,7 @@ class CustomStreamWrapper:
asyncio.create_task(
self.logging_obj.async_failure_handler(e, traceback_exception)
)
- raise e
+ self._handle_stream_fallback_error(e)
except Exception as e:
traceback_exception = traceback.format_exc()
if self.logging_obj is not None:
diff --git a/litellm/litellm_core_utils/url_utils.py b/litellm/litellm_core_utils/url_utils.py
index a65d0892aa..38a78ee058 100644
--- a/litellm/litellm_core_utils/url_utils.py
+++ b/litellm/litellm_core_utils/url_utils.py
@@ -21,8 +21,8 @@ Admins can opt out via two ``litellm`` globals (wired from proxy config):
import socket
from ipaddress import ip_address, ip_network
-from typing import Any, List, Set, Tuple
-from urllib.parse import urlparse, urlunparse
+from typing import Any, List, Optional, Set, Tuple
+from urllib.parse import quote, urlparse, urlunparse
import httpx
@@ -46,6 +46,46 @@ class SSRFError(ValueError):
pass
+def encode_url_path_segment(value: Any, *, field_name: str = "path parameter") -> str:
+ """Percent-encode one user-controlled URL path segment.
+
+ ``urllib.parse.quote(..., safe="")`` intentionally leaves RFC 3986
+ unreserved characters such as ``.`` unescaped, so reject standalone dot
+ segments before they can be appended to an upstream URL and normalized by
+ the HTTP client.
+ """
+ if value is None:
+ raise ValueError(f"{field_name} is required")
+
+ value_str = str(value)
+ if value_str == "":
+ raise ValueError(f"{field_name} is required")
+ if value_str in {".", ".."}:
+ raise ValueError(f"{field_name} cannot be a dot path segment")
+
+ return quote(value_str, safe="")
+
+
+def encode_url_path_segments(value: Any, *, field_name: str = "path") -> str:
+ """Percent-encode a user-controlled URL path made of multiple segments.
+
+ Empty segments are rejected, so leading, trailing, or consecutive slashes
+ fail closed instead of being normalized by the HTTP client.
+ """
+ if value is None:
+ raise ValueError(f"{field_name} is required")
+
+ value_str = str(value)
+ if value_str == "":
+ raise ValueError(f"{field_name} is required")
+
+ encoded_segments = []
+ for segment in value_str.split("/"):
+ encoded_segments.append(encode_url_path_segment(segment, field_name=field_name))
+
+ return "/".join(encoded_segments)
+
+
def _is_blocked_ip(addr: str) -> bool:
"""Return True for any IP not safe to reach from a user-supplied URL.
@@ -70,6 +110,85 @@ def _normalize_host(host: str) -> str:
return host.lower().rstrip(".")
+def _default_port_for_scheme(scheme: str) -> int:
+ return 443 if scheme == "https" else 80
+
+
+def _parse_url_destination_allowlist_entry(
+ entry: str,
+) -> Optional[Tuple[str, Optional[str], Optional[int]]]:
+ """Parse an admin allowlist entry into host, optional scheme, optional port.
+
+ Entries may be bare hosts (``api.example.com``), host+port
+ (``api.example.com:8443``), or origins (``https://api.example.com``).
+ URL paths are intentionally ignored so admins can paste an api_base value.
+ """
+ entry = entry.strip()
+ if not entry:
+ return None
+
+ has_scheme = "://" in entry
+ parsed = urlparse(entry if has_scheme else f"//{entry}")
+ if has_scheme and parsed.scheme not in _ALLOWED_SCHEMES:
+ return None
+ if parsed.username is not None or parsed.password is not None:
+ return None
+ if not parsed.hostname:
+ return None
+
+ try:
+ port = parsed.port
+ except ValueError:
+ return None
+
+ scheme: Optional[str] = parsed.scheme if has_scheme else None
+ if scheme is not None and port is None:
+ port = _default_port_for_scheme(scheme)
+
+ return _normalize_host(parsed.hostname), scheme, port
+
+
+def is_url_destination_allowed_by_host(url: str, allowed_hosts: List[str]) -> bool:
+ """Return True when a credential-bearing provider URL is admin-allowlisted.
+
+ This does not fetch, resolve, or rewrite URLs. It only answers whether the
+ destination origin is explicitly trusted by configuration. Use ``safe_get``
+ for user-controlled content fetches that require SSRF protection.
+ """
+ parsed = urlparse(url)
+ if parsed.scheme not in _ALLOWED_SCHEMES:
+ return False
+ if parsed.username is not None or parsed.password is not None:
+ return False
+ if not parsed.hostname:
+ return False
+
+ try:
+ effective_port = parsed.port or _default_port_for_scheme(parsed.scheme)
+ except ValueError:
+ return False
+
+ normalized_host = _normalize_host(parsed.hostname)
+ configured_entries = (
+ [allowed_hosts] if isinstance(allowed_hosts, str) else allowed_hosts
+ )
+ for entry in configured_entries or []:
+ if not isinstance(entry, str):
+ continue
+ parsed_entry = _parse_url_destination_allowlist_entry(entry)
+ if parsed_entry is None:
+ continue
+ allowed_host, allowed_scheme, allowed_port = parsed_entry
+ if allowed_host != normalized_host:
+ continue
+ if allowed_scheme is not None and allowed_scheme != parsed.scheme:
+ continue
+ if allowed_port is not None and allowed_port != effective_port:
+ continue
+ return True
+ return False
+
+
def _format_host_header(hostname: str, port: int, default_port: int) -> str:
"""Build an RFC 7230 Host header value, bracketing IPv6 literals."""
bracketed = f"[{hostname}]" if ":" in hostname else hostname
@@ -145,7 +264,7 @@ def validate_url(url: str) -> Tuple[str, str]:
raise SSRFError("URL has no hostname")
port = parsed.port
- default_port = 443 if parsed.scheme == "https" else 80
+ default_port = _default_port_for_scheme(parsed.scheme)
effective_port = port if port is not None else default_port
host_header = _format_host_header(hostname, effective_port, default_port)
@@ -199,13 +318,54 @@ def validate_url(url: str) -> Tuple[str, str]:
return rewritten, host_header
+def assert_same_origin(candidate_url: str, expected_url: str) -> None:
+ """Verify ``candidate_url`` shares scheme, host, and port with ``expected_url``.
+
+ Use when an upstream API returns a URL meant for follow-up requests
+ (e.g. an async-job polling URL that will be hit with the operator's
+ API key in the headers). The upstream is trusted because the operator
+ configured ``api_base``, but the URL it hands back must actually point
+ back at the same origin or we'd be blindly forwarding credentials
+ wherever the upstream told us to.
+
+ Hostnames are compared case-insensitively. Default ports are made
+ explicit (HTTP→80, HTTPS→443) so ``https://api.example.com:443/...``
+ and ``https://api.example.com/...`` are treated as the same origin.
+
+ Error messages identify *which* component mismatched but never echo
+ the operator's ``expected`` host or the candidate's hostname back to
+ the caller — in the SSRF threat model the caller is the attacker,
+ and reflecting host info would be a secondary leak of operator
+ infrastructure details.
+ """
+ candidate = urlparse(candidate_url)
+ expected = urlparse(expected_url)
+
+ if candidate.scheme not in _ALLOWED_SCHEMES:
+ raise SSRFError("URL scheme is not allowed")
+
+ if candidate.scheme != expected.scheme:
+ raise SSRFError("Origin mismatch on scheme")
+
+ candidate_host = _normalize_host(candidate.hostname or "")
+ expected_host = _normalize_host(expected.hostname or "")
+ if not candidate_host or candidate_host != expected_host:
+ raise SSRFError("Origin mismatch on host")
+
+ default_port = 443 if candidate.scheme == "https" else 80
+ candidate_port = candidate.port if candidate.port is not None else default_port
+ expected_port = expected.port if expected.port is not None else default_port
+ if candidate_port != expected_port:
+ raise SSRFError("Origin mismatch on port")
+
+
_MAX_REDIRECTS = 10
def _extract_redirect_url(response: Any, request_url: str) -> str:
"""Extract and resolve the redirect target from a response's Location header."""
location = response.headers.get("location")
- if not location:
+ if not isinstance(location, str) or not location:
raise SSRFError("Redirect response has no Location header")
# Resolve relative URLs against the request URL
return str(httpx.URL(request_url).join(location))
diff --git a/litellm/llms/anthropic/batches/transformation.py b/litellm/llms/anthropic/batches/transformation.py
index 3f03c744ef..fd67a7fbaf 100644
--- a/litellm/llms/anthropic/batches/transformation.py
+++ b/litellm/llms/anthropic/batches/transformation.py
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Union, cas
import httpx
from httpx import Headers, Response
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.batches.transformation import BaseBatchesConfig
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.types.llms.openai import AllMessageValues, CreateBatchRequest
@@ -122,7 +123,8 @@ class AnthropicBatchesConfig(BaseBatchesConfig):
Complete URL for Anthropic batch retrieval: {api_base}/v1/messages/batches/{batch_id}
"""
api_base = api_base or self.anthropic_model_info.get_api_base(api_base)
- return f"{api_base.rstrip('/')}/v1/messages/batches/{batch_id}"
+ encoded_batch_id = encode_url_path_segment(batch_id, field_name="batch_id")
+ return f"{api_base.rstrip('/')}/v1/messages/batches/{encoded_batch_id}"
def transform_retrieve_batch_request(
self,
diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py
index 61ddf801a2..345558a69f 100644
--- a/litellm/llms/anthropic/chat/transformation.py
+++ b/litellm/llms/anthropic/chat/transformation.py
@@ -1,18 +1,31 @@
import json
import re
import time
-from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Dict,
+ List,
+ NoReturn,
+ Optional,
+ Tuple,
+ Union,
+ cast,
+)
import httpx
import litellm
from litellm.constants import (
+ ANTHROPIC_MIN_THINKING_BUDGET_TOKENS,
ANTHROPIC_WEB_SEARCH_TOOL_MAX_USES,
DEFAULT_ANTHROPIC_CHAT_MAX_TOKENS,
DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET,
DEFAULT_REASONING_EFFORT_LOW_THINKING_BUDGET,
+ DEFAULT_REASONING_EFFORT_MAX_THINKING_BUDGET,
DEFAULT_REASONING_EFFORT_MEDIUM_THINKING_BUDGET,
DEFAULT_REASONING_EFFORT_MINIMAL_THINKING_BUDGET,
+ DEFAULT_REASONING_EFFORT_XHIGH_THINKING_BUDGET,
RESPONSE_FORMAT_TOOL_NAME,
)
from litellm.litellm_core_utils.core_helpers import map_finish_reason
@@ -92,6 +105,22 @@ else:
LoggingClass = Any
+REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT: Dict[str, str] = {
+ "low": "low",
+ "minimal": "low",
+ "medium": "medium",
+ "high": "high",
+ "xhigh": "xhigh",
+ "max": "max",
+}
+
+DROP_UNSUPPORTED_OUTPUT_CONFIG_WARNING = (
+ "Dropping unsupported `output_config` for model=%s "
+ "(drop_params=True). Effort is only supported on Opus 4.5+, "
+ "Sonnet 4.6+, and Mythos Preview."
+)
+
+
class AnthropicConfig(AnthropicModelInfo, BaseConfig):
"""
Reference: https://docs.anthropic.com/claude/reference/messages_post
@@ -202,17 +231,96 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
def _supports_effort_level(model: str, level: str) -> bool:
"""Check ``supports_{level}_reasoning_effort`` in the model map.
- Mirrors the pattern used in ``openai/chat/gpt_5_transformation.py`` so
- that adding support for a new effort level is a pure model-map change.
+ Strips bedrock/vertex prefixes so a provider-routed Claude still
+ resolves to the Anthropic model-map entry.
"""
+ key = f"supports_{level}_reasoning_effort"
try:
- return _supports_factory(
+ if _supports_factory(
model=model,
custom_llm_provider="anthropic",
- key=f"supports_{level}_reasoning_effort",
- )
+ key=key,
+ ):
+ return True
except Exception:
- return False
+ pass
+ candidates = [model]
+ for prefix in (
+ "bedrock/converse/",
+ "bedrock/invoke/",
+ "bedrock/",
+ "vertex_ai/",
+ ):
+ if model.startswith(prefix):
+ candidates.append(model[len(prefix) :])
+ try:
+ from litellm.llms.bedrock.common_utils import BedrockModelInfo
+
+ base = BedrockModelInfo.get_base_model(model)
+ if base:
+ candidates.append(base)
+ candidates.append(f"bedrock/{base}")
+ except Exception:
+ pass
+ try:
+ import litellm
+
+ for cand in candidates:
+ if cand in litellm.model_cost and (
+ litellm.model_cost[cand].get(key) is True
+ ):
+ return True
+ except Exception:
+ pass
+ return False
+
+ @staticmethod
+ def _validate_effort_for_model(model: str, effort: Optional[str]) -> Optional[str]:
+ """Return ``None`` if ``effort`` is allowed on ``model``, else an error message."""
+ if effort == "max" and not (
+ AnthropicConfig._is_claude_4_6_model(model)
+ or AnthropicConfig._is_claude_4_7_model(model)
+ or AnthropicConfig._supports_effort_level(model, "max")
+ ):
+ return f"effort='max' is not supported by this model. Got model: {model}"
+ if effort == "xhigh" and not AnthropicConfig._supports_effort_level(
+ model, "xhigh"
+ ):
+ return f"effort='xhigh' is not supported by this model. Got model: {model}"
+ return None
+
+ @staticmethod
+ def _model_supports_effort_param(model: str) -> bool:
+ """Whether the model accepts ``output_config.effort`` at all."""
+ return any(
+ AnthropicConfig._supports_effort_level(model, level)
+ for level in ("low", "minimal", "medium", "high", "xhigh", "max")
+ )
+
+ @staticmethod
+ def _raise_invalid_reasoning_effort(
+ model: str, value: Any, llm_provider: str
+ ) -> NoReturn:
+ """Raise a ``BadRequestError`` for an unrecognised ``reasoning_effort``.
+
+ Args:
+ model: The model id the request was routed to (surfaced in the error).
+ value: The offending ``reasoning_effort`` value supplied by the caller.
+ llm_provider: Provider tag for the raised exception (``"anthropic"``,
+ ``"bedrock_converse"``, ``"databricks"``, ...).
+
+ Raises:
+ litellm.exceptions.BadRequestError: Always.
+ """
+ raise litellm.exceptions.BadRequestError(
+ message=(
+ f"Invalid reasoning_effort: {value!r}. "
+ f"Must be one of: 'minimal', 'low', 'medium', "
+ f"'high', 'xhigh', 'max', 'none'"
+ ),
+ model=model,
+ llm_provider=llm_provider,
+ )
def get_supported_openai_params(self, model: str):
params = [
@@ -794,12 +902,11 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
def _map_reasoning_effort(
reasoning_effort: Optional[Union[REASONING_EFFORT, str]],
model: str,
+ llm_provider: str = "anthropic",
) -> Optional[AnthropicThinkingParam]:
if reasoning_effort is None or reasoning_effort == "none":
return None
- if AnthropicConfig._is_claude_4_6_model(
- model
- ) or AnthropicConfig._is_claude_4_7_model(model):
+ if AnthropicConfig._is_adaptive_thinking_model(model):
return AnthropicThinkingParam(
type="adaptive",
)
@@ -818,13 +925,34 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
type="enabled",
budget_tokens=DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET,
)
+ elif reasoning_effort == "xhigh":
+ return AnthropicThinkingParam(
+ type="enabled",
+ budget_tokens=DEFAULT_REASONING_EFFORT_XHIGH_THINKING_BUDGET,
+ )
+ elif reasoning_effort == "max":
+ return AnthropicThinkingParam(
+ type="enabled",
+ budget_tokens=DEFAULT_REASONING_EFFORT_MAX_THINKING_BUDGET,
+ )
elif reasoning_effort == "minimal":
return AnthropicThinkingParam(
type="enabled",
- budget_tokens=DEFAULT_REASONING_EFFORT_MINIMAL_THINKING_BUDGET,
+ budget_tokens=max(
+ DEFAULT_REASONING_EFFORT_MINIMAL_THINKING_BUDGET,
+ ANTHROPIC_MIN_THINKING_BUDGET_TOKENS,
+ ),
)
else:
- raise ValueError(f"Unmapped reasoning effort: {reasoning_effort}")
+ raise litellm.exceptions.BadRequestError(
+ message=(
+ f"Unmapped reasoning effort: {reasoning_effort!r}. "
+ f"Must be one of: 'minimal', 'low', 'medium', 'high', "
+ f"'xhigh', 'max', 'none'."
+ ),
+ model=model,
+ llm_provider=llm_provider,
+ )
def _extract_json_schema_from_response_format(
self, value: Optional[dict]
@@ -1088,24 +1216,27 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
elif param == "thinking":
optional_params["thinking"] = value
elif param == "reasoning_effort" and isinstance(value, str):
- optional_params["thinking"] = AnthropicConfig._map_reasoning_effort(
- reasoning_effort=value, model=model
+ mapped_thinking = AnthropicConfig._map_reasoning_effort(
+ reasoning_effort=value,
+ model=model,
+ llm_provider=self.custom_llm_provider or "anthropic",
)
- # For Claude 4.6+ models, effort is controlled via output_config,
- # not thinking budget_tokens. Map reasoning_effort to output_config.
- if AnthropicConfig._is_claude_4_6_model(
- model
- ) or AnthropicConfig._is_claude_4_7_model(model):
- effort_map = {
- "low": "low",
- "minimal": "low",
- "medium": "medium",
- "high": "high",
- "xhigh": "xhigh",
- "max": "max",
- }
- mapped_effort = effort_map.get(value, value)
- optional_params["output_config"] = {"effort": mapped_effort}
+ if mapped_thinking is None:
+ optional_params.pop("thinking", None)
+ optional_params.pop("output_config", None)
+ else:
+ optional_params["thinking"] = mapped_thinking
+ if AnthropicConfig._is_adaptive_thinking_model(model):
+ mapped_effort = REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT.get(
+ value
+ )
+ if mapped_effort is None:
+ AnthropicConfig._raise_invalid_reasoning_effort(
+ model=model,
+ value=value,
+ llm_provider=self.custom_llm_provider or "anthropic",
+ )
+ optional_params["output_config"] = {"effort": mapped_effort}
elif param == "web_search_options" and isinstance(value, dict):
hosted_web_search_tool = self.map_web_search_tool(
cast(OpenAIWebSearchOptions, value)
@@ -1527,29 +1658,31 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
output_config = optional_params.get("output_config")
if not output_config or not isinstance(output_config, dict):
return
+ if litellm.drop_params is True and not self._model_supports_effort_param(model):
+ litellm.verbose_logger.warning(
+ DROP_UNSUPPORTED_OUTPUT_CONFIG_WARNING,
+ model,
+ )
+ optional_params.pop("output_config", None)
+ data.pop("output_config", None)
+ return
effort = output_config.get("effort")
valid_efforts = ["high", "medium", "low", "xhigh", "max"]
- if effort and effort not in valid_efforts:
- raise ValueError(
- f"Invalid effort value: {effort}. Must be one of: "
- f"'high', 'medium', 'low', 'xhigh', 'max'"
+ if effort is not None and effort not in valid_efforts:
+ raise litellm.exceptions.BadRequestError(
+ message=(
+ f"Invalid effort value: {effort!r}. Must be one of: "
+ f"'high', 'medium', 'low', 'xhigh', 'max'"
+ ),
+ model=model,
+ llm_provider=self.custom_llm_provider or "anthropic",
)
- # ``max`` is for Opus 4.6+ output effort (not Sonnet 4.6, not Opus 4.5).
- # Accept known Opus 4.6/4.7 id patterns and/or ``supports_max_reasoning_effort``
- # in the model map (same pattern as ``xhigh`` below).
- if effort == "max" and not (
- self._is_opus_4_6_model(model)
- or self._is_opus_4_7_model(model)
- or self._supports_effort_level(model, "max")
- ):
- raise ValueError(
- f"effort='max' is not supported by this model. Got model: {model}"
- )
- # ``xhigh`` is data-driven via ``supports_xhigh_reasoning_effort`` so
- # enabling it for a new model is a pure model-map change.
- if effort == "xhigh" and not self._supports_effort_level(model, "xhigh"):
- raise ValueError(
- f"effort='xhigh' is not supported by this model. Got model: {model}"
+ gate_error = self._validate_effort_for_model(model, effort)
+ if gate_error is not None:
+ raise litellm.exceptions.BadRequestError(
+ message=gate_error,
+ model=model,
+ llm_provider=self.custom_llm_provider or "anthropic",
)
data["output_config"] = output_config
diff --git a/litellm/llms/anthropic/common_utils.py b/litellm/llms/anthropic/common_utils.py
index b095d40156..869a7c5fbc 100644
--- a/litellm/llms/anthropic/common_utils.py
+++ b/litellm/llms/anthropic/common_utils.py
@@ -273,7 +273,18 @@ class AnthropicModelInfo(BaseLLMModelInfo):
@staticmethod
def _is_adaptive_thinking_model(model: str) -> bool:
- """Claude 4.6+ models use adaptive thinking with output_config effort."""
+ """Claude 4.6+ models use adaptive thinking with ``output_config.effort``."""
+ from litellm.utils import _supports_factory
+
+ try:
+ if _supports_factory(
+ model=model,
+ custom_llm_provider=None,
+ key="supports_adaptive_thinking",
+ ):
+ return True
+ except Exception:
+ pass
return AnthropicModelInfo._is_claude_4_6_model(
model
) or AnthropicModelInfo._is_claude_4_7_model(model)
diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py
index 829ce14d69..8ed6126d2e 100644
--- a/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py
+++ b/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py
@@ -27,6 +27,16 @@ from litellm.utils import get_model_info
if TYPE_CHECKING:
pass
+
+# Anthropic-only fields that the translator above already maps into the
+# OpenAI-format completion_kwargs (output_config → reasoning_effort /
+# response_format, etc.). They must be filtered out of the raw
+# extra_kwargs re-merge below or non-Anthropic backends reject the call
+# with 400 "Extra inputs are not permitted". Add new entries here when
+# extending AnthropicMessagesRequestOptionalParams with another Anthropic-
+# specific key.
+ANTHROPIC_ONLY_REQUEST_KEYS: frozenset[str] = frozenset({"output_config"})
+
########################################################
# init adapter
ANTHROPIC_ADAPTER = AnthropicAdapter()
@@ -202,8 +212,12 @@ class LiteLLMMessagesToCompletionTransformationHandler:
request_data["output_format"] = output_format
# Extract output_config from extra_kwargs so the translator can use it
- # (e.g. output_config.effort for adaptive thinking → reasoning_effort)
- extra_kwargs = extra_kwargs or {}
+ # (e.g. output_config.effort for adaptive thinking → reasoning_effort,
+ # output_config.format → response_format for structured outputs).
+ # Use explicit None check rather than `or {}` so an explicit empty dict
+ # caller-passed argument is preserved (matters for tests that drive
+ # the fallback inference path).
+ extra_kwargs = extra_kwargs if extra_kwargs is not None else {}
if "output_config" in extra_kwargs:
request_data["output_config"] = extra_kwargs["output_config"]
@@ -225,8 +239,23 @@ class LiteLLMMessagesToCompletionTransformationHandler:
"include_usage": True,
}
- excluded_keys = {"anthropic_messages"}
- extra_kwargs = extra_kwargs or {}
+ # Keys that must NOT be forwarded as raw extras into the OpenAI-format
+ # ``completion_kwargs`` after translation. The translator above has
+ # already consumed the meaningful parts of these inputs (e.g.
+ # ``output_config.format`` → ``response_format``, ``output_config.effort``
+ # → ``reasoning_effort`` for non-Claude targets). Re-adding the raw
+ # Anthropic-shaped key here causes 400 "Extra inputs are not permitted"
+ # on non-Anthropic backends (Azure OpenAI, Fireworks, Bedrock Nova,
+ # etc.) and is silently lossy on Anthropic-family targets, which would
+ # see the translated key ``response_format`` AND a duplicate, conflicting
+ # ``output_config``.
+ #
+ # Maintainability: when adding a new Anthropic-only request param to
+ # ``AnthropicMessagesRequestOptionalParams``, also extend
+ # ``ANTHROPIC_ONLY_REQUEST_KEYS`` here so it doesn't silently leak.
+ excluded_keys = ANTHROPIC_ONLY_REQUEST_KEYS | {"anthropic_messages"}
+ # NOTE: extra_kwargs was already coerced from None to {} at the top of
+ # this method (line ~220). It is guaranteed to be a dict here.
for key, value in extra_kwargs.items():
if (
key == "litellm_logging_obj"
diff --git a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py
index 0879788919..fe8e694efe 100644
--- a/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py
+++ b/litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py
@@ -667,7 +667,7 @@ class LiteLLMAnthropicMessagesAdapter:
@staticmethod
def translate_anthropic_thinking_to_reasoning_effort(
- thinking: Dict[str, Any]
+ thinking: Dict[str, Any],
) -> Optional[str]:
"""
Translate Anthropic's thinking parameter to OpenAI's reasoning_effort.
@@ -1084,10 +1084,23 @@ class LiteLLMAnthropicMessagesAdapter:
anthropic_message_request: AnthropicMessagesRequest,
new_kwargs: ChatCompletionRequest,
) -> None:
- """Translate output_format to response_format when applicable."""
- if "output_format" not in anthropic_message_request:
- return
- output_format = anthropic_message_request["output_format"]
+ """Translate Anthropic structured-output config to OpenAI ``response_format``.
+
+ Accepts either the legacy top-level ``output_format`` field OR the
+ newer ``output_config.format`` (sub-key on ``output_config``) so that
+ both shapes flow through to non-Anthropic backends as
+ ``response_format``. Without the ``output_config.format`` branch,
+ callers using the new Anthropic Structured Outputs API would have
+ their schema silently dropped on the adapter path — only the legacy
+ top-level ``output_format`` was being mapped.
+
+ ``output_format`` takes precedence when both are provided.
+ """
+ output_format: Any = anthropic_message_request.get("output_format")
+ if not output_format:
+ output_config = anthropic_message_request.get("output_config")
+ if isinstance(output_config, dict):
+ output_format = output_config.get("format")
if not output_format:
return
response_format = self.translate_anthropic_output_format_to_openai(
diff --git a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py
index 7617ad52ab..35495d5961 100644
--- a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py
+++ b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py
@@ -47,6 +47,7 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig):
"inference_geo",
"speed",
"output_config",
+ "reasoning_effort",
# TODO: Add Anthropic `metadata` support
# "metadata",
]
@@ -166,6 +167,62 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig):
return headers, api_base
+ @staticmethod
+ def _translate_reasoning_effort_to_anthropic(
+ model: str, optional_params: Dict
+ ) -> None:
+ """Map OpenAI-style ``reasoning_effort`` to native Anthropic params.
+
+ Caller-supplied ``thinking`` / ``output_config`` win over the alias.
+ ``effort='none'`` clears both. Invalid efforts raise a 400.
+ """
+ from litellm.exceptions import BadRequestError as _BadRequestError
+ from litellm.llms.anthropic.chat.transformation import (
+ REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT,
+ AnthropicConfig,
+ )
+
+ reasoning_effort = optional_params.pop("reasoning_effort", None)
+ if not isinstance(reasoning_effort, str):
+ return
+
+ try:
+ mapped_thinking = AnthropicConfig._map_reasoning_effort(
+ reasoning_effort=reasoning_effort, model=model
+ )
+ except _BadRequestError as e:
+ raise AnthropicError(message=str(e.message), status_code=400)
+
+ if mapped_thinking is None:
+ optional_params.pop("thinking", None)
+ optional_params.pop("output_config", None)
+ return
+
+ optional_params.setdefault("thinking", mapped_thinking)
+ if AnthropicModelInfo._is_adaptive_thinking_model(model):
+ mapped_effort = REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT.get(
+ reasoning_effort
+ )
+ if mapped_effort is None:
+ raise AnthropicError(
+ message=(
+ f"Invalid reasoning_effort: {reasoning_effort!r}. "
+ f"Must be one of: 'minimal', 'low', 'medium', 'high', "
+ f"'xhigh', 'max', 'none'"
+ ),
+ status_code=400,
+ )
+ gate_error = AnthropicConfig._validate_effort_for_model(
+ model, mapped_effort
+ )
+ if gate_error is not None:
+ raise AnthropicError(message=gate_error, status_code=400)
+ existing_output_config = optional_params.get("output_config")
+ if not isinstance(existing_output_config, dict):
+ existing_output_config = {}
+ existing_output_config.setdefault("effort", mapped_effort)
+ optional_params["output_config"] = existing_output_config
+
@staticmethod
def _translate_legacy_thinking_for_adaptive_model(
model: str, optional_params: Dict
@@ -217,6 +274,11 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig):
status_code=400,
)
+ self._translate_reasoning_effort_to_anthropic(
+ model=model,
+ optional_params=anthropic_messages_optional_request_params,
+ )
+
self._translate_legacy_thinking_for_adaptive_model(
model=model,
optional_params=anthropic_messages_optional_request_params,
diff --git a/litellm/llms/anthropic/files/handler.py b/litellm/llms/anthropic/files/handler.py
index c56799f30c..56296df94a 100644
--- a/litellm/llms/anthropic/files/handler.py
+++ b/litellm/llms/anthropic/files/handler.py
@@ -9,6 +9,7 @@ import litellm
from litellm._logging import verbose_logger
from litellm._uuid import uuid
from litellm.litellm_core_utils.litellm_logging import Logging
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.custom_httpx.http_handler import get_async_httpx_client
from litellm.types.llms.openai import (
FileContentRequest,
@@ -89,7 +90,10 @@ class AnthropicFilesHandler:
raise ValueError("Missing Anthropic API Key")
# Construct the Anthropic batch results URL
- results_url = f"{api_base.rstrip('/')}/v1/messages/batches/{batch_id}/results"
+ encoded_batch_id = encode_url_path_segment(batch_id, field_name="batch_id")
+ results_url = (
+ f"{api_base.rstrip('/')}/v1/messages/batches/{encoded_batch_id}/results"
+ )
# Prepare headers
headers = {
diff --git a/litellm/llms/anthropic/files/transformation.py b/litellm/llms/anthropic/files/transformation.py
index aeaab4e57b..ea9bf00f50 100644
--- a/litellm/llms/anthropic/files/transformation.py
+++ b/litellm/llms/anthropic/files/transformation.py
@@ -19,6 +19,7 @@ from typing import Any, Dict, List, Optional, Union, cast
import httpx
from openai.types.file_deleted import FileDeleted
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.prompt_templates.common_utils import extract_file_data
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.llms.base_llm.files.transformation import (
@@ -185,7 +186,8 @@ class AnthropicFilesConfig(BaseFilesConfig):
AnthropicModelInfo.get_api_base(litellm_params.get("api_base"))
or ANTHROPIC_FILES_API_BASE
)
- return f"{api_base.rstrip('/')}/v1/files/{file_id}", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base.rstrip('/')}/v1/files/{encoded_file_id}", {}
def transform_retrieve_file_response(
self,
@@ -206,7 +208,8 @@ class AnthropicFilesConfig(BaseFilesConfig):
AnthropicModelInfo.get_api_base(litellm_params.get("api_base"))
or ANTHROPIC_FILES_API_BASE
)
- return f"{api_base.rstrip('/')}/v1/files/{file_id}", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base.rstrip('/')}/v1/files/{encoded_file_id}", {}
def transform_delete_file_response(
self,
@@ -268,7 +271,8 @@ class AnthropicFilesConfig(BaseFilesConfig):
AnthropicModelInfo.get_api_base(litellm_params.get("api_base"))
or ANTHROPIC_FILES_API_BASE
)
- return f"{api_base.rstrip('/')}/v1/files/{file_id}/content", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base.rstrip('/')}/v1/files/{encoded_file_id}/content", {}
def transform_file_content_response(
self,
diff --git a/litellm/llms/anthropic/skills/transformation.py b/litellm/llms/anthropic/skills/transformation.py
index a992d84d45..4ea768b02a 100644
--- a/litellm/llms/anthropic/skills/transformation.py
+++ b/litellm/llms/anthropic/skills/transformation.py
@@ -7,6 +7,7 @@ from typing import Any, Dict, Optional, Tuple
import httpx
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.skills.transformation import (
BaseSkillsAPIConfig,
LiteLLMLoggingObj,
@@ -81,7 +82,8 @@ class AnthropicSkillsConfig(BaseSkillsAPIConfig):
api_base = AnthropicModelInfo.get_api_base()
if skill_id:
- return f"{api_base}/v1/skills/{skill_id}"
+ encoded_skill_id = encode_url_path_segment(skill_id, field_name="skill_id")
+ return f"{api_base}/v1/skills/{encoded_skill_id}"
return f"{api_base}/v1/{endpoint}"
def transform_create_skill_request(
diff --git a/litellm/llms/azure/azure.py b/litellm/llms/azure/azure.py
index 61cfd54b56..9291269d15 100644
--- a/litellm/llms/azure/azure.py
+++ b/litellm/llms/azure/azure.py
@@ -16,6 +16,7 @@ import litellm
from litellm.constants import AZURE_OPERATION_POLLING_TIMEOUT, DEFAULT_MAX_RETRIES
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
from litellm.litellm_core_utils.logging_utils import track_llm_api_timing
+from litellm.litellm_core_utils.url_utils import SSRFError, assert_same_origin
from litellm.llms.custom_httpx.http_handler import (
AsyncHTTPHandler,
HTTPHandler,
@@ -43,6 +44,7 @@ from .common_utils import (
select_azure_base_url_or_endpoint,
)
from .image_generation import get_azure_image_generation_config
+from .image_generation.http_utils import azure_deployment_image_generation_json_body
class AzureOpenAIAssistantsAPIConfig:
@@ -792,6 +794,7 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
client=client,
litellm_params=litellm_params,
api_base=api_base,
+ api_version=api_version,
)
azure_client = self.get_azure_openai_client(
api_version=api_version,
@@ -898,6 +901,17 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
operation_location_url = response.headers["operation-location"]
else:
raise AzureOpenAIError(status_code=500, message=response.text)
+ # Reject polling URLs that don't share an origin with ``api_base``.
+ # Without this an upstream-controlled or attacker-controlled
+ # value would receive the operator's Azure API key in the
+ # request headers below. VERIA-51.
+ try:
+ assert_same_origin(operation_location_url, api_base)
+ except SSRFError as ssrf_err:
+ raise AzureOpenAIError(
+ status_code=502,
+ message=f"Rejected polling URL: {ssrf_err}",
+ )
response = await async_handler.get(
url=operation_location_url,
headers=headers,
@@ -908,8 +922,13 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
timeout_secs: int = AZURE_OPERATION_POLLING_TIMEOUT
start_time = time.time()
if "status" not in response.json():
- raise Exception(
- "Expected 'status' in response. Got={}".format(response.json())
+ # Don't reflect the raw response body — when the polling
+ # URL points at an internal JSON API (cloud metadata
+ # service etc.) reflecting it here turns Blind SSRF into
+ # Full-Read SSRF. VERIA-51.
+ raise AzureOpenAIError(
+ status_code=502,
+ message="Polling response missing 'status' field",
)
while response.json()["status"] not in ["succeeded", "failed"]:
if time.time() - start_time > timeout_secs:
@@ -948,9 +967,10 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
content=json.dumps(result).encode("utf-8"),
request=httpx.Request(method="POST", url="https://api.openai.com/v1"),
)
+ request_json = azure_deployment_image_generation_json_body(api_base, data)
return await async_handler.post(
url=api_base,
- json=data,
+ json=request_json,
headers=headers,
)
@@ -1009,6 +1029,13 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
operation_location_url = response.headers["operation-location"]
else:
raise AzureOpenAIError(status_code=500, message=response.text)
+ try:
+ assert_same_origin(operation_location_url, api_base)
+ except SSRFError as ssrf_err:
+ raise AzureOpenAIError(
+ status_code=502,
+ message=f"Rejected polling URL: {ssrf_err}",
+ )
response = sync_handler.get(
url=operation_location_url,
headers=headers,
@@ -1019,8 +1046,9 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
timeout_secs: int = AZURE_OPERATION_POLLING_TIMEOUT
start_time = time.time()
if "status" not in response.json():
- raise Exception(
- "Expected 'status' in response. Got={}".format(response.json())
+ raise AzureOpenAIError(
+ status_code=502,
+ message="Polling response missing 'status' field",
)
while response.json()["status"] not in ["succeeded", "failed"]:
if time.time() - start_time > timeout_secs:
@@ -1059,9 +1087,10 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
content=json.dumps(result).encode("utf-8"),
request=httpx.Request(method="POST", url="https://api.openai.com/v1"),
)
+ request_json = azure_deployment_image_generation_json_body(api_base, data)
return sync_handler.post(
url=api_base,
- json=data,
+ json=request_json,
headers=headers,
)
diff --git a/litellm/llms/azure/cost_calculation.py b/litellm/llms/azure/cost_calculation.py
index 5b411095ea..2a20c55a6c 100644
--- a/litellm/llms/azure/cost_calculation.py
+++ b/litellm/llms/azure/cost_calculation.py
@@ -12,7 +12,10 @@ from litellm.utils import get_model_info
def cost_per_token(
- model: str, usage: Usage, response_time_ms: Optional[float] = 0.0
+ model: str,
+ usage: Usage,
+ response_time_ms: Optional[float] = 0.0,
+ service_tier: Optional[str] = None,
) -> Tuple[float, float]:
"""
Calculates the cost per token for a given model, prompt tokens, and completion tokens.
@@ -47,4 +50,5 @@ def cost_per_token(
model=model,
usage=usage,
custom_llm_provider="azure",
+ service_tier=service_tier,
)
diff --git a/litellm/llms/azure/image_edit/transformation.py b/litellm/llms/azure/image_edit/transformation.py
index dffa1c9eea..0b6ecfb076 100644
--- a/litellm/llms/azure/image_edit/transformation.py
+++ b/litellm/llms/azure/image_edit/transformation.py
@@ -9,6 +9,19 @@ from litellm.utils import _add_path_to_api_base
class AzureImageEditConfig(OpenAIImageEditConfig):
+ @staticmethod
+ def azure_deployment_image_edit_form_data(data: dict, request_url: str) -> dict:
+ """
+ Azure OpenAI ``.../openai/deployments/{deployment}/images/edits`` routes by
+ deployment in the URL; including ``model`` in multipart fields can break
+ the same way as image generations (LiteLLM #26316).
+
+ Non-deployment edit URLs keep ``model`` when present.
+ """
+ if "images/edits" in request_url and "/openai/deployments/" in request_url:
+ return {k: v for k, v in data.items() if k != "model"}
+ return data
+
def validate_environment(
self,
headers: dict,
@@ -83,3 +96,8 @@ class AzureImageEditConfig(OpenAIImageEditConfig):
final_url = httpx.URL(new_url).copy_with(params=query_params)
return str(final_url)
+
+ def finalize_image_edit_request_data(
+ self, data: dict, resolved_request_url: str
+ ) -> dict:
+ return self.azure_deployment_image_edit_form_data(data, resolved_request_url)
diff --git a/litellm/llms/azure/image_generation/__init__.py b/litellm/llms/azure/image_generation/__init__.py
index a9cf151464..f60e446f0c 100644
--- a/litellm/llms/azure/image_generation/__init__.py
+++ b/litellm/llms/azure/image_generation/__init__.py
@@ -6,11 +6,13 @@ from litellm.llms.base_llm.image_generation.transformation import (
from .dall_e_2_transformation import AzureDallE2ImageGenerationConfig
from .dall_e_3_transformation import AzureDallE3ImageGenerationConfig
from .gpt_transformation import AzureGPTImageGenerationConfig
+from .http_utils import azure_deployment_image_generation_json_body
__all__ = [
"AzureDallE2ImageGenerationConfig",
"AzureDallE3ImageGenerationConfig",
"AzureGPTImageGenerationConfig",
+ "azure_deployment_image_generation_json_body",
]
diff --git a/litellm/llms/azure/image_generation/http_utils.py b/litellm/llms/azure/image_generation/http_utils.py
new file mode 100644
index 0000000000..03c425eeff
--- /dev/null
+++ b/litellm/llms/azure/image_generation/http_utils.py
@@ -0,0 +1,17 @@
+"""HTTP helpers for Azure OpenAI image generation (REST, not SDK)."""
+
+
+def azure_deployment_image_generation_json_body(api_base: str, data: dict) -> dict:
+ """
+ Build the JSON body for Azure OpenAI image generation POSTs.
+
+ For ``.../openai/deployments/{deployment}/images/generations``, routing uses the
+ deployment in the URL only; sending ``model`` in the body (especially the deployment
+ name) breaks some models (e.g. gpt-image-2). See LiteLLM #26316.
+
+ Provider-style URLs (e.g. ``/providers/...`` for FLUX on Azure AI) keep all keys
+ so non–OpenAI-deployment payloads still work.
+ """
+ if "images/generations" in api_base and "/openai/deployments/" in api_base:
+ return {k: v for k, v in data.items() if k != "model"}
+ return data
diff --git a/litellm/llms/azure/responses/transformation.py b/litellm/llms/azure/responses/transformation.py
index 76a6d485bc..ca9293325f 100644
--- a/litellm/llms/azure/responses/transformation.py
+++ b/litellm/llms/azure/responses/transformation.py
@@ -5,6 +5,7 @@ import httpx
from openai.types.responses import ResponseReasoningItem
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.azure.common_utils import BaseAzureLLM
from litellm.llms.openai.responses.transformation import OpenAIResponsesAPIConfig
from litellm.types.llms.openai import *
@@ -201,7 +202,10 @@ class AzureOpenAIResponsesAPIConfig(OpenAIResponsesAPIConfig):
# Insert the response_id at the end of the path component
# Remove trailing slash if present to avoid double slashes
path = parsed_url.path.rstrip("/")
- new_path = f"{path}/{response_id}"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ new_path = f"{path}/{encoded_response_id}"
# Reconstruct the URL with all original components but with the modified path
constructed_url = urlunparse(
@@ -322,7 +326,10 @@ class AzureOpenAIResponsesAPIConfig(OpenAIResponsesAPIConfig):
# Insert the response_id and /cancel at the end of the path component
# Remove trailing slash if present to avoid double slashes
path = parsed_url.path.rstrip("/")
- new_path = f"{path}/{response_id}/cancel"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ new_path = f"{path}/{encoded_response_id}/cancel"
# Reconstruct the URL with all original components but with the modified path
cancel_url = urlunparse(
diff --git a/litellm/llms/azure_ai/agents/handler.py b/litellm/llms/azure_ai/agents/handler.py
index c3cd06ab4d..9bae8abce8 100644
--- a/litellm/llms/azure_ai/agents/handler.py
+++ b/litellm/llms/azure_ai/agents/handler.py
@@ -36,6 +36,7 @@ from typing import (
import httpx
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.azure_ai.agents.transformation import (
AzureAIAgentsConfig,
AzureAIAgentsError,
@@ -75,20 +76,29 @@ class AzureAIAgentsHandler:
def _build_messages_url(
self, api_base: str, thread_id: str, api_version: str
) -> str:
- return f"{api_base}/threads/{thread_id}/messages?api-version={api_version}"
+ encoded_thread_id = encode_url_path_segment(thread_id, field_name="thread_id")
+ return (
+ f"{api_base}/threads/{encoded_thread_id}/messages?api-version={api_version}"
+ )
def _build_runs_url(self, api_base: str, thread_id: str, api_version: str) -> str:
- return f"{api_base}/threads/{thread_id}/runs?api-version={api_version}"
+ encoded_thread_id = encode_url_path_segment(thread_id, field_name="thread_id")
+ return f"{api_base}/threads/{encoded_thread_id}/runs?api-version={api_version}"
def _build_run_status_url(
self, api_base: str, thread_id: str, run_id: str, api_version: str
) -> str:
- return f"{api_base}/threads/{thread_id}/runs/{run_id}?api-version={api_version}"
+ encoded_thread_id = encode_url_path_segment(thread_id, field_name="thread_id")
+ encoded_run_id = encode_url_path_segment(run_id, field_name="run_id")
+ return f"{api_base}/threads/{encoded_thread_id}/runs/{encoded_run_id}?api-version={api_version}"
def _build_list_messages_url(
self, api_base: str, thread_id: str, api_version: str
) -> str:
- return f"{api_base}/threads/{thread_id}/messages?api-version={api_version}"
+ encoded_thread_id = encode_url_path_segment(thread_id, field_name="thread_id")
+ return (
+ f"{api_base}/threads/{encoded_thread_id}/messages?api-version={api_version}"
+ )
def _build_create_thread_and_run_url(self, api_base: str, api_version: str) -> str:
"""URL for the create-thread-and-run endpoint (supports streaming)."""
diff --git a/litellm/llms/azure_ai/anthropic/transformation.py b/litellm/llms/azure_ai/anthropic/transformation.py
index e935aa1c05..e176a4d860 100644
--- a/litellm/llms/azure_ai/anthropic/transformation.py
+++ b/litellm/llms/azure_ai/anthropic/transformation.py
@@ -12,6 +12,23 @@ if TYPE_CHECKING:
pass
+def _promote_extra_body_to_optional_params(optional_params: dict) -> None:
+ """Promote anthropic-native passthrough keys out of ``extra_body``.
+
+ ``azure_ai`` is an OpenAI-compatible provider, so non-OpenAI kwargs like
+ ``output_config`` get auto-routed into ``extra_body`` by
+ ``add_provider_specific_params_to_optional_params``. For the Azure→Anthropic
+ route those keys must reach the request body and be validated, so promote
+ them. ``setdefault`` keeps explicit top-level values authoritative.
+ """
+ extra_body = optional_params.get("extra_body")
+ if not isinstance(extra_body, dict) or not extra_body:
+ return
+ for k, v in extra_body.items():
+ optional_params.setdefault(k, v)
+ optional_params.pop("extra_body", None)
+
+
class AzureAnthropicConfig(AnthropicConfig):
"""
Azure Anthropic configuration that extends AnthropicConfig.
@@ -39,6 +56,8 @@ class AzureAnthropicConfig(AnthropicConfig):
1. API key via 'api-key' header
2. Azure AD token via 'Authorization: Bearer ' header
"""
+ _promote_extra_body_to_optional_params(optional_params)
+
# Convert dict to GenericLiteLLMParams if needed
if isinstance(litellm_params, dict):
# Ensure api_key is included if provided
@@ -101,7 +120,8 @@ class AzureAnthropicConfig(AnthropicConfig):
Transform request using parent AnthropicConfig, then remove unsupported params.
Azure Anthropic doesn't support extra_body, max_retries, or stream_options parameters.
"""
- # Call parent transform_request
+ _promote_extra_body_to_optional_params(optional_params)
+
data = super().transform_request(
model=model,
messages=messages,
diff --git a/litellm/llms/azure_ai/cost_calculator.py b/litellm/llms/azure_ai/cost_calculator.py
index 067181b946..755d44fdef 100644
--- a/litellm/llms/azure_ai/cost_calculator.py
+++ b/litellm/llms/azure_ai/cost_calculator.py
@@ -65,6 +65,7 @@ def cost_per_token(
usage: Usage,
response_time_ms: Optional[float] = 0.0,
request_model: Optional[str] = None,
+ service_tier: Optional[str] = None,
) -> Tuple[float, float]:
"""
Calculate the cost per token for Azure AI models.
@@ -102,6 +103,7 @@ def cost_per_token(
model=model,
usage=usage,
custom_llm_provider="azure_ai",
+ service_tier=service_tier,
)
except Exception as e:
# For Model Router, the model name (e.g., "azure-model-router") may not be in the cost map
diff --git a/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py b/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py
index 76c247aea8..d4144a7571 100644
--- a/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py
+++ b/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py
@@ -17,11 +17,13 @@ from urllib.parse import quote
import httpx
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import SSRFError, assert_same_origin
from litellm.constants import (
AZURE_DOCUMENT_INTELLIGENCE_API_VERSION,
AZURE_DOCUMENT_INTELLIGENCE_DEFAULT_DPI,
AZURE_OPERATION_POLLING_TIMEOUT,
)
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.ocr.transformation import (
BaseOCRConfig,
DocumentType,
@@ -217,11 +219,12 @@ class AzureDocumentIntelligenceOCRConfig(BaseOCRConfig):
if "/" in model:
# Extract the last part after the last slash
model_id = model.split("/")[-1]
+ encoded_model_id = encode_url_path_segment(model_id, field_name="model_id")
# Azure Document Intelligence analyze endpoint
# Note: API version 2024-11-30+ uses /documentintelligence/ (not /formrecognizer/)
url = (
- f"{api_base}/documentintelligence/documentModels/{model_id}:analyze"
+ f"{api_base}/documentintelligence/documentModels/{encoded_model_id}:analyze"
f"?api-version={AZURE_DOCUMENT_INTELLIGENCE_API_VERSION}"
)
@@ -599,6 +602,16 @@ class AzureDocumentIntelligenceOCRConfig(BaseOCRConfig):
"Azure Document Intelligence returned 202 but no Operation-Location header found"
)
+ # Reject cross-origin polling URLs — the auth headers
+ # below would otherwise leak to whatever URL the upstream
+ # (or an attacker-controlled upstream) returns. VERIA-51.
+ try:
+ assert_same_origin(operation_url, str(raw_response.request.url))
+ except SSRFError as ssrf_err:
+ raise ValueError(
+ f"Azure Document Intelligence: rejected polling URL ({ssrf_err})"
+ )
+
# Get headers for polling (need auth)
poll_headers = {
"Ocp-Apim-Subscription-Key": raw_response.request.headers.get(
@@ -711,6 +724,14 @@ class AzureDocumentIntelligenceOCRConfig(BaseOCRConfig):
"Azure Document Intelligence returned 202 but no Operation-Location header found"
)
+ # Reject cross-origin polling URLs (see sync path). VERIA-51.
+ try:
+ assert_same_origin(operation_url, str(raw_response.request.url))
+ except SSRFError as ssrf_err:
+ raise ValueError(
+ f"Azure Document Intelligence: rejected polling URL ({ssrf_err})"
+ )
+
# Get headers for polling (need auth)
poll_headers = {
"Ocp-Apim-Subscription-Key": raw_response.request.headers.get(
diff --git a/litellm/llms/base_llm/chat/transformation.py b/litellm/llms/base_llm/chat/transformation.py
index b71ae0fdde..bec25916c4 100644
--- a/litellm/llms/base_llm/chat/transformation.py
+++ b/litellm/llms/base_llm/chat/transformation.py
@@ -87,9 +87,7 @@ class BaseConfig(ABC):
return {
k: v
for k, v in cls.__dict__.items()
- if not k.startswith("__")
- and not k.startswith("_abc")
- and not k.startswith("_is_base_class")
+ if not k.startswith("_")
and not isinstance(
v,
(
diff --git a/litellm/llms/base_llm/image_edit/transformation.py b/litellm/llms/base_llm/image_edit/transformation.py
index cea96bde74..92429573ff 100644
--- a/litellm/llms/base_llm/image_edit/transformation.py
+++ b/litellm/llms/base_llm/image_edit/transformation.py
@@ -102,6 +102,18 @@ class BaseImageEditConfig(ABC):
) -> Tuple[Dict, RequestFiles]:
pass
+ def finalize_image_edit_request_data(
+ self, data: dict, resolved_request_url: str
+ ) -> dict:
+ """
+ Last pass on the request dict after ``transform_image_edit_request``, using the
+ exact URL string used for the HTTP POST (same as ``get_complete_url`` output).
+
+ The handler sends this dict as ``data=`` for multipart providers or ``json=``
+ for JSON-only providers; default implementation returns ``data`` unchanged.
+ """
+ return data
+
@abstractmethod
def transform_image_edit_response(
self,
diff --git a/litellm/llms/base_llm/managed_resources/base_managed_resource.py b/litellm/llms/base_llm/managed_resources/base_managed_resource.py
index 5422af7678..c0c18aefde 100644
--- a/litellm/llms/base_llm/managed_resources/base_managed_resource.py
+++ b/litellm/llms/base_llm/managed_resources/base_managed_resource.py
@@ -18,6 +18,11 @@ from typing import (
)
from litellm import verbose_logger
+from litellm.llms.base_llm.managed_resources.isolation import (
+ build_list_page,
+ build_owner_filter,
+ can_access_resource,
+)
from litellm.proxy._types import UserAPIKeyAuth
from litellm.types.utils import SpecialEnums
@@ -169,6 +174,7 @@ class BaseManagedResource(ABC, Generic[ResourceObjectType]):
"model_mappings": model_mappings,
"flat_model_resource_ids": list(model_mappings.values()),
"created_by": user_api_key_dict.user_id,
+ "team_id": user_api_key_dict.team_id,
"updated_by": user_api_key_dict.user_id,
}
@@ -190,6 +196,7 @@ class BaseManagedResource(ABC, Generic[ResourceObjectType]):
"model_mappings": json.dumps(model_mappings),
"flat_model_resource_ids": list(model_mappings.values()),
"created_by": user_api_key_dict.user_id,
+ "team_id": user_api_key_dict.team_id,
"updated_by": user_api_key_dict.user_id,
}
@@ -316,15 +323,17 @@ class BaseManagedResource(ABC, Generic[ResourceObjectType]):
Returns:
True if user has access, False otherwise
"""
- user_id = user_api_key_dict.user_id
-
# Use cached method instead of direct DB query
resource = await self.get_unified_resource_id(
unified_resource_id, litellm_parent_otel_span
)
if resource:
- return resource.get("created_by") == user_id
+ return can_access_resource(
+ user_api_key_dict=user_api_key_dict,
+ created_by=resource.get("created_by"),
+ resource_team_id=resource.get("team_id"),
+ )
return False
@@ -549,11 +558,11 @@ class BaseManagedResource(ABC, Generic[ResourceObjectType]):
Returns:
Dictionary with list of resources and pagination info
"""
- where_clause: Dict[str, Any] = {}
+ owner_filter = build_owner_filter(user_api_key_dict)
+ if owner_filter is None:
+ return build_list_page([])
- # Filter by user who created the resource
- if user_api_key_dict.user_id:
- where_clause["created_by"] = user_api_key_dict.user_id
+ where_clause: Dict[str, Any] = {**owner_filter}
if after:
where_clause["id"] = {"gt": after}
@@ -598,10 +607,6 @@ class BaseManagedResource(ABC, Generic[ResourceObjectType]):
)
continue
- return {
- "object": "list",
- "data": resource_objects,
- "first_id": resource_objects[0].id if resource_objects else None,
- "last_id": resource_objects[-1].id if resource_objects else None,
- "has_more": len(resource_objects) == (limit or 20),
- }
+ return build_list_page(
+ resource_objects, has_more=len(resource_objects) == (limit or 20)
+ )
diff --git a/litellm/llms/base_llm/managed_resources/isolation.py b/litellm/llms/base_llm/managed_resources/isolation.py
new file mode 100644
index 0000000000..62027f4272
--- /dev/null
+++ b/litellm/llms/base_llm/managed_resources/isolation.py
@@ -0,0 +1,99 @@
+"""
+Tenant-isolation helpers for managed file/batch/vector-store resources.
+
+Returns a Prisma filter and an ownership check that scope managed resources
+to the caller's identity: proxy admins see everything, user-keyed callers
+see records they created, and service-account keys (no user_id) fall back
+to the resource's owning team. Callers with no admin role and no
+identifying ids are denied so an empty user_id can never select an
+unscoped query.
+"""
+
+from typing import Any, Dict, List, Optional
+
+from litellm.proxy._types import (
+ UserAPIKeyAuth,
+ user_api_key_has_admin_view as _user_has_admin_view,
+)
+
+
+def build_list_page(items: List[Any], has_more: bool = False) -> Dict[str, Any]:
+ """Build the OpenAI-style paginated list response shape used by managed
+ file/batch/vector-store listings. ``first_id`` and ``last_id`` are
+ sourced from each item's ``.id`` attribute."""
+ return {
+ "object": "list",
+ "data": items,
+ "first_id": items[0].id if items else None,
+ "last_id": items[-1].id if items else None,
+ "has_more": has_more,
+ }
+
+
+def build_owner_filter(
+ user_api_key_dict: UserAPIKeyAuth,
+) -> Optional[Dict[str, Any]]:
+ """Return a Prisma `where` fragment that scopes a managed-resource listing
+ to records the caller is allowed to see.
+
+ - ``{}`` means no scoping (proxy admins).
+ - ``{"created_by": }`` for user-keyed callers.
+ - ``{"team_id": }`` for service-account callers
+ that have a team but no user_id.
+ - ``{"OR": [...]}`` when the caller has both — listing must include
+ both their own resources and team-shared ones so it stays consistent
+ with ``can_access_resource``.
+ - ``None`` means deny: callers MUST skip the query rather than fall
+ back to an unscoped fetch.
+ """
+ if _user_has_admin_view(user_api_key_dict):
+ return {}
+
+ user_id = user_api_key_dict.user_id
+ team_id = user_api_key_dict.team_id
+
+ if user_id is not None and team_id is not None:
+ return {
+ "OR": [
+ {"created_by": user_id},
+ {"team_id": team_id},
+ ]
+ }
+
+ if user_id is not None:
+ return {"created_by": user_id}
+
+ if team_id is not None:
+ return {"team_id": team_id}
+
+ return None
+
+
+def can_access_resource(
+ user_api_key_dict: UserAPIKeyAuth,
+ created_by: Optional[str],
+ resource_team_id: Optional[str],
+) -> bool:
+ """Return True iff the caller may read/modify a managed resource.
+
+ The resource's ``created_by`` and ``team_id`` fields must be non-None
+ to match the caller's identity — guarding against the ``None == None``
+ bypass that previously let service-account keys read every keyless
+ resource.
+ """
+ if _user_has_admin_view(user_api_key_dict):
+ return True
+
+ user_id = user_api_key_dict.user_id
+ if user_id is not None and created_by is not None and created_by == user_id:
+ return True
+
+ team_id = user_api_key_dict.team_id
+ if (
+ team_id is not None
+ and resource_team_id is not None
+ and resource_team_id == team_id
+ ):
+ return True
+
+ return False
diff --git a/litellm/llms/bedrock/chat/converse_transformation.py b/litellm/llms/bedrock/chat/converse_transformation.py
index 61a7d4c08d..efc890d9ee 100644
--- a/litellm/llms/bedrock/chat/converse_transformation.py
+++ b/litellm/llms/bedrock/chat/converse_transformation.py
@@ -31,7 +31,11 @@ from litellm.litellm_core_utils.prompt_templates.factory import (
_bedrock_converse_messages_pt,
_bedrock_tools_pt,
)
-from litellm.llms.anthropic.chat.transformation import AnthropicConfig
+from litellm.llms.anthropic.chat.transformation import (
+ DROP_UNSUPPORTED_OUTPUT_CONFIG_WARNING,
+ REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT,
+ AnthropicConfig,
+)
from litellm.llms.base_llm.chat.transformation import BaseConfig, BaseLLMException
from litellm.types.llms.bedrock import *
from litellm.types.llms.openai import (
@@ -189,7 +193,7 @@ class AmazonConverseConfig(BaseConfig):
return {
k: v
for k, v in cls.__dict__.items()
- if not k.startswith("__")
+ if not k.startswith("_")
and not isinstance(
v,
(
@@ -410,47 +414,64 @@ class AmazonConverseConfig(BaseConfig):
"""
Handle the reasoning_effort parameter based on the model type.
- Different model families handle reasoning effort differently:
- - GPT-OSS models: Keep reasoning_effort as-is (passed to additionalModelRequestFields)
- - Nova 2 models: Transform to reasoningConfig structure
- - Other models (Anthropic, etc.): Convert to thinking parameter
-
- Args:
- model: The model identifier
- reasoning_effort: The reasoning effort value
- optional_params: Dictionary of optional parameters to update in-place
-
- Examples:
- >>> config = AmazonConverseConfig()
- >>> params = {}
- >>> config._handle_reasoning_effort_parameter("gpt-oss-model", "high", params)
- >>> params
- {'reasoning_effort': 'high'}
-
- >>> params = {}
- >>> config._handle_reasoning_effort_parameter("amazon.nova-2-lite-v1:0", "high", params)
- >>> params
- {'reasoningConfig': {'type': 'enabled', 'maxReasoningEffort': 'high'}}
-
- >>> params = {}
- >>> config._handle_reasoning_effort_parameter("anthropic.claude-3", "high", params)
- >>> params
- {'thinking': {'type': 'enabled', 'budget_tokens': 10000}}
+ - GPT-OSS models: passed through unchanged via additionalModelRequestFields.
+ - Nova 2 models: transformed to reasoningConfig.
+ - Anthropic models: mapped to ``thinking`` (and ``output_config.effort`` on
+ adaptive Claude 4.6 / 4.7).
"""
if "gpt-oss" in model:
- # GPT-OSS models: keep reasoning_effort as-is
- # It will be passed through to additionalModelRequestFields
optional_params["reasoning_effort"] = reasoning_effort
elif self._is_nova_2_model(model):
- # Nova 2 models: transform to reasoningConfig
reasoning_config = self._transform_reasoning_effort_to_reasoning_config(
reasoning_effort
)
optional_params.update(reasoning_config)
else:
- # Anthropic and other models: convert to thinking parameter
- optional_params["thinking"] = AnthropicConfig._map_reasoning_effort(
- reasoning_effort=reasoning_effort, model=model
+ mapped_thinking = AnthropicConfig._map_reasoning_effort(
+ reasoning_effort=reasoning_effort,
+ model=model,
+ llm_provider="bedrock_converse",
+ )
+ if mapped_thinking is None:
+ optional_params.pop("thinking", None)
+ optional_params.pop("output_config", None)
+ else:
+ optional_params["thinking"] = mapped_thinking
+ if AnthropicConfig._is_adaptive_thinking_model(model):
+ mapped_effort = REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT.get(
+ reasoning_effort
+ )
+ if mapped_effort is None:
+ AnthropicConfig._raise_invalid_reasoning_effort(
+ model=model,
+ value=reasoning_effort,
+ llm_provider="bedrock_converse",
+ )
+ self._validate_anthropic_adaptive_effort(
+ model=model, effort=mapped_effort
+ )
+ optional_params["output_config"] = {"effort": mapped_effort}
+
+ @staticmethod
+ def _validate_anthropic_adaptive_effort(model: str, effort: str) -> None:
+ """Validate ``output_config.effort`` for adaptive-thinking Claude 4.6/4.7."""
+ valid_efforts = {"high", "medium", "low", "xhigh", "max"}
+ if effort not in valid_efforts:
+ raise litellm.exceptions.BadRequestError(
+ message=(
+ f"Invalid reasoning_effort/output_config.effort value: "
+ f"{effort!r}. Must be one of: 'low', 'medium', 'high', "
+ f"'xhigh', or 'max'."
+ ),
+ model=model,
+ llm_provider="bedrock_converse",
+ )
+ error = AnthropicConfig._validate_effort_for_model(model=model, effort=effort)
+ if error is not None:
+ raise litellm.exceptions.BadRequestError(
+ message=error,
+ model=model,
+ llm_provider="bedrock_converse",
)
@staticmethod
@@ -1192,9 +1213,11 @@ class AmazonConverseConfig(BaseConfig):
+ supported_config_params
)
inference_params.pop("json_mode", None) # used for handling json_schema
- # Anthropic-only key. Bedrock expects `outputConfig` (camelCase) and
- # will reject `output_config` if it leaks through pass-through routes.
- inference_params.pop("output_config", None)
+
+ # Anthropic-only ``output_config`` (snake_case) — re-attached to
+ # ``additionalModelRequestFields`` for Anthropic models below. The
+ # Bedrock-native ``outputConfig`` (camelCase) is handled separately.
+ anthropic_output_config = inference_params.pop("output_config", None)
# Extract requestMetadata before processing other parameters
request_metadata = inference_params.pop("requestMetadata", None)
@@ -1204,9 +1227,6 @@ class AmazonConverseConfig(BaseConfig):
output_config: Optional[OutputConfigBlock] = inference_params.pop(
"outputConfig", None
)
- inference_params.pop(
- "output_config", None
- ) # Bedrock Converse doesn't support it
# keep supported params in 'inference_params', and set all model-specific params in 'additional_request_params'
additional_request_params = {
@@ -1249,6 +1269,27 @@ class AmazonConverseConfig(BaseConfig):
additional_request_params
)
+ if anthropic_output_config is not None and isinstance(
+ anthropic_output_config, dict
+ ):
+ base_model = BedrockModelInfo.get_base_model(model)
+ if base_model.startswith("anthropic"):
+ if (
+ litellm.drop_params is True
+ and not AnthropicConfig._model_supports_effort_param(model)
+ ):
+ litellm.verbose_logger.warning(
+ DROP_UNSUPPORTED_OUTPUT_CONFIG_WARNING,
+ model,
+ )
+ else:
+ effort = anthropic_output_config.get("effort")
+ if effort is not None:
+ self._validate_anthropic_adaptive_effort(
+ model=model, effort=effort
+ )
+ additional_request_params["output_config"] = anthropic_output_config
+
return (
inference_params,
additional_request_params,
@@ -1372,9 +1413,25 @@ class AmazonConverseConfig(BaseConfig):
# Append pre-formatted tools (systemTool etc.) after transformation
bedrock_tools.extend(pre_formatted_tools)
+ # Opus 4.5 gates ``output_config.effort`` behind a beta header;
+ # Claude 4.6/4.7 accept it without one.
+ base_model = BedrockModelInfo.get_base_model(model)
+ if base_model.startswith("anthropic"):
+ output_config = additional_request_params.get("output_config")
+ if (
+ isinstance(output_config, dict)
+ and output_config.get("effort") is not None
+ and not AnthropicConfig._is_adaptive_thinking_model(model)
+ ):
+ from litellm.types.llms.anthropic import (
+ ANTHROPIC_EFFORT_BETA_HEADER,
+ )
+
+ if ANTHROPIC_EFFORT_BETA_HEADER not in anthropic_beta_list:
+ anthropic_beta_list.append(ANTHROPIC_EFFORT_BETA_HEADER)
+
# Set anthropic_beta in additional_request_params if we have any beta features
# ONLY apply to Anthropic/Claude models - other models (e.g., Qwen, Llama) don't support this field
- base_model = BedrockModelInfo.get_base_model(model)
if anthropic_beta_list and base_model.startswith("anthropic"):
additional_request_params["anthropic_beta"] = anthropic_beta_list
diff --git a/litellm/llms/bedrock/chat/invoke_agent/transformation.py b/litellm/llms/bedrock/chat/invoke_agent/transformation.py
index 2c7135f4d8..4c667b0ce3 100644
--- a/litellm/llms/bedrock/chat/invoke_agent/transformation.py
+++ b/litellm/llms/bedrock/chat/invoke_agent/transformation.py
@@ -12,6 +12,7 @@ import httpx
from litellm._logging import verbose_logger
from litellm._uuid import uuid
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.prompt_templates.common_utils import (
convert_content_list_to_str,
)
@@ -97,8 +98,15 @@ class AmazonInvokeAgentConfig(BaseConfig, BaseAWSLLM):
agent_id, agent_alias_id = self._get_agent_id_and_alias_id(model)
session_id = self._get_session_id(optional_params)
+ encoded_agent_id = encode_url_path_segment(agent_id, field_name="agent_id")
+ encoded_agent_alias_id = encode_url_path_segment(
+ agent_alias_id, field_name="agent_alias_id"
+ )
+ encoded_session_id = encode_url_path_segment(
+ session_id, field_name="session_id"
+ )
- endpoint_url = f"{endpoint_url}/agents/{agent_id}/agentAliases/{agent_alias_id}/sessions/{session_id}/text"
+ endpoint_url = f"{endpoint_url}/agents/{encoded_agent_id}/agentAliases/{encoded_agent_alias_id}/sessions/{encoded_session_id}/text"
return endpoint_url
diff --git a/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py b/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py
index cff415d49e..c883ab68df 100644
--- a/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py
+++ b/litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude3_transformation.py
@@ -169,7 +169,6 @@ class AmazonAnthropicClaudeConfig(AmazonInvokeConfig, AnthropicConfig):
anthropic_request.pop("model", None)
anthropic_request.pop("stream", None)
anthropic_request.pop("output_format", None)
- anthropic_request.pop("output_config", None)
if "anthropic_version" not in anthropic_request:
anthropic_request["anthropic_version"] = self.anthropic_version
diff --git a/litellm/llms/bedrock/count_tokens/transformation.py b/litellm/llms/bedrock/count_tokens/transformation.py
index a37af13162..c967fd334b 100644
--- a/litellm/llms/bedrock/count_tokens/transformation.py
+++ b/litellm/llms/bedrock/count_tokens/transformation.py
@@ -201,13 +201,14 @@ class BedrockCountTokensConfig(BaseAWSLLM):
# Remove bedrock/ prefix if present
if model_id.startswith("bedrock/"):
model_id = model_id[8:] # Remove "bedrock/" prefix
+ encoded_model_id = self.encode_model_id(model_id=model_id)
base_url, _ = self.get_runtime_endpoint(
api_base=api_base,
aws_bedrock_runtime_endpoint=aws_bedrock_runtime_endpoint,
aws_region_name=aws_region_name,
)
- endpoint = f"{base_url}/model/{model_id}/count-tokens"
+ endpoint = f"{base_url}/model/{encoded_model_id}/count-tokens"
return endpoint
diff --git a/litellm/llms/bedrock/files/handler.py b/litellm/llms/bedrock/files/handler.py
index 13bd87a1f0..ecf157e12e 100644
--- a/litellm/llms/bedrock/files/handler.py
+++ b/litellm/llms/bedrock/files/handler.py
@@ -1,10 +1,17 @@
import asyncio
import base64
-from typing import Any, Coroutine, Optional, Tuple, Union
+import os
+from types import MappingProxyType
+from typing import Any, Coroutine, Mapping, Optional, Tuple, Union, cast
import httpx
from litellm import LlmProviders
+from litellm.litellm_core_utils.cloud_storage_security import (
+ BEDROCK_MANAGED_S3_PREFIXES,
+ should_allow_legacy_cloud_file_ids,
+ validate_managed_cloud_file_id,
+)
from litellm.llms.custom_httpx.http_handler import get_async_httpx_client
from litellm.types.llms.openai import (
FileContentRequest,
@@ -35,7 +42,7 @@ class BedrockFilesHandler(BaseAWSLLM):
The file ID can be in two formats:
1. Base64-encoded unified file ID containing: llm_output_file_id,s3://bucket/path
- 2. Direct S3 URI: s3://bucket/path
+ 2. Direct S3 URI: s3://bucket/litellm-managed-prefix/path
Args:
file_id: Encoded file ID or direct S3 URI
@@ -58,14 +65,19 @@ class BedrockFilesHandler(BaseAWSLLM):
except Exception:
pass
- # If not base64 encoded or doesn't contain llm_output_file_id, assume it's already an S3 URI
+ # If not base64 encoded or doesn't contain llm_output_file_id, accept only
+ # explicit S3 URIs. Bucket and key validation happens before any S3 call.
if file_id.startswith("s3://"):
return file_id
- # If it doesn't start with s3://, assume it's a direct S3 URI and add the prefix
- return f"s3://{file_id}"
+ raise ValueError("file_id must be a managed LiteLLM S3 file id")
- def _parse_s3_uri(self, s3_uri: str) -> Tuple[str, str]:
+ def _parse_s3_uri(
+ self,
+ s3_uri: str,
+ configured_bucket_name: str,
+ allow_legacy_cloud_file_ids: bool = False,
+ ) -> Tuple[str, str]:
"""
Parse S3 URI to extract bucket name and object key.
@@ -75,21 +87,34 @@ class BedrockFilesHandler(BaseAWSLLM):
Returns:
Tuple of (bucket_name, object_key)
"""
- if not s3_uri.startswith("s3://"):
- raise ValueError(
- f"Invalid S3 URI format: {s3_uri}. Expected format: s3://bucket-name/path/to/file"
+ return validate_managed_cloud_file_id(
+ file_id=s3_uri,
+ scheme="s3://",
+ configured_bucket_name=configured_bucket_name,
+ allowed_object_prefixes=BEDROCK_MANAGED_S3_PREFIXES,
+ allow_legacy_cloud_file_ids=allow_legacy_cloud_file_ids,
+ )
+
+ def _get_configured_s3_bucket_name(self, litellm_params: dict) -> str:
+ trusted_model_credentials = litellm_params.get(
+ "_litellm_internal_model_credentials"
+ )
+ bucket_name = None
+ if isinstance(trusted_model_credentials, type(MappingProxyType({}))):
+ trusted_model_credentials_mapping = cast(
+ Mapping[str, Any], trusted_model_credentials
)
-
- # Remove 's3://' prefix
- path = s3_uri[5:]
-
- if "/" in path:
- bucket_name, object_key = path.split("/", 1)
- else:
- bucket_name = path
- object_key = ""
-
- return bucket_name, object_key
+ candidate_bucket_name = trusted_model_credentials_mapping.get(
+ "s3_bucket_name"
+ )
+ if isinstance(candidate_bucket_name, str):
+ bucket_name = candidate_bucket_name
+ bucket_name = bucket_name or os.getenv("AWS_S3_BUCKET_NAME")
+ if not bucket_name:
+ raise ValueError(
+ "S3 bucket_name is required. Set 's3_bucket_name' in proxy config or AWS_S3_BUCKET_NAME for Bedrock file content retrieval."
+ )
+ return bucket_name
async def afile_content(
self,
@@ -119,7 +144,14 @@ class BedrockFilesHandler(BaseAWSLLM):
# Extract S3 URI from file ID
s3_uri = self._extract_s3_uri_from_file_id(file_id)
- bucket_name, object_key = self._parse_s3_uri(s3_uri)
+ configured_bucket_name = self._get_configured_s3_bucket_name(optional_params)
+ bucket_name, object_key = self._parse_s3_uri(
+ s3_uri=s3_uri,
+ configured_bucket_name=configured_bucket_name,
+ allow_legacy_cloud_file_ids=should_allow_legacy_cloud_file_ids(
+ optional_params
+ ),
+ )
# Get AWS credentials
aws_region_name = self._get_aws_region_name(
diff --git a/litellm/llms/bedrock/files/transformation.py b/litellm/llms/bedrock/files/transformation.py
index 3007b54808..6669363093 100644
--- a/litellm/llms/bedrock/files/transformation.py
+++ b/litellm/llms/bedrock/files/transformation.py
@@ -2,6 +2,7 @@ import json
import os
import time
from typing import Any, Dict, List, Optional, Tuple, Union
+from urllib.parse import unquote
import httpx
from httpx import Headers, Response
@@ -10,6 +11,14 @@ from openai.types.file_deleted import FileDeleted
from litellm._logging import verbose_logger
from litellm._uuid import uuid
from litellm.files.utils import FilesAPIUtils
+from litellm.litellm_core_utils.cloud_storage_security import (
+ BEDROCK_MANAGED_S3_BATCH_PREFIX,
+ BEDROCK_MANAGED_S3_UPLOAD_PREFIX,
+ build_managed_cloud_object_name,
+ encode_s3_object_key_for_url,
+ sanitize_cloud_object_component,
+ split_configured_cloud_bucket_name,
+)
from litellm.litellm_core_utils.prompt_templates.common_utils import extract_file_data
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.llms.base_llm.files.transformation import (
@@ -116,10 +125,13 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
if _model.startswith("bedrock/"):
_model = _model[8:]
- # Replace colons with hyphens for Bedrock S3 URI compliance
- _model = _model.replace(":", "-")
+ safe_model = sanitize_cloud_object_component(
+ _model.replace(":", "-"), fallback="model"
+ )
- object_name = f"litellm-bedrock-files-{_model}-{uuid.uuid4()}.jsonl"
+ object_name = (
+ f"{BEDROCK_MANAGED_S3_BATCH_PREFIX}{safe_model}-{uuid.uuid4()}.jsonl"
+ )
return object_name
def get_object_name(
@@ -146,12 +158,13 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
if len(openai_jsonl_content) > 0:
return self._get_s3_object_name_from_batch_jsonl(openai_jsonl_content)
- ## 2. If not jsonl, return the filename
+ ## 2. If not jsonl, store under a server-generated managed object name
filename = extracted_file_data.get("filename")
- if filename:
- return filename
- ## 3. If no file name, return timestamp
- return str(int(time.time()))
+ return build_managed_cloud_object_name(
+ prefix=BEDROCK_MANAGED_S3_UPLOAD_PREFIX,
+ filename=filename,
+ fallback_filename="file",
+ )
def get_complete_file_url(
self,
@@ -172,6 +185,7 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
raise ValueError(
"S3 bucket_name is required. Set 's3_bucket_name' in litellm_params or AWS_S3_BUCKET_NAME env var"
)
+ bucket_name, object_prefix = split_configured_cloud_bucket_name(bucket_name)
s3_region_name = litellm_params.get("s3_region_name") or optional_params.get(
"s3_region_name"
@@ -188,14 +202,17 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
raise ValueError("purpose is required")
extracted_file_data = extract_file_data(file_data)
object_name = self.get_object_name(extracted_file_data, purpose)
+ if object_prefix:
+ object_name = f"{object_prefix}/{object_name}"
+ encoded_object_name = encode_s3_object_key_for_url(object_name)
# S3 endpoint URL format
s3_endpoint_url = (
optional_params.get("s3_endpoint_url")
or f"https://s3.{aws_region_name}.amazonaws.com"
- )
+ ).rstrip("/")
- return f"{s3_endpoint_url}/{bucket_name}/{object_name}"
+ return f"{s3_endpoint_url}/{bucket_name}/{encoded_object_name}"
def get_supported_openai_params(
self, model: str
@@ -532,10 +549,12 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
if match1:
# Pattern: https://s3.region.amazonaws.com/bucket/key
region, bucket, key = match1.groups()
+ key = unquote(key)
s3_uri = f"s3://{bucket}/{key}"
elif match2:
# Pattern: https://bucket.s3.region.amazonaws.com/key
bucket, region, key = match2.groups()
+ key = unquote(key)
s3_uri = f"s3://{bucket}/{key}"
else:
# Fallback: try to extract bucket and key from URL path
@@ -545,6 +564,7 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
path_parts = parsed.path.lstrip("/").split("/", 1)
if len(path_parts) >= 2:
bucket, key = path_parts[0], path_parts[1]
+ key = unquote(key)
s3_uri = f"s3://{bucket}/{key}"
else:
raise ValueError(f"Unable to parse S3 URL: {https_url}")
@@ -722,7 +742,12 @@ class BedrockJsonlFilesTransformation:
# Remove bedrock/ prefix if present
if _model.startswith("bedrock/"):
_model = _model[8:]
- object_name = f"litellm-bedrock-files-{_model}-{uuid.uuid4()}.jsonl"
+ safe_model = sanitize_cloud_object_component(
+ _model.replace(":", "-"), fallback="model"
+ )
+ object_name = (
+ f"{BEDROCK_MANAGED_S3_BATCH_PREFIX}{safe_model}-{uuid.uuid4()}.jsonl"
+ )
return object_name
def _get_content_from_openai_file(self, openai_file_content: FileTypes) -> str:
diff --git a/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py b/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py
index 1b15ebaa76..aae2bc5e28 100644
--- a/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py
+++ b/litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py
@@ -12,9 +12,14 @@ from typing import (
import httpx
+import litellm
from litellm.anthropic_beta_headers_manager import filter_and_transform_beta_headers
from litellm.constants import BEDROCK_MIN_THINKING_BUDGET_TOKENS
from litellm.litellm_core_utils.litellm_logging import verbose_logger
+from litellm.llms.anthropic.chat.transformation import (
+ DROP_UNSUPPORTED_OUTPUT_CONFIG_WARNING,
+ AnthropicConfig,
+)
from litellm.llms.anthropic.common_utils import AnthropicModelInfo
from litellm.llms.anthropic.experimental_pass_through.messages.transformation import (
AnthropicMessagesConfig,
@@ -580,6 +585,17 @@ class AmazonAnthropicClaudeMessagesConfig(
if filtered_betas:
anthropic_messages_request["anthropic_beta"] = filtered_betas
+ if (
+ litellm.drop_params is True
+ and "output_config" in anthropic_messages_request
+ and not AnthropicConfig._model_supports_effort_param(model)
+ ):
+ verbose_logger.warning(
+ DROP_UNSUPPORTED_OUTPUT_CONFIG_WARNING,
+ model,
+ )
+ anthropic_messages_request.pop("output_config", None)
+
# 7. Final safety net: filter top-level fields to the Bedrock Invoke allowlist.
# Catches Anthropic-only extensions (context_management, output_config, speed,
# mcp_servers, ...) and any future additions Claude Code may start sending.
diff --git a/litellm/llms/bedrock/vector_stores/transformation.py b/litellm/llms/bedrock/vector_stores/transformation.py
index f028503c6a..ec20d76102 100644
--- a/litellm/llms/bedrock/vector_stores/transformation.py
+++ b/litellm/llms/bedrock/vector_stores/transformation.py
@@ -5,6 +5,7 @@ from urllib.parse import urlparse
import httpx
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.vector_store.transformation import BaseVectorStoreConfig
from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM
from litellm.types.integrations.rag.bedrock_knowledgebase import (
@@ -209,7 +210,10 @@ class BedrockVectorStoreConfig(BaseVectorStoreConfig, BaseAWSLLM):
if isinstance(query, list):
query = " ".join(query)
- url = f"{api_base}/{vector_store_id}/retrieve"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}/retrieve"
request_body: Dict[str, Any] = {
"retrievalQuery": BedrockKBRetrievalQuery(text=query),
diff --git a/litellm/llms/black_forest_labs/image_edit/handler.py b/litellm/llms/black_forest_labs/image_edit/handler.py
index dea2683a04..f5784e0836 100644
--- a/litellm/llms/black_forest_labs/image_edit/handler.py
+++ b/litellm/llms/black_forest_labs/image_edit/handler.py
@@ -15,6 +15,7 @@ import httpx
import litellm
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
+from litellm.litellm_core_utils.url_utils import SSRFError, assert_same_origin
from litellm.llms.custom_httpx.http_handler import (
AsyncHTTPHandler,
HTTPHandler,
@@ -331,6 +332,17 @@ class BlackForestLabsImageEdit:
message="No polling_url in BFL response",
)
+ # Reject cross-origin polling URLs — the ``x-key`` auth header
+ # would otherwise leak to whatever URL the upstream returns.
+ # VERIA-51.
+ try:
+ assert_same_origin(polling_url, str(initial_response.request.url))
+ except SSRFError as ssrf_err:
+ raise BlackForestLabsError(
+ status_code=502,
+ message=f"Rejected polling URL: {ssrf_err}",
+ )
+
# Get just the auth header for polling
polling_headers = {"x-key": headers.get("x-key", "")}
@@ -416,6 +428,17 @@ class BlackForestLabsImageEdit:
message="No polling_url in BFL response",
)
+ # Reject cross-origin polling URLs — the ``x-key`` auth header
+ # would otherwise leak to whatever URL the upstream returns.
+ # VERIA-51.
+ try:
+ assert_same_origin(polling_url, str(initial_response.request.url))
+ except SSRFError as ssrf_err:
+ raise BlackForestLabsError(
+ status_code=502,
+ message=f"Rejected polling URL: {ssrf_err}",
+ )
+
# Get just the auth header for polling
polling_headers = {"x-key": headers.get("x-key", "")}
diff --git a/litellm/llms/black_forest_labs/image_generation/handler.py b/litellm/llms/black_forest_labs/image_generation/handler.py
index 5a1d885e52..8af4a236fd 100644
--- a/litellm/llms/black_forest_labs/image_generation/handler.py
+++ b/litellm/llms/black_forest_labs/image_generation/handler.py
@@ -15,6 +15,7 @@ import httpx
import litellm
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
+from litellm.litellm_core_utils.url_utils import SSRFError, assert_same_origin
from litellm.llms.custom_httpx.http_handler import (
AsyncHTTPHandler,
HTTPHandler,
@@ -317,6 +318,17 @@ class BlackForestLabsImageGeneration:
message="No polling_url in BFL response",
)
+ # Reject cross-origin polling URLs — the ``x-key`` auth header
+ # would otherwise leak to whatever URL the upstream returns.
+ # VERIA-51.
+ try:
+ assert_same_origin(polling_url, str(initial_response.request.url))
+ except SSRFError as ssrf_err:
+ raise BlackForestLabsError(
+ status_code=502,
+ message=f"Rejected polling URL: {ssrf_err}",
+ )
+
# Get just the auth header for polling
polling_headers = {"x-key": headers.get("x-key", "")}
@@ -402,6 +414,17 @@ class BlackForestLabsImageGeneration:
message="No polling_url in BFL response",
)
+ # Reject cross-origin polling URLs — the ``x-key`` auth header
+ # would otherwise leak to whatever URL the upstream returns.
+ # VERIA-51.
+ try:
+ assert_same_origin(polling_url, str(initial_response.request.url))
+ except SSRFError as ssrf_err:
+ raise BlackForestLabsError(
+ status_code=502,
+ message=f"Rejected polling URL: {ssrf_err}",
+ )
+
# Get just the auth header for polling
polling_headers = {"x-key": headers.get("x-key", "")}
diff --git a/litellm/llms/bytez/chat/transformation.py b/litellm/llms/bytez/chat/transformation.py
index a72f732a30..5b08670f9f 100644
--- a/litellm/llms/bytez/chat/transformation.py
+++ b/litellm/llms/bytez/chat/transformation.py
@@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
import httpx
+from litellm.litellm_core_utils.url_utils import encode_url_path_segments
from litellm.litellm_core_utils.exception_mapping_utils import exception_type
from litellm.litellm_core_utils.logging_utils import track_llm_api_timing
from litellm.llms.base_llm.chat.transformation import BaseConfig, BaseLLMException
@@ -149,7 +150,8 @@ class BytezChatConfig(BaseConfig):
litellm_params: dict,
stream: Optional[bool] = None,
) -> str:
- return f"{API_BASE}/{model}"
+ encoded_model = encode_url_path_segments(model, field_name="model")
+ return f"{API_BASE}/{encoded_model}"
def transform_request(
self,
diff --git a/litellm/llms/cloudflare/chat/transformation.py b/litellm/llms/cloudflare/chat/transformation.py
index 9e59782bf7..66e253f304 100644
--- a/litellm/llms/cloudflare/chat/transformation.py
+++ b/litellm/llms/cloudflare/chat/transformation.py
@@ -5,6 +5,7 @@ from typing import AsyncIterator, Iterator, List, Optional, Union
import httpx
import litellm
+from litellm.litellm_core_utils.url_utils import encode_url_path_segments
from litellm.llms.base_llm.base_model_iterator import BaseModelResponseIterator
from litellm.llms.base_llm.chat.transformation import (
BaseConfig,
@@ -89,7 +90,8 @@ class CloudflareChatConfig(BaseConfig):
api_base = (
f"https://api.cloudflare.com/client/v4/accounts/{account_id}/ai/run/"
)
- return api_base + model
+ encoded_model = encode_url_path_segments(model, field_name="model")
+ return api_base + encoded_model
def get_supported_openai_params(self, model: str) -> List[str]:
return [
@@ -147,9 +149,9 @@ class CloudflareChatConfig(BaseConfig):
) -> ModelResponse:
completion_response = raw_response.json()
- model_response.choices[0].message.content = completion_response["result"][ # type: ignore
- "response"
- ]
+ # Support both "response" and "response_text" keys (newer models like Nemotron use "response_text")
+ result = completion_response["result"]
+ model_response.choices[0].message.content = result.get("response") if result.get("response") is not None else result.get("response_text", "") # type: ignore
prompt_tokens = litellm.utils.get_token_count(messages=messages, model=model)
completion_tokens = len(
@@ -199,8 +201,10 @@ class CloudflareChatResponseIterator(BaseModelResponseIterator):
index = int(chunk.get("index", 0))
- if "response" in chunk:
+ if "response" in chunk and chunk["response"] is not None:
text = chunk["response"]
+ elif "response_text" in chunk and chunk["response_text"] is not None:
+ text = chunk["response_text"]
returned_chunk = GenericStreamingChunk(
text=text,
diff --git a/litellm/llms/custom_httpx/container_handler.py b/litellm/llms/custom_httpx/container_handler.py
index afdd7bc6a8..599cd705eb 100644
--- a/litellm/llms/custom_httpx/container_handler.py
+++ b/litellm/llms/custom_httpx/container_handler.py
@@ -12,6 +12,7 @@ from typing import TYPE_CHECKING, Any, Coroutine, Dict, Optional, Type, Union
import httpx
import litellm
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.custom_httpx.http_handler import (
AsyncHTTPHandler,
HTTPHandler,
@@ -72,7 +73,8 @@ def _build_url(
# Substitute path parameters
for param, value in path_params.items():
- path_template = path_template.replace(f"{{{param}}}", value)
+ encoded_value = encode_url_path_segment(value, field_name=param)
+ path_template = path_template.replace(f"{{{param}}}", encoded_value)
# Parse the api_base to extract existing query params
parsed_base = httpx.URL(api_base)
diff --git a/litellm/llms/custom_httpx/llm_http_handler.py b/litellm/llms/custom_httpx/llm_http_handler.py
index dc625918b9..2ffc7acbfb 100644
--- a/litellm/llms/custom_httpx/llm_http_handler.py
+++ b/litellm/llms/custom_httpx/llm_http_handler.py
@@ -26,6 +26,7 @@ from litellm._logging import _redact_string, verbose_logger
from litellm.anthropic_beta_headers_manager import update_headers_with_filtered_beta
from litellm.constants import REALTIME_WEBSOCKET_MAX_MESSAGE_SIZE_BYTES
from litellm.litellm_core_utils.realtime_streaming import RealTimeStreaming
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.anthropic_messages.transformation import (
BaseAnthropicMessagesConfig,
)
@@ -5578,6 +5579,9 @@ class BaseLLMHTTPHandler:
litellm_params=litellm_params,
headers=headers,
)
+ data = image_edit_provider_config.finalize_image_edit_request_data(
+ data, api_base
+ )
## LOGGING
logging_obj.pre_call(
@@ -5676,6 +5680,9 @@ class BaseLLMHTTPHandler:
litellm_params=litellm_params,
headers=headers,
)
+ data = image_edit_provider_config.finalize_image_edit_request_data(
+ data, api_base
+ )
## LOGGING
logging_obj.pre_call(
@@ -8948,7 +8955,10 @@ class BaseLLMHTTPHandler:
litellm_params=dict(litellm_params),
)
- url = f"{api_base}/{vector_store_id}"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}"
logging_obj.pre_call(
input="",
@@ -9015,7 +9025,10 @@ class BaseLLMHTTPHandler:
litellm_params=dict(litellm_params),
)
- url = f"{api_base}/{vector_store_id}"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}"
logging_obj.pre_call(
input="",
@@ -9214,7 +9227,10 @@ class BaseLLMHTTPHandler:
litellm_params=dict(litellm_params),
)
- url = f"{api_base}/{vector_store_id}"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}"
request_body: Dict[str, Any] = dict(vector_store_update_optional_params)
@@ -9297,7 +9313,10 @@ class BaseLLMHTTPHandler:
litellm_params=dict(litellm_params),
)
- url = f"{api_base}/{vector_store_id}"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}"
request_body: Dict[str, Any] = dict(vector_store_update_optional_params)
@@ -9363,7 +9382,10 @@ class BaseLLMHTTPHandler:
litellm_params=dict(litellm_params),
)
- url = f"{api_base}/{vector_store_id}"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}"
logging_obj.pre_call(
input="",
@@ -9428,7 +9450,10 @@ class BaseLLMHTTPHandler:
litellm_params=dict(litellm_params),
)
- url = f"{api_base}/{vector_store_id}"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}"
logging_obj.pre_call(
input="",
diff --git a/litellm/llms/databricks/chat/transformation.py b/litellm/llms/databricks/chat/transformation.py
index c086d4ad75..09c782a475 100644
--- a/litellm/llms/databricks/chat/transformation.py
+++ b/litellm/llms/databricks/chat/transformation.py
@@ -56,7 +56,10 @@ from litellm.types.utils import (
Usage,
)
-from ...anthropic.chat.transformation import AnthropicConfig
+from ...anthropic.chat.transformation import (
+ REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT,
+ AnthropicConfig,
+)
from ...openai_like.chat.transformation import OpenAILikeChatConfig
from ..common_utils import DatabricksBase, DatabricksException
@@ -330,9 +333,30 @@ class DatabricksConfig(DatabricksBase, OpenAILikeChatConfig, AnthropicConfig):
) # unsupported for claude models - if json_schema -> convert to tool call
if "reasoning_effort" in non_default_params and "claude" in model:
- optional_params["thinking"] = AnthropicConfig._map_reasoning_effort(
- reasoning_effort=non_default_params.get("reasoning_effort"), model=model
+ reasoning_effort_value = non_default_params.get("reasoning_effort")
+ mapped_thinking = AnthropicConfig._map_reasoning_effort(
+ reasoning_effort=reasoning_effort_value,
+ model=model,
+ llm_provider="databricks",
)
+ if mapped_thinking is None:
+ optional_params.pop("thinking", None)
+ optional_params.pop("output_config", None)
+ else:
+ optional_params["thinking"] = mapped_thinking
+ if AnthropicConfig._is_adaptive_thinking_model(model):
+ mapped_effort: Optional[str] = None
+ if isinstance(reasoning_effort_value, str):
+ mapped_effort = REASONING_EFFORT_TO_OUTPUT_CONFIG_EFFORT.get(
+ reasoning_effort_value
+ )
+ if mapped_effort is None:
+ AnthropicConfig._raise_invalid_reasoning_effort(
+ model=model,
+ value=reasoning_effort_value,
+ llm_provider="databricks",
+ )
+ optional_params["output_config"] = {"effort": mapped_effort}
optional_params.pop("reasoning_effort", None)
## handle thinking tokens
self.update_optional_params_with_thinking_tokens(
diff --git a/litellm/llms/elevenlabs/text_to_speech/transformation.py b/litellm/llms/elevenlabs/text_to_speech/transformation.py
index 4dac2b8ba9..6a59911701 100644
--- a/litellm/llms/elevenlabs/text_to_speech/transformation.py
+++ b/litellm/llms/elevenlabs/text_to_speech/transformation.py
@@ -11,13 +11,14 @@ import httpx
from httpx import Headers
import litellm
-from litellm.types.utils import all_litellm_params
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.llms.base_llm.text_to_speech.transformation import (
BaseTextToSpeechConfig,
TextToSpeechRequestData,
)
from litellm.secret_managers.main import get_secret_str
+from litellm.types.utils import all_litellm_params
from ..common_utils import ElevenLabsException
@@ -321,7 +322,8 @@ class ElevenLabsTextToSpeechConfig(BaseTextToSpeechConfig):
"ElevenLabs voice_id is required. Pass `voice` when calling `litellm.speech()`."
)
- url = f"{base_url}{self.TTS_ENDPOINT_PATH}/{voice_id}"
+ encoded_voice_id = encode_url_path_segment(voice_id, field_name="voice_id")
+ url = f"{base_url}{self.TTS_ENDPOINT_PATH}/{encoded_voice_id}"
query_params = litellm_params.get(self.ELEVENLABS_QUERY_PARAMS_KEY, {})
if query_params:
diff --git a/litellm/llms/gemini/files/transformation.py b/litellm/llms/gemini/files/transformation.py
index 401d7bb9f4..63a383ebd3 100644
--- a/litellm/llms/gemini/files/transformation.py
+++ b/litellm/llms/gemini/files/transformation.py
@@ -12,6 +12,7 @@ import httpx
from openai.types.file_deleted import FileDeleted
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.prompt_templates.common_utils import extract_file_data
from litellm.llms.base_llm.files.transformation import (
BaseFilesConfig,
@@ -258,10 +259,14 @@ class GoogleAIStudioFilesHandler(GeminiModelInfo, BaseFilesConfig):
normalized_file_id = file_id
normalized_file_id = normalized_file_id.strip("/")
- if not normalized_file_id.startswith("files/"):
- normalized_file_id = f"files/{normalized_file_id}"
+ if normalized_file_id.startswith("files/"):
+ normalized_file_id = normalized_file_id.removeprefix("files/")
- return normalized_file_id
+ encoded_file_id = encode_url_path_segment(
+ normalized_file_id, field_name="file_id"
+ )
+
+ return f"files/{encoded_file_id}"
def transform_retrieve_file_response(
self,
@@ -337,13 +342,8 @@ class GoogleAIStudioFilesHandler(GeminiModelInfo, BaseFilesConfig):
if not api_key:
raise ValueError("api_key is required")
- # Extract file name from URI if full URI is provided
- # file_id could be "files/abc123" or "https://generativelanguage.googleapis.com/v1beta/files/abc123"
- if file_id.startswith("http"):
- # Extract the file path from full URI
- file_name = file_id.split("/v1beta/")[-1]
- else:
- file_name = file_id if file_id.startswith("files/") else f"files/{file_id}"
+ # Normalize and encode the file name before interpolating it into the URL.
+ file_name = self._normalize_gemini_file_id(file_id)
# Construct the delete URL
url = f"{api_base}/v1beta/{file_name}"
diff --git a/litellm/llms/gemini/interactions/transformation.py b/litellm/llms/gemini/interactions/transformation.py
index c34da83cb8..593cbf7c2c 100644
--- a/litellm/llms/gemini/interactions/transformation.py
+++ b/litellm/llms/gemini/interactions/transformation.py
@@ -15,6 +15,7 @@ import httpx
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.core_helpers import process_response_headers
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.interactions.transformation import BaseInteractionsAPIConfig
from litellm.llms.gemini.common_utils import GeminiError, GeminiModelInfo
from litellm.types.interactions import (
@@ -205,8 +206,11 @@ class GoogleAIStudioInteractionsConfig(BaseInteractionsAPIConfig):
resolved_api_base = GeminiModelInfo.get_api_base(api_base)
if not GeminiModelInfo.get_api_key(litellm_params.api_key):
raise ValueError("Google API key is required")
+ encoded_interaction_id = encode_url_path_segment(
+ interaction_id, field_name="interaction_id"
+ )
return (
- f"{resolved_api_base}/{self.api_version}/interactions/{interaction_id}",
+ f"{resolved_api_base}/{self.api_version}/interactions/{encoded_interaction_id}",
{},
)
@@ -238,8 +242,11 @@ class GoogleAIStudioInteractionsConfig(BaseInteractionsAPIConfig):
resolved_api_base = GeminiModelInfo.get_api_base(api_base)
if not GeminiModelInfo.get_api_key(litellm_params.api_key):
raise ValueError("Google API key is required")
+ encoded_interaction_id = encode_url_path_segment(
+ interaction_id, field_name="interaction_id"
+ )
return (
- f"{resolved_api_base}/{self.api_version}/interactions/{interaction_id}",
+ f"{resolved_api_base}/{self.api_version}/interactions/{encoded_interaction_id}",
{},
)
@@ -268,8 +275,11 @@ class GoogleAIStudioInteractionsConfig(BaseInteractionsAPIConfig):
resolved_api_base = GeminiModelInfo.get_api_base(api_base)
if not GeminiModelInfo.get_api_key(litellm_params.api_key):
raise ValueError("Google API key is required")
+ encoded_interaction_id = encode_url_path_segment(
+ interaction_id, field_name="interaction_id"
+ )
return (
- f"{resolved_api_base}/{self.api_version}/interactions/{interaction_id}:cancel",
+ f"{resolved_api_base}/{self.api_version}/interactions/{encoded_interaction_id}:cancel",
{},
)
diff --git a/litellm/llms/hosted_vllm/embedding/README.md b/litellm/llms/hosted_vllm/embedding/README.md
index f82b3c77a6..2c58e16fc2 100644
--- a/litellm/llms/hosted_vllm/embedding/README.md
+++ b/litellm/llms/hosted_vllm/embedding/README.md
@@ -2,4 +2,15 @@ No transformation is required for hosted_vllm embedding.
VLLM is a superset of OpenAI's `embedding` endpoint.
-To pass provider-specific parameters, see [this](https://docs.litellm.ai/docs/completion/provider_specific_params)
\ No newline at end of file
+## `encoding_format`
+
+For OpenAI-compatible embedding calls (including `openai/...` with a custom `api_base` pointing at vLLM), LiteLLM resolves `encoding_format` when it is not set on the request:
+
+1. Explicit value on the embedding call (`encoding_format=...`).
+2. Model config (`litellm_params.encoding_format` on the proxy `model_list` entry).
+3. Environment variable `LITELLM_DEFAULT_EMBEDDING_ENCODING_FORMAT` (e.g. in `.env` or container env).
+4. Default **`float`**.
+
+That avoids forwarding `encoding_format=None` to the provider/SDK where some servers behave poorly.
+
+To pass provider-specific parameters, see [provider-specific params](https://docs.litellm.ai/docs/completion/provider_specific_params).
\ No newline at end of file
diff --git a/litellm/llms/litellm_proxy/skills/handler.py b/litellm/llms/litellm_proxy/skills/handler.py
index 8e5070c272..37aabd8b47 100644
--- a/litellm/llms/litellm_proxy/skills/handler.py
+++ b/litellm/llms/litellm_proxy/skills/handler.py
@@ -9,42 +9,47 @@ import uuid
from typing import Any, Dict, List, Optional
from litellm._logging import verbose_logger
-from litellm.proxy._types import LiteLLM_SkillsTable, NewSkillRequest
+from litellm.caching.in_memory_cache import InMemoryCache
+from litellm.proxy._types import LiteLLM_SkillsTable, NewSkillRequest, UserAPIKeyAuth
+from litellm.proxy.common_utils.resource_ownership import (
+ get_primary_resource_owner_scope,
+ get_resource_owner_scopes,
+ is_proxy_admin,
+ user_can_access_resource_owner,
+)
+
+# Skills are looked up on every chat completion that has skills enabled
+# (`SkillsInjectionHook` calls ``fetch_skill_from_db``). 60s LRU/TTL cache
+# absorbs the hot read before it reaches Prisma. ``_NEGATIVE_SKILL_SENTINEL``
+# lets us cache a true "skill does not exist" so repeated misses also
+# avoid the DB — ``InMemoryCache`` returns ``None`` indistinguishably for
+# "miss" and "cached as None".
+_NEGATIVE_SKILL_SENTINEL = "__litellm_skill_not_found__"
+_SKILL_CACHE = InMemoryCache(max_size_in_memory=10000, default_ttl=60)
def _prisma_skill_to_litellm(prisma_skill) -> LiteLLM_SkillsTable:
- """
- Convert a Prisma skill record to LiteLLM_SkillsTable.
+ """Convert a Prisma skill record to LiteLLM_SkillsTable.
- Handles Base64 decoding of file_content field.
+ Handles Base64 decoding of file_content field — model_dump() converts
+ Base64 fields to base64-encoded strings.
"""
import base64
data = prisma_skill.model_dump()
- # Decode Base64 file_content back to bytes
- # model_dump() converts Base64 field to base64-encoded string
if data.get("file_content") is not None:
if isinstance(data["file_content"], str):
data["file_content"] = base64.b64decode(data["file_content"])
- elif isinstance(data["file_content"], bytes):
- # Already bytes, no conversion needed
- pass
return LiteLLM_SkillsTable(**data)
class LiteLLMSkillsHandler:
- """
- Handler for LiteLLM database-backed skills operations.
-
- This class provides static methods for CRUD operations on skills
- stored in the LiteLLM proxy database (LiteLLM_SkillsTable).
- """
+ """CRUD for skills stored in ``litellm_skillstable``."""
@staticmethod
async def _get_prisma_client():
- """Get the prisma client from proxy server."""
from litellm.proxy.proxy_server import prisma_client
if prisma_client is None:
@@ -58,20 +63,21 @@ class LiteLLMSkillsHandler:
async def create_skill(
data: NewSkillRequest,
user_id: Optional[str] = None,
+ user_api_key_dict: Optional[UserAPIKeyAuth] = None,
) -> LiteLLM_SkillsTable:
- """
- Create a new skill in the LiteLLM database.
-
- Args:
- data: NewSkillRequest with skill details
- user_id: Optional user ID for tracking
-
- Returns:
- LiteLLM_SkillsTable record
- """
prisma_client = await LiteLLMSkillsHandler._get_prisma_client()
skill_id = f"litellm_skill_{uuid.uuid4()}"
+ owner = get_primary_resource_owner_scope(user_api_key_dict) or user_id
+ if owner is None:
+ # Identity-less callers (no user_id / team_id / org_id /
+ # api_key / token) can't be uniquely stamped on the row.
+ # Stamping a placeholder would let any two such callers see
+ # each other's skills via the shared owner. ValueError keeps
+ # this module FastAPI-free per the project layering rule.
+ raise ValueError(
+ "Unable to record skill ownership: caller has no identity scope."
+ )
skill_data: Dict[str, Any] = {
"skill_id": skill_id,
@@ -79,17 +85,15 @@ class LiteLLMSkillsHandler:
"description": data.description,
"instructions": data.instructions,
"source": "custom",
- "created_by": user_id,
- "updated_by": user_id,
+ "created_by": owner,
+ "updated_by": owner,
}
- # Handle metadata
if data.metadata is not None:
from litellm.litellm_core_utils.safe_json_dumps import safe_dumps
skill_data["metadata"] = safe_dumps(data.metadata)
- # Handle file content - wrap bytes in Base64 for Prisma
if data.file_content is not None:
from prisma.fields import Base64
@@ -104,112 +108,103 @@ class LiteLLMSkillsHandler:
)
new_skill = await prisma_client.db.litellm_skillstable.create(data=skill_data)
-
return _prisma_skill_to_litellm(new_skill)
@staticmethod
async def list_skills(
limit: int = 20,
offset: int = 0,
+ user_api_key_dict: Optional[UserAPIKeyAuth] = None,
) -> List[LiteLLM_SkillsTable]:
- """
- List skills from the LiteLLM database.
-
- Args:
- limit: Maximum number of skills to return
- offset: Number of skills to skip
-
- Returns:
- List of LiteLLM_SkillsTable records
- """
prisma_client = await LiteLLMSkillsHandler._get_prisma_client()
verbose_logger.debug(
f"LiteLLMSkillsHandler: Listing skills with limit={limit}, offset={offset}"
)
- skills = await prisma_client.db.litellm_skillstable.find_many(
- take=limit,
- skip=offset,
- order={"created_at": "desc"},
- )
+ find_many_kwargs: Dict[str, Any] = {
+ "take": limit,
+ "skip": offset,
+ "order": {"created_at": "desc"},
+ }
+ if user_api_key_dict is not None and not is_proxy_admin(user_api_key_dict):
+ owner_scopes = get_resource_owner_scopes(user_api_key_dict)
+ if not owner_scopes:
+ return []
+ find_many_kwargs["where"] = {"created_by": {"in": owner_scopes}}
+ skills = await prisma_client.db.litellm_skillstable.find_many(
+ **find_many_kwargs
+ )
return [_prisma_skill_to_litellm(s) for s in skills]
@staticmethod
- async def get_skill(skill_id: str) -> LiteLLM_SkillsTable:
+ async def _load_skill(skill_id: str) -> Optional[Any]:
+ """Cache-first read of the Prisma skill row. Owner-scope filtering
+ happens on the cached row, so the cache is per-skill not per-caller.
"""
- Get a skill by ID from the LiteLLM database.
+ cached = _SKILL_CACHE.get_cache(skill_id)
+ if cached == _NEGATIVE_SKILL_SENTINEL:
+ return None
+ if cached is not None:
+ return cached
- Args:
- skill_id: The skill ID to retrieve
-
- Returns:
- LiteLLM_SkillsTable record
-
- Raises:
- ValueError: If skill not found
- """
prisma_client = await LiteLLMSkillsHandler._get_prisma_client()
-
- verbose_logger.debug(f"LiteLLMSkillsHandler: Getting skill {skill_id}")
-
skill = await prisma_client.db.litellm_skillstable.find_unique(
where={"skill_id": skill_id}
)
+ _SKILL_CACHE.set_cache(
+ skill_id, skill if skill is not None else _NEGATIVE_SKILL_SENTINEL
+ )
+ return skill
- if skill is None:
+ @staticmethod
+ async def get_skill(
+ skill_id: str,
+ user_api_key_dict: Optional[UserAPIKeyAuth] = None,
+ ) -> LiteLLM_SkillsTable:
+ verbose_logger.debug(f"LiteLLMSkillsHandler: Getting skill {skill_id}")
+
+ skill = await LiteLLMSkillsHandler._load_skill(skill_id)
+ # Same "not found" message for both "missing" and "cross-tenant"
+ # so callers can't enumerate skill IDs they don't own.
+ if skill is None or not user_can_access_resource_owner(
+ getattr(skill, "created_by", None), user_api_key_dict
+ ):
raise ValueError(f"Skill not found: {skill_id}")
return _prisma_skill_to_litellm(skill)
@staticmethod
- async def delete_skill(skill_id: str) -> Dict[str, str]:
- """
- Delete a skill by ID from the LiteLLM database.
-
- Args:
- skill_id: The skill ID to delete
-
- Returns:
- Dict with id and type of deleted skill
-
- Raises:
- ValueError: If skill not found
- """
+ async def delete_skill(
+ skill_id: str,
+ user_api_key_dict: Optional[UserAPIKeyAuth] = None,
+ ) -> Dict[str, str]:
prisma_client = await LiteLLMSkillsHandler._get_prisma_client()
-
verbose_logger.debug(f"LiteLLMSkillsHandler: Deleting skill {skill_id}")
- # Check if skill exists
- skill = await prisma_client.db.litellm_skillstable.find_unique(
- where={"skill_id": skill_id}
- )
-
- if skill is None:
+ skill = await LiteLLMSkillsHandler._load_skill(skill_id)
+ if skill is None or not user_can_access_resource_owner(
+ getattr(skill, "created_by", None), user_api_key_dict
+ ):
raise ValueError(f"Skill not found: {skill_id}")
- # Delete the skill
await prisma_client.db.litellm_skillstable.delete(where={"skill_id": skill_id})
+ _SKILL_CACHE.set_cache(skill_id, _NEGATIVE_SKILL_SENTINEL)
return {"id": skill_id, "type": "skill_deleted"}
@staticmethod
- async def fetch_skill_from_db(skill_id: str) -> Optional[LiteLLM_SkillsTable]:
- """
- Fetch a skill from the database (used by skills injection hook).
-
- This is a convenience method that returns None instead of raising
- an exception if the skill is not found.
-
- Args:
- skill_id: The skill ID to fetch
-
- Returns:
- LiteLLM_SkillsTable or None if not found
- """
+ async def fetch_skill_from_db(
+ skill_id: str,
+ user_api_key_dict: Optional[UserAPIKeyAuth] = None,
+ ) -> Optional[LiteLLM_SkillsTable]:
+ """Skills-injection-hook helper: returns None instead of raising on
+ not-found / not-authorized so the hook can silently skip."""
try:
- return await LiteLLMSkillsHandler.get_skill(skill_id)
+ return await LiteLLMSkillsHandler.get_skill(
+ skill_id, user_api_key_dict=user_api_key_dict
+ )
except ValueError:
return None
except Exception as e:
diff --git a/litellm/llms/litellm_proxy/skills/transformation.py b/litellm/llms/litellm_proxy/skills/transformation.py
index 4622bda4e8..199f13191f 100644
--- a/litellm/llms/litellm_proxy/skills/transformation.py
+++ b/litellm/llms/litellm_proxy/skills/transformation.py
@@ -18,6 +18,7 @@ from litellm.types.utils import LlmProviders
if TYPE_CHECKING:
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
+ from litellm.proxy._types import UserAPIKeyAuth
class LiteLLMSkillsTransformationHandler:
@@ -44,6 +45,7 @@ class LiteLLMSkillsTransformationHandler:
file_type: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
user_id: Optional[str] = None,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
_is_async: bool = False,
logging_obj: Optional["LiteLLMLoggingObj"] = None,
litellm_call_id: Optional[str] = None,
@@ -99,6 +101,7 @@ class LiteLLMSkillsTransformationHandler:
file_type=file_type,
metadata=metadata,
user_id=user_id,
+ user_api_key_dict=user_api_key_dict,
)
import asyncio
@@ -113,6 +116,7 @@ class LiteLLMSkillsTransformationHandler:
file_type=file_type,
metadata=metadata,
user_id=user_id,
+ user_api_key_dict=user_api_key_dict,
)
)
@@ -126,6 +130,7 @@ class LiteLLMSkillsTransformationHandler:
file_type: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
user_id: Optional[str] = None,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
) -> Skill:
"""Async implementation of create_skill."""
# Lazy import to avoid SDK dependency on proxy
@@ -145,6 +150,7 @@ class LiteLLMSkillsTransformationHandler:
db_skill = await LiteLLMSkillsHandler.create_skill(
data=skill_request,
user_id=user_id,
+ user_api_key_dict=user_api_key_dict,
)
return self._db_skill_to_response(db_skill)
@@ -156,6 +162,7 @@ class LiteLLMSkillsTransformationHandler:
_is_async: bool = False,
logging_obj: Optional["LiteLLMLoggingObj"] = None,
litellm_call_id: Optional[str] = None,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
**kwargs,
) -> Union[ListSkillsResponse, Coroutine[Any, Any, ListSkillsResponse]]:
"""
@@ -182,18 +189,27 @@ class LiteLLMSkillsTransformationHandler:
)
if _is_async:
- return self._async_list_skills(limit=limit, offset=offset)
+ return self._async_list_skills(
+ limit=limit,
+ offset=offset,
+ user_api_key_dict=user_api_key_dict,
+ )
import asyncio
return asyncio.get_event_loop().run_until_complete(
- self._async_list_skills(limit=limit, offset=offset)
+ self._async_list_skills(
+ limit=limit,
+ offset=offset,
+ user_api_key_dict=user_api_key_dict,
+ )
)
async def _async_list_skills(
self,
limit: int = 20,
offset: int = 0,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
) -> ListSkillsResponse:
"""Async implementation of list_skills."""
# Lazy import to avoid SDK dependency on proxy
@@ -202,6 +218,7 @@ class LiteLLMSkillsTransformationHandler:
db_skills = await LiteLLMSkillsHandler.list_skills(
limit=limit,
offset=offset,
+ user_api_key_dict=user_api_key_dict,
)
skills = [self._db_skill_to_response(s) for s in db_skills]
@@ -217,6 +234,7 @@ class LiteLLMSkillsTransformationHandler:
_is_async: bool = False,
logging_obj: Optional["LiteLLMLoggingObj"] = None,
litellm_call_id: Optional[str] = None,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
**kwargs,
) -> Union[Skill, Coroutine[Any, Any, Skill]]:
"""
@@ -242,20 +260,33 @@ class LiteLLMSkillsTransformationHandler:
)
if _is_async:
- return self._async_get_skill(skill_id=skill_id)
+ return self._async_get_skill(
+ skill_id=skill_id,
+ user_api_key_dict=user_api_key_dict,
+ )
import asyncio
return asyncio.get_event_loop().run_until_complete(
- self._async_get_skill(skill_id=skill_id)
+ self._async_get_skill(
+ skill_id=skill_id,
+ user_api_key_dict=user_api_key_dict,
+ )
)
- async def _async_get_skill(self, skill_id: str) -> Skill:
+ async def _async_get_skill(
+ self,
+ skill_id: str,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
+ ) -> Skill:
"""Async implementation of get_skill."""
# Lazy import to avoid SDK dependency on proxy
from litellm.llms.litellm_proxy.skills.handler import LiteLLMSkillsHandler
- db_skill = await LiteLLMSkillsHandler.get_skill(skill_id=skill_id)
+ db_skill = await LiteLLMSkillsHandler.get_skill(
+ skill_id=skill_id,
+ user_api_key_dict=user_api_key_dict,
+ )
return self._db_skill_to_response(db_skill)
def delete_skill_handler(
@@ -264,6 +295,7 @@ class LiteLLMSkillsTransformationHandler:
_is_async: bool = False,
logging_obj: Optional["LiteLLMLoggingObj"] = None,
litellm_call_id: Optional[str] = None,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
**kwargs,
) -> Union[DeleteSkillResponse, Coroutine[Any, Any, DeleteSkillResponse]]:
"""
@@ -289,20 +321,33 @@ class LiteLLMSkillsTransformationHandler:
)
if _is_async:
- return self._async_delete_skill(skill_id=skill_id)
+ return self._async_delete_skill(
+ skill_id=skill_id,
+ user_api_key_dict=user_api_key_dict,
+ )
import asyncio
return asyncio.get_event_loop().run_until_complete(
- self._async_delete_skill(skill_id=skill_id)
+ self._async_delete_skill(
+ skill_id=skill_id,
+ user_api_key_dict=user_api_key_dict,
+ )
)
- async def _async_delete_skill(self, skill_id: str) -> DeleteSkillResponse:
+ async def _async_delete_skill(
+ self,
+ skill_id: str,
+ user_api_key_dict: Optional["UserAPIKeyAuth"] = None,
+ ) -> DeleteSkillResponse:
"""Async implementation of delete_skill."""
# Lazy import to avoid SDK dependency on proxy
from litellm.llms.litellm_proxy.skills.handler import LiteLLMSkillsHandler
- result = await LiteLLMSkillsHandler.delete_skill(skill_id=skill_id)
+ result = await LiteLLMSkillsHandler.delete_skill(
+ skill_id=skill_id,
+ user_api_key_dict=user_api_key_dict,
+ )
return DeleteSkillResponse(
id=result["id"],
type=result.get("type", "skill_deleted"),
diff --git a/litellm/llms/manus/files/transformation.py b/litellm/llms/manus/files/transformation.py
index 3381a5327e..3416616139 100644
--- a/litellm/llms/manus/files/transformation.py
+++ b/litellm/llms/manus/files/transformation.py
@@ -18,6 +18,7 @@ from openai.types.file_deleted import FileDeleted
import litellm
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.prompt_templates.common_utils import extract_file_data
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.llms.base_llm.files.transformation import (
@@ -306,7 +307,8 @@ class ManusFilesConfig(BaseFilesConfig):
optional_params=optional_params,
litellm_params=litellm_params,
)
- return f"{api_base}/{file_id}", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}", {}
def transform_retrieve_file_response(
self,
@@ -336,7 +338,8 @@ class ManusFilesConfig(BaseFilesConfig):
optional_params=optional_params,
litellm_params=litellm_params,
)
- return f"{api_base}/{file_id}", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}", {}
def transform_delete_file_response(
self,
@@ -422,7 +425,8 @@ class ManusFilesConfig(BaseFilesConfig):
optional_params=optional_params,
litellm_params=litellm_params,
)
- return f"{api_base}/{file_id}/content", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}/content", {}
def transform_file_content_response(
self,
diff --git a/litellm/llms/manus/responses/transformation.py b/litellm/llms/manus/responses/transformation.py
index 510c41304a..b3a0073a5c 100644
--- a/litellm/llms/manus/responses/transformation.py
+++ b/litellm/llms/manus/responses/transformation.py
@@ -6,6 +6,7 @@ import httpx
import litellm
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.core_helpers import process_response_headers
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.llm_response_utils.convert_dict_to_response import (
_safe_convert_created_field,
)
@@ -270,7 +271,10 @@ class ManusResponsesAPIConfig(OpenAIResponsesAPIConfig):
Reference: https://open.manus.im/docs/openai-compatibility
"""
- url = f"{api_base}/{response_id}"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}"
data: Dict = {}
return url, data
diff --git a/litellm/llms/openai/chat/gpt_5_transformation.py b/litellm/llms/openai/chat/gpt_5_transformation.py
index 34941a545e..4e34d10b18 100644
--- a/litellm/llms/openai/chat/gpt_5_transformation.py
+++ b/litellm/llms/openai/chat/gpt_5_transformation.py
@@ -244,9 +244,11 @@ class OpenAIGPT5Config(OpenAIGPTConfig):
),
status_code=400,
)
- elif effective_effort == "minimal":
- # minimal is opt-out: unknown models pass through; only block when
- # the model map explicitly sets supports_minimal_reasoning_effort=false.
+ elif effective_effort in ("minimal", "low"):
+ # minimal/low are opt-out: unknown models pass through; only block when
+ # the model map explicitly sets supports_{level}_reasoning_effort=false.
+ # Example: gpt-5.5-pro only accepts {medium, high, xhigh}, so it sets
+ # supports_low_reasoning_effort=false (and supports_minimal=false).
if self._is_reasoning_effort_level_explicitly_disabled(
model, effective_effort
):
diff --git a/litellm/llms/openai/containers/transformation.py b/litellm/llms/openai/containers/transformation.py
index 955b9f760d..7f874ffd3b 100644
--- a/litellm/llms/openai/containers/transformation.py
+++ b/litellm/llms/openai/containers/transformation.py
@@ -6,6 +6,7 @@ import litellm
from litellm.litellm_core_utils.llm_cost_calc.tool_call_cost_tracking import (
StandardBuiltInToolCostTracking,
)
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.secret_managers.main import get_secret_str
from litellm.types.containers.main import (
ContainerCreateOptionalRequestParams,
@@ -198,7 +199,10 @@ class OpenAIContainerConfig(BaseContainerConfig):
) -> Tuple[str, Dict]:
"""Transform the OpenAI container retrieve request."""
# For container retrieve, we just need to construct the URL
- url = join_container_api_base_path(api_base, f"/{container_id}")
+ encoded_container_id = encode_url_path_segment(
+ container_id, field_name="container_id"
+ )
+ url = join_container_api_base_path(api_base, f"/{encoded_container_id}")
# No additional data needed for GET request
data: Dict[str, Any] = {}
@@ -230,7 +234,10 @@ class OpenAIContainerConfig(BaseContainerConfig):
- DELETE /v1/containers/{container_id}
"""
# Construct the URL for container delete
- url = join_container_api_base_path(api_base, f"/{container_id}")
+ encoded_container_id = encode_url_path_segment(
+ container_id, field_name="container_id"
+ )
+ url = join_container_api_base_path(api_base, f"/{encoded_container_id}")
# No data needed for DELETE request
data: Dict[str, Any] = {}
@@ -267,7 +274,10 @@ class OpenAIContainerConfig(BaseContainerConfig):
- GET /v1/containers/{container_id}/files
"""
# Construct the URL for container files
- url = join_container_api_base_path(api_base, f"/{container_id}/files")
+ encoded_container_id = encode_url_path_segment(
+ container_id, field_name="container_id"
+ )
+ url = join_container_api_base_path(api_base, f"/{encoded_container_id}/files")
# Prepare query parameters
params: Dict[str, Any] = {}
@@ -311,8 +321,12 @@ class OpenAIContainerConfig(BaseContainerConfig):
- GET /v1/containers/{container_id}/files/{file_id}/content
"""
# Construct the URL for container file content
+ encoded_container_id = encode_url_path_segment(
+ container_id, field_name="container_id"
+ )
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
url = join_container_api_base_path(
- api_base, f"/{container_id}/files/{file_id}/content"
+ api_base, f"/{encoded_container_id}/files/{encoded_file_id}/content"
)
# No query parameters needed
diff --git a/litellm/llms/openai/evals/transformation.py b/litellm/llms/openai/evals/transformation.py
index c24dbf8637..66537e56a6 100644
--- a/litellm/llms/openai/evals/transformation.py
+++ b/litellm/llms/openai/evals/transformation.py
@@ -7,6 +7,7 @@ from typing import Any, Dict, Optional, Tuple
import httpx
from litellm._logging import verbose_logger
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.evals.transformation import (
BaseEvalsAPIConfig,
LiteLLMLoggingObj,
@@ -76,7 +77,8 @@ class OpenAIEvalsConfig(BaseEvalsAPIConfig):
api_base = "https://api.openai.com"
if eval_id:
- return f"{api_base}/v1/evals/{eval_id}"
+ encoded_eval_id = encode_url_path_segment(eval_id, field_name="eval_id")
+ return f"{api_base}/v1/evals/{encoded_eval_id}"
return f"{api_base}/v1/{endpoint}"
def transform_create_eval_request(
@@ -276,7 +278,8 @@ class OpenAIEvalsConfig(BaseEvalsAPIConfig):
if litellm_params and litellm_params.api_base:
api_base = litellm_params.api_base
- url = f"{api_base}/v1/evals/{eval_id}/runs"
+ encoded_eval_id = encode_url_path_segment(eval_id, field_name="eval_id")
+ url = f"{api_base}/v1/evals/{encoded_eval_id}/runs"
# Build request body
request_body = {k: v for k, v in create_request.items() if v is not None}
@@ -310,7 +313,8 @@ class OpenAIEvalsConfig(BaseEvalsAPIConfig):
if litellm_params and litellm_params.api_base:
api_base = litellm_params.api_base
- url = f"{api_base}/v1/evals/{eval_id}/runs"
+ encoded_eval_id = encode_url_path_segment(eval_id, field_name="eval_id")
+ url = f"{api_base}/v1/evals/{encoded_eval_id}/runs"
# Build query parameters
query_params: Dict[str, Any] = {}
@@ -350,7 +354,9 @@ class OpenAIEvalsConfig(BaseEvalsAPIConfig):
headers: dict,
) -> Tuple[str, Dict]:
"""Transform get run request for OpenAI"""
- url = f"{api_base}/v1/evals/{eval_id}/runs/{run_id}"
+ encoded_eval_id = encode_url_path_segment(eval_id, field_name="eval_id")
+ encoded_run_id = encode_url_path_segment(run_id, field_name="run_id")
+ url = f"{api_base}/v1/evals/{encoded_eval_id}/runs/{encoded_run_id}"
verbose_logger.debug("Get run request - URL: %s", url)
@@ -376,7 +382,9 @@ class OpenAIEvalsConfig(BaseEvalsAPIConfig):
headers: dict,
) -> Tuple[str, Dict, Dict]:
"""Transform cancel run request for OpenAI"""
- url = f"{api_base}/v1/evals/{eval_id}/runs/{run_id}/cancel"
+ encoded_eval_id = encode_url_path_segment(eval_id, field_name="eval_id")
+ encoded_run_id = encode_url_path_segment(run_id, field_name="run_id")
+ url = f"{api_base}/v1/evals/{encoded_eval_id}/runs/{encoded_run_id}/cancel"
# Empty body for cancel request
request_body: Dict[str, Any] = {}
@@ -405,7 +413,9 @@ class OpenAIEvalsConfig(BaseEvalsAPIConfig):
headers: dict,
) -> Tuple[str, Dict, Dict]:
"""Transform delete run request for OpenAI"""
- url = f"{api_base}/v1/evals/{eval_id}/runs/{run_id}"
+ encoded_eval_id = encode_url_path_segment(eval_id, field_name="eval_id")
+ encoded_run_id = encode_url_path_segment(run_id, field_name="run_id")
+ url = f"{api_base}/v1/evals/{encoded_eval_id}/runs/{encoded_run_id}"
# Empty body for delete request
request_body: Dict[str, Any] = {}
diff --git a/litellm/llms/openai/responses/transformation.py b/litellm/llms/openai/responses/transformation.py
index 87c502032c..b7d5340d8d 100644
--- a/litellm/llms/openai/responses/transformation.py
+++ b/litellm/llms/openai/responses/transformation.py
@@ -7,6 +7,7 @@ from pydantic import BaseModel, ValidationError
import litellm
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.core_helpers import process_response_headers
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.llm_response_utils.convert_dict_to_response import (
_safe_convert_created_field,
)
@@ -421,7 +422,10 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
OpenAI API expects the following request
- DELETE /v1/responses/{response_id}
"""
- url = f"{api_base}/{response_id}"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}"
data: Dict = {}
return url, data
@@ -457,7 +461,10 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
OpenAI API expects the following request
- GET /v1/responses/{response_id}
"""
- url = f"{api_base}/{response_id}"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}"
data: Dict = {}
return url, data
@@ -498,7 +505,10 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
limit: int = 20,
order: Literal["asc", "desc"] = "desc",
) -> Tuple[str, Dict]:
- url = f"{api_base}/{response_id}/input_items"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}/input_items"
params: Dict[str, Any] = {}
if after is not None:
params["after"] = after
@@ -540,7 +550,10 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
OpenAI API expects the following request
- POST /v1/responses/{response_id}/cancel
"""
- url = f"{api_base}/{response_id}/cancel"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}/cancel"
data: Dict = {}
return url, data
diff --git a/litellm/llms/openai/vector_store_files/transformation.py b/litellm/llms/openai/vector_store_files/transformation.py
index cd5f10251b..52202f57fd 100644
--- a/litellm/llms/openai/vector_store_files/transformation.py
+++ b/litellm/llms/openai/vector_store_files/transformation.py
@@ -3,6 +3,7 @@ from typing import Any, Dict, Optional, Tuple, cast
import httpx
import litellm
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.vector_store_files.transformation import (
BaseVectorStoreFilesConfig,
)
@@ -98,7 +99,10 @@ class OpenAIVectorStoreFilesConfig(BaseVectorStoreFilesConfig):
or "https://api.openai.com/v1"
)
base_url = base_url.rstrip("/")
- return f"{base_url}/vector_stores/{vector_store_id}/files"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ return f"{base_url}/vector_stores/{encoded_vector_store_id}/files"
def transform_create_vector_store_file_request(
self,
@@ -163,7 +167,8 @@ class OpenAIVectorStoreFilesConfig(BaseVectorStoreFilesConfig):
file_id: str,
api_base: str,
) -> Tuple[str, Dict[str, Any]]:
- return f"{api_base}/{file_id}", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}", {}
def transform_retrieve_vector_store_file_response(
self,
@@ -186,7 +191,8 @@ class OpenAIVectorStoreFilesConfig(BaseVectorStoreFilesConfig):
file_id: str,
api_base: str,
) -> Tuple[str, Dict[str, Any]]:
- return f"{api_base}/{file_id}/content", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}/content", {}
def transform_retrieve_vector_store_file_content_response(
self,
@@ -218,7 +224,8 @@ class OpenAIVectorStoreFilesConfig(BaseVectorStoreFilesConfig):
payload["attributes"] = filtered_attributes
else:
payload.pop("attributes", None)
- return f"{api_base}/{file_id}", payload
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}", payload
def transform_update_vector_store_file_response(
self,
@@ -241,7 +248,8 @@ class OpenAIVectorStoreFilesConfig(BaseVectorStoreFilesConfig):
file_id: str,
api_base: str,
) -> Tuple[str, Dict[str, Any]]:
- return f"{api_base}/{file_id}", {}
+ encoded_file_id = encode_url_path_segment(file_id, field_name="file_id")
+ return f"{api_base}/{encoded_file_id}", {}
def transform_delete_vector_store_file_response(
self,
diff --git a/litellm/llms/openai/vector_stores/transformation.py b/litellm/llms/openai/vector_stores/transformation.py
index 2c11d13748..bd095a0a1b 100644
--- a/litellm/llms/openai/vector_stores/transformation.py
+++ b/litellm/llms/openai/vector_stores/transformation.py
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast
import httpx
import litellm
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.vector_store.transformation import BaseVectorStoreConfig
from litellm.secret_managers.main import get_secret_str
from litellm.types.router import GenericLiteLLMParams
@@ -108,7 +109,10 @@ class OpenAIVectorStoreConfig(BaseVectorStoreConfig):
litellm_params: dict,
extra_body: Optional[Dict[str, Any]] = None,
) -> Tuple[str, Dict]:
- url = f"{api_base}/{vector_store_id}/search"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}/search"
typed_request_body = VectorStoreSearchRequest(
query=query,
filters=vector_store_search_optional_params.get("filters", None),
diff --git a/litellm/llms/openai/videos/transformation.py b/litellm/llms/openai/videos/transformation.py
index 61baa56949..2d165a7d7d 100644
--- a/litellm/llms/openai/videos/transformation.py
+++ b/litellm/llms/openai/videos/transformation.py
@@ -1,11 +1,13 @@
import mimetypes
from io import BufferedReader, BytesIO
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast
+from urllib.parse import quote
import httpx
from httpx._types import RequestFiles
import litellm
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.videos.transformation import BaseVideoConfig
from litellm.llms.openai.image_edit.transformation import ImageEditRequestUtils
from litellm.secret_managers.main import get_secret_str
@@ -220,11 +222,18 @@ class OpenAIVideoConfig(BaseVideoConfig):
- GET /v1/videos/{video_id}/content?variant=thumbnail
"""
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# Construct the URL for video content download
- url = f"{api_base.rstrip('/')}/{original_video_id}/content"
+ url = f"{api_base.rstrip('/')}/{encoded_video_id}/content"
if variant is not None:
- url = f"{url}?variant={variant}"
+ # Encode the user-controlled ``variant`` so a value like
+ # ``thumbnail&extra=1`` cannot inject additional query params
+ # into the upstream request — same hardening rationale as the
+ # path-segment encoding above.
+ url = f"{url}?variant={quote(variant, safe='')}"
# No additional data needed for GET content request
data: Dict[str, Any] = {}
@@ -247,9 +256,12 @@ class OpenAIVideoConfig(BaseVideoConfig):
- POST /v1/videos/{video_id}/remix
"""
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# Construct the URL for video remix
- url = f"{api_base.rstrip('/')}/{original_video_id}/remix"
+ url = f"{api_base.rstrip('/')}/{encoded_video_id}/remix"
# Prepare the request data
data = {"prompt": prompt}
@@ -391,9 +403,12 @@ class OpenAIVideoConfig(BaseVideoConfig):
- DELETE /v1/videos/{video_id}
"""
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# Construct the URL for video delete
- url = f"{api_base.rstrip('/')}/{original_video_id}"
+ url = f"{api_base.rstrip('/')}/{encoded_video_id}"
# No data needed for DELETE request
data: Dict[str, Any] = {}
@@ -427,9 +442,12 @@ class OpenAIVideoConfig(BaseVideoConfig):
"""
# Extract the original video_id (remove provider encoding if present)
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# For video retrieve, we just need to construct the URL
- url = f"{api_base.rstrip('/')}/{original_video_id}"
+ url = f"{api_base.rstrip('/')}/{encoded_video_id}"
# No additional data needed for GET request
data: Dict[str, Any] = {}
@@ -494,7 +512,11 @@ class OpenAIVideoConfig(BaseVideoConfig):
litellm_params: GenericLiteLLMParams,
headers: dict,
) -> Tuple[str, Dict]:
- url = f"{api_base.rstrip('/')}/characters/{character_id}"
+ original_character_id = extract_original_character_id(character_id)
+ encoded_character_id = encode_url_path_segment(
+ original_character_id, field_name="character_id"
+ )
+ url = f"{api_base.rstrip('/')}/characters/{encoded_character_id}"
return url, {}
def transform_video_get_character_response(
diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.json
index 5dd1247001..b5e5aa4ea2 100644
--- a/litellm/llms/openai_like/providers.json
+++ b/litellm/llms/openai_like/providers.json
@@ -106,5 +106,13 @@
"base_url": "https://aihubmix.com/v1",
"api_key_env": "AIHUBMIX_API_KEY",
"api_base_env": "AIHUBMIX_API_BASE"
+ },
+ "crusoe": {
+ "base_url": "https://managed-inference-api-proxy.crusoecloud.com/v1",
+ "api_key_env": "CRUSOE_API_KEY",
+ "api_base_env": "CRUSOE_API_BASE",
+ "param_mappings": {
+ "max_completion_tokens": "max_tokens"
+ }
}
}
diff --git a/litellm/llms/pg_vector/vector_stores/transformation.py b/litellm/llms/pg_vector/vector_stores/transformation.py
index 7b22edd867..fc4cfc7b08 100644
--- a/litellm/llms/pg_vector/vector_stores/transformation.py
+++ b/litellm/llms/pg_vector/vector_stores/transformation.py
@@ -1,5 +1,6 @@
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.openai.vector_stores.transformation import OpenAIVectorStoreConfig
from litellm.secret_managers.main import get_secret_str
from litellm.types.router import GenericLiteLLMParams
@@ -82,7 +83,10 @@ class PGVectorStoreConfig(OpenAIVectorStoreConfig):
litellm_params: dict,
extra_body: Optional[Dict[str, Any]] = None,
) -> Tuple[str, Dict]:
- url = f"{api_base}/{vector_store_id}/search"
+ encoded_vector_store_id = encode_url_path_segment(
+ vector_store_id, field_name="vector_store_id"
+ )
+ url = f"{api_base}/{encoded_vector_store_id}/search"
_, request_body = super().transform_search_vector_store_request(
vector_store_id=vector_store_id,
query=query,
diff --git a/litellm/llms/ragflow/chat/transformation.py b/litellm/llms/ragflow/chat/transformation.py
index d49a5fd370..990fc2b2e6 100644
--- a/litellm/llms/ragflow/chat/transformation.py
+++ b/litellm/llms/ragflow/chat/transformation.py
@@ -13,6 +13,7 @@ Model name format:
from typing import List, Optional, Tuple
import litellm
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.openai.openai import OpenAIConfig
from litellm.secret_managers.main import get_secret, get_secret_str
from litellm.types.llms.openai import AllMessageValues
@@ -126,10 +127,11 @@ class RAGFlowConfig(OpenAIConfig):
api_base = api_base[:-3] # Remove /v1
# Construct the RAGFlow-specific path
+ encoded_entity_id = encode_url_path_segment(entity_id, field_name="entity_id")
if endpoint_type == "chat":
- path = f"/api/v1/chats_openai/{entity_id}/chat/completions"
+ path = f"/api/v1/chats_openai/{encoded_entity_id}/chat/completions"
else: # agent
- path = f"/api/v1/agents_openai/{entity_id}/chat/completions"
+ path = f"/api/v1/agents_openai/{encoded_entity_id}/chat/completions"
# Ensure path starts with /
if not path.startswith("/"):
diff --git a/litellm/llms/runwayml/videos/transformation.py b/litellm/llms/runwayml/videos/transformation.py
index 8377dea952..4f84816a2b 100644
--- a/litellm/llms/runwayml/videos/transformation.py
+++ b/litellm/llms/runwayml/videos/transformation.py
@@ -6,6 +6,7 @@ from httpx._types import RequestFiles
import litellm
from litellm.constants import RUNWAYML_DEFAULT_API_VERSION
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.llms.base_llm.videos.transformation import BaseVideoConfig
from litellm.llms.custom_httpx.http_handler import (
@@ -334,9 +335,12 @@ class RunwayMLVideoConfig(BaseVideoConfig):
We'll retrieve the task and extract the video URL.
"""
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# Get task status to retrieve video URL
- url = f"{api_base}/tasks/{original_video_id}"
+ url = f"{api_base}/tasks/{encoded_video_id}"
params: Dict[str, Any] = {}
@@ -495,9 +499,12 @@ class RunwayMLVideoConfig(BaseVideoConfig):
RunwayML uses task cancellation.
"""
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# Construct the URL for task cancellation
- url = f"{api_base}/tasks/{original_video_id}/cancel"
+ url = f"{api_base}/tasks/{encoded_video_id}/cancel"
data: Dict[str, Any] = {}
@@ -533,9 +540,12 @@ class RunwayMLVideoConfig(BaseVideoConfig):
RunwayML uses GET /v1/tasks/{task_id} to retrieve task status.
"""
original_video_id = extract_original_video_id(video_id)
+ encoded_video_id = encode_url_path_segment(
+ original_video_id, field_name="video_id"
+ )
# Construct the full URL for task status retrieval
- url = f"{api_base}/tasks/{original_video_id}"
+ url = f"{api_base}/tasks/{encoded_video_id}"
# Empty dict for GET request (no body)
data: Dict[str, Any] = {}
diff --git a/litellm/llms/vertex_ai/batches/handler.py b/litellm/llms/vertex_ai/batches/handler.py
index 7436bfef58..c627599da8 100644
--- a/litellm/llms/vertex_ai/batches/handler.py
+++ b/litellm/llms/vertex_ai/batches/handler.py
@@ -4,7 +4,11 @@ from typing import Any, Coroutine, Dict, Optional, Union
import httpx
import litellm
-from litellm.litellm_core_utils.url_utils import async_safe_get, safe_get
+from litellm.litellm_core_utils.url_utils import (
+ async_safe_get,
+ encode_url_path_segment,
+ safe_get,
+)
from litellm.llms.custom_httpx.http_handler import (
_get_httpx_client,
get_async_httpx_client,
@@ -170,7 +174,8 @@ class VertexAIBatchPrediction(VertexLLM):
)
# Append batch_id to the URL
- default_api_base = f"{default_api_base}/{batch_id}"
+ encoded_batch_id = encode_url_path_segment(batch_id, field_name="batch_id")
+ default_api_base = f"{default_api_base}/{encoded_batch_id}"
if len(default_api_base.split(":")) > 1:
endpoint = default_api_base.split(":")[-1]
@@ -413,7 +418,8 @@ class VertexAIBatchPrediction(VertexLLM):
vertex_project=vertex_project or project_id,
)
- retrieve_api_base_default = f"{default_api_base}/{batch_id}"
+ encoded_batch_id = encode_url_path_segment(batch_id, field_name="batch_id")
+ retrieve_api_base_default = f"{default_api_base}/{encoded_batch_id}"
cancel_api_base_default = f"{retrieve_api_base_default}:cancel"
_, api_base = self._check_custom_proxy(
diff --git a/litellm/llms/vertex_ai/common_utils.py b/litellm/llms/vertex_ai/common_utils.py
index fae175612b..e6e3965110 100644
--- a/litellm/llms/vertex_ai/common_utils.py
+++ b/litellm/llms/vertex_ai/common_utils.py
@@ -97,7 +97,7 @@ def get_vertex_ai_model_route(
Determine which handler to use for a Vertex AI model based on the model name.
Args:
- model: The model name (e.g., "llama3-405b", "gemini-pro", "gemma/gemma-3-12b-it", "openai/gpt-oss-120b")
+ model: The model name (e.g., "llama3-405b", "gemini-pro", "gemma/gemma-3-12b-it", "xai/grok-4.1-fast-non-reasoning")
litellm_params: Optional litellm parameters dict that may contain base_model for routing
Returns:
@@ -113,7 +113,7 @@ def get_vertex_ai_model_route(
>>> get_vertex_ai_model_route("gemma/gemma-3-12b-it")
VertexAIModelRoute.GEMMA
- >>> get_vertex_ai_model_route("openai/gpt-oss-120b")
+ >>> get_vertex_ai_model_route("xai/grok-4.1-fast-non-reasoning")
VertexAIModelRoute.MODEL_GARDEN
>>> get_vertex_ai_model_route("1234567890", {"api_base": "http://10.96.32.8"})
@@ -149,8 +149,11 @@ def get_vertex_ai_model_route(
if "gemma/" in model:
return VertexAIModelRoute.GEMMA
- # Check for model garden openai models
- if "openai" in model:
+ # Check for model garden OpenAI-compatible publisher models.
+ # Examples:
+ # - openai/gpt-oss-120b-maas
+ # - xai/grok-4.1-fast-non-reasoning
+ if "openai" in model or model.startswith("xai/"):
return VertexAIModelRoute.MODEL_GARDEN
# Check for gemini models
@@ -256,8 +259,8 @@ def get_vertex_base_model_name(model: str) -> str:
>>> get_vertex_base_model_name("gemma/gemma-3-12b-it")
"gemma-3-12b-it"
- >>> get_vertex_base_model_name("openai/gpt-oss-120b")
- "gpt-oss-120b"
+ >>> get_vertex_base_model_name("xai/grok-4.1-fast-non-reasoning")
+ "grok-4.1-fast-non-reasoning"
>>> get_vertex_base_model_name("1234567890")
"1234567890"
@@ -653,6 +656,8 @@ def process_items(schema, depth=0):
and ("items" not in schema or schema.get("items") == {})
):
schema["items"] = {"type": "object"}
+ elif schema.get("type") == "array" and "items" not in schema:
+ schema["items"] = {"type": "object"}
for key, value in schema.items():
if isinstance(value, dict):
process_items(value, depth + 1)
diff --git a/litellm/llms/vertex_ai/files/handler.py b/litellm/llms/vertex_ai/files/handler.py
index 6636bccd6a..c31bfde69e 100644
--- a/litellm/llms/vertex_ai/files/handler.py
+++ b/litellm/llms/vertex_ai/files/handler.py
@@ -1,5 +1,6 @@
import asyncio
-import urllib.parse
+import time
+from urllib.parse import unquote
from typing import Any, Coroutine, Optional, Tuple, Union
import httpx
@@ -9,6 +10,11 @@ from litellm.integrations.gcs_bucket.gcs_bucket_base import (
GCSBucketBase,
GCSLoggingConfig,
)
+from litellm.litellm_core_utils.cloud_storage_security import (
+ VERTEX_AI_MANAGED_GCS_PREFIX,
+ should_allow_legacy_cloud_file_ids,
+ validate_managed_cloud_file_id,
+)
from litellm.llms.custom_httpx.http_handler import get_async_httpx_client
from litellm.types.llms.openai import (
CreateFileRequest,
@@ -16,9 +22,10 @@ from litellm.types.llms.openai import (
HttpxBinaryResponseContent,
OpenAIFileObject,
)
+from litellm.litellm_core_utils.litellm_logging import Logging
from litellm.types.llms.vertex_ai import VERTEX_CREDENTIALS_TYPES
-from .transformation import VertexAIJsonlFilesTransformation
+from .transformation import VertexAIFilesConfig, VertexAIJsonlFilesTransformation
vertex_ai_files_transformation = VertexAIJsonlFilesTransformation()
@@ -112,34 +119,31 @@ class VertexAIFilesHandler(GCSBucketBase):
)
)
- def _extract_bucket_and_object_from_file_id(self, file_id: str) -> Tuple[str, str]:
+ def _extract_bucket_and_object_from_file_id(
+ self,
+ file_id: str,
+ configured_bucket_name: str,
+ litellm_params: Optional[dict] = None,
+ ) -> Tuple[str, str]:
"""
- Extract bucket name and object path from URL-encoded file_id.
+ Validate and extract bucket name and object path from file_id.
- Expected format: gs%3A%2F%2Fbucket-name%2Fpath%2Fto%2Ffile
- Which decodes to: gs://bucket-name/path/to/file
+ Expected format: gs://bucket-name/litellm-vertex-files/path/to/file
Returns:
- tuple: (bucket_name, url_encoded_object_path)
+ tuple: (bucket_name, object_path)
- bucket_name: "bucket-name"
- - url_encoded_object_path: "path%2Fto%2Ffile"
+ - object_path: "litellm-vertex-files/path/to/file"
"""
- decoded_path = urllib.parse.unquote(file_id)
-
- if decoded_path.startswith("gs://"):
- full_path = decoded_path[5:] # Remove 'gs://' prefix
- else:
- full_path = decoded_path
-
- if "/" in full_path:
- bucket_name, object_path = full_path.split("/", 1)
- else:
- bucket_name = full_path
- object_path = ""
-
- encoded_object_path = urllib.parse.quote(object_path, safe="")
-
- return bucket_name, encoded_object_path
+ return validate_managed_cloud_file_id(
+ file_id=file_id,
+ scheme="gs://",
+ configured_bucket_name=configured_bucket_name,
+ allowed_object_prefixes=(VERTEX_AI_MANAGED_GCS_PREFIX,),
+ allow_legacy_cloud_file_ids=should_allow_legacy_cloud_file_ids(
+ litellm_params
+ ),
+ )
async def afile_content(
self,
@@ -149,6 +153,7 @@ class VertexAIFilesHandler(GCSBucketBase):
vertex_location: Optional[str],
timeout: Union[float, httpx.Timeout],
max_retries: Optional[int],
+ litellm_params: Optional[dict] = None,
) -> HttpxBinaryResponseContent:
"""
Download file content from GCS bucket for VertexAI files.
@@ -168,31 +173,57 @@ class VertexAIFilesHandler(GCSBucketBase):
if not file_id:
raise ValueError("file_id is required in file_content_request")
- bucket_name, encoded_object_path = self._extract_bucket_and_object_from_file_id(
- file_id
+ gcs_logging_config: GCSLoggingConfig = await self.get_gcs_logging_config(
+ kwargs={}
+ )
+ bucket_name, object_path = self._extract_bucket_and_object_from_file_id(
+ file_id=file_id,
+ configured_bucket_name=gcs_logging_config["bucket_name"],
+ litellm_params=litellm_params,
)
download_kwargs = {
- "standard_callback_dynamic_params": {"gcs_bucket_name": bucket_name}
+ "standard_callback_dynamic_params": {
+ "gcs_bucket_name": bucket_name,
+ "gcs_path_service_account": gcs_logging_config["path_service_account"],
+ }
}
file_content = await self.download_gcs_object(
- object_name=encoded_object_path, **download_kwargs
+ object_name=object_path, **download_kwargs
)
+ decoded_file_id = unquote(file_id)
if file_content is None:
- decoded_path = urllib.parse.unquote(file_id)
- raise ValueError(f"Failed to download file from GCS: {decoded_path}")
+ raise ValueError(f"Failed to download file from GCS: {decoded_file_id}")
- decoded_path = urllib.parse.unquote(file_id)
mock_response = httpx.Response(
status_code=200,
content=file_content,
- headers={"content-type": "application/octet-stream"},
- request=httpx.Request(method="GET", url=decoded_path),
+ headers={
+ "content-type": "application/octet-stream",
+ "content-length": str(len(file_content)),
+ },
+ request=httpx.Request(method="GET", url=decoded_file_id),
)
- return HttpxBinaryResponseContent(response=mock_response)
+ # Apply transformation to convert Vertex AI batch outputs to OpenAI format
+ config = VertexAIFilesConfig()
+
+ # Create a logging object for transformation
+ logging_obj = Logging(
+ model="",
+ messages=[],
+ stream=False,
+ call_type="afile_content",
+ start_time=time.time(),
+ litellm_call_id="",
+ function_id="",
+ )
+
+ return config.transform_file_content_response(
+ raw_response=mock_response, logging_obj=logging_obj, litellm_params={}
+ )
def file_content(
self,
@@ -204,6 +235,7 @@ class VertexAIFilesHandler(GCSBucketBase):
vertex_location: Optional[str],
timeout: Union[float, httpx.Timeout],
max_retries: Optional[int],
+ litellm_params: Optional[dict] = None,
) -> Union[
HttpxBinaryResponseContent, Coroutine[Any, Any, HttpxBinaryResponseContent]
]:
@@ -232,6 +264,7 @@ class VertexAIFilesHandler(GCSBucketBase):
vertex_location=vertex_location,
timeout=timeout,
max_retries=max_retries,
+ litellm_params=litellm_params,
)
else:
return asyncio.run(
@@ -242,5 +275,6 @@ class VertexAIFilesHandler(GCSBucketBase):
vertex_location=vertex_location,
timeout=timeout,
max_retries=max_retries,
+ litellm_params=litellm_params,
)
)
diff --git a/litellm/llms/vertex_ai/files/transformation.py b/litellm/llms/vertex_ai/files/transformation.py
index 070ec50828..f30518bc7c 100644
--- a/litellm/llms/vertex_ai/files/transformation.py
+++ b/litellm/llms/vertex_ai/files/transformation.py
@@ -1,13 +1,27 @@
+import base64
import json
import os
+import re
import time
-from typing import Any, Dict, List, Optional, Tuple, Union
+from typing import Any, Callable, Dict, List, Optional, Tuple, Union
+import httpx
from httpx import Headers, Response
from openai.types.file_deleted import FileDeleted
+import litellm
from litellm._uuid import uuid
from litellm.files.utils import FilesAPIUtils
+from litellm.litellm_core_utils.cloud_storage_security import (
+ VERTEX_AI_MANAGED_GCS_PREFIX,
+ build_managed_cloud_object_name,
+ encode_gcs_object_name_for_url,
+ sanitize_cloud_object_path,
+ should_allow_legacy_cloud_file_ids,
+ split_configured_cloud_bucket_name,
+ validate_managed_cloud_file_id,
+)
+from litellm.litellm_core_utils.litellm_logging import Logging
from litellm.litellm_core_utils.prompt_templates.common_utils import extract_file_data
from litellm.llms.base_llm.chat.transformation import BaseLLMException
from litellm.llms.base_llm.files.transformation import (
@@ -31,11 +45,135 @@ from litellm.types.llms.openai import (
PathLike,
)
from litellm.types.llms.vertex_ai import GcsBucketResponse
-from litellm.types.utils import ExtractedFileData, LlmProviders
+from litellm.types.utils import ExtractedFileData, LlmProviders, ModelResponse
from ..common_utils import VertexAIError
from ..vertex_llm_base import VertexBase
+_GCP_LABEL_VALUE_MAX_LEN = 63
+_CUSTOM_ID_RAW_LABEL_PREFIX = "b32_"
+
+
+def _sanitize_gcp_label_value(value: str) -> str:
+ """
+ Sanitize a string to meet GCP label value constraints.
+
+ GCP label values must:
+ - Be lowercase
+ - Contain only letters, numbers, underscores, and hyphens
+ - Be max 63 characters
+
+ Args:
+ value: The string to sanitize
+
+ Returns:
+ A sanitized string that meets GCP label constraints
+ """
+ sanitized = re.sub(r"[^a-z0-9_-]", "_", value.lower())
+ return sanitized[:_GCP_LABEL_VALUE_MAX_LEN]
+
+
+def _encode_gcp_label_value_chunks(value: str) -> List[str]:
+ """Encode arbitrary text across one or more GCP-label-safe values."""
+ max_encoded_len = _GCP_LABEL_VALUE_MAX_LEN - len(_CUSTOM_ID_RAW_LABEL_PREFIX)
+ encoded = (
+ base64.b32encode(value.encode("utf-8")).decode("ascii").rstrip("=").lower()
+ )
+ return [
+ f"{_CUSTOM_ID_RAW_LABEL_PREFIX}{encoded[i : i + max_encoded_len]}"
+ for i in range(0, len(encoded), max_encoded_len)
+ ] or [_CUSTOM_ID_RAW_LABEL_PREFIX]
+
+
+def _decode_gcp_label_value_chunks(values: List[str]) -> Optional[str]:
+ """Decode values produced by _encode_gcp_label_value_chunks."""
+ encoded_parts = []
+ for value in values:
+ if not value.startswith(_CUSTOM_ID_RAW_LABEL_PREFIX):
+ return None
+ encoded_parts.append(value[len(_CUSTOM_ID_RAW_LABEL_PREFIX) :])
+ encoded = "".join(encoded_parts).upper()
+ padding = "=" * (-len(encoded) % 8)
+ try:
+ return base64.b32decode(encoded + padding).decode("utf-8")
+ except Exception:
+ return None
+
+
+def _set_litellm_batch_custom_id_labels(labels: Dict[str, str], custom_id: Any) -> None:
+ """
+ Store OpenAI batch custom_id for Vertex batch correlation.
+
+ ``litellm_custom_id`` is GCP-label-safe (may alter casing and characters).
+ ``litellm_custom_id_raw`` encodes the original string for
+ round-trip correlation in batch output transforms.
+ """
+ custom_id_str = str(custom_id)
+ labels["litellm_custom_id"] = _sanitize_gcp_label_value(custom_id_str)
+ raw_label_chunks = _encode_gcp_label_value_chunks(custom_id_str)
+ labels["litellm_custom_id_raw"] = raw_label_chunks[0]
+ for index, raw_label_chunk in enumerate(raw_label_chunks[1:], start=1):
+ labels[f"litellm_custom_id_raw_{index}"] = raw_label_chunk
+
+
+def _get_litellm_batch_custom_id_from_labels(labels: Dict[str, Any]) -> str:
+ """Prefer encoded custom_id when present (see _set_litellm_batch_custom_id_labels)."""
+ raw = labels.get("litellm_custom_id_raw")
+ if raw:
+ raw_chunks = [str(raw)]
+ chunk_prefix = "litellm_custom_id_raw_"
+ indexed_chunks = []
+ for key, value in labels.items():
+ if key.startswith(chunk_prefix) and key[len(chunk_prefix) :].isdigit():
+ indexed_chunks.append((int(key[len(chunk_prefix) :]), str(value)))
+ raw_chunks.extend(
+ raw_label_chunk
+ for _, raw_label_chunk in sorted(indexed_chunks, key=lambda item: item[0])
+ )
+ decoded = _decode_gcp_label_value_chunks(raw_chunks)
+ if decoded is not None:
+ return decoded
+ return str(raw)
+ return str(labels.get("litellm_custom_id", "unknown"))
+
+
+def _openai_batch_jsonl_entries_to_vertex_wrapped_requests(
+ openai_jsonl_content: List[Dict[str, Any]],
+ map_openai_to_vertex_params: Callable[[Dict[str, Any]], Dict[str, Any]],
+) -> List[Dict[str, Any]]:
+ """
+ Transforms OpenAI JSONL batch entries to Vertex AI JSONL lines.
+
+ jsonl body for vertex is {"request": }
+ Example Vertex jsonl
+ {"request":{"contents": [{"role": "user", "parts": [{"text": "What is the relation between the following video and image samples?"}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/video/animals.mp4", "mimeType": "video/mp4"}}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/image/cricket.jpeg", "mimeType": "image/jpeg"}}]}]}}
+ {"request":{"contents": [{"role": "user", "parts": [{"text": "Describe what is happening in this video."}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/video/another_video.mov", "mimeType": "video/mov"}}]}]}}
+ """
+
+ vertex_jsonl_content = []
+ for _openai_jsonl_content in openai_jsonl_content:
+ openai_request_body = _openai_jsonl_content.get("body") or {}
+ vertex_request_body = _transform_request_body(
+ messages=openai_request_body.get("messages", []),
+ model=openai_request_body.get("model", ""),
+ optional_params=map_openai_to_vertex_params(openai_request_body),
+ custom_llm_provider="vertex_ai",
+ litellm_params={},
+ cached_content=None,
+ )
+
+ # Add custom_id as a label for correlation in batch outputs
+ custom_id = _openai_jsonl_content.get("custom_id")
+ if custom_id is not None:
+ if "labels" not in vertex_request_body:
+ vertex_request_body["labels"] = {}
+ _set_litellm_batch_custom_id_labels(
+ vertex_request_body["labels"], custom_id
+ )
+
+ vertex_jsonl_content.append({"request": vertex_request_body})
+ return vertex_jsonl_content
+
class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
"""
@@ -119,7 +257,8 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
_model = openai_jsonl_content[0].get("body", {}).get("model", "")
if "publishers/google/models" not in _model:
_model = f"publishers/google/models/{_model}"
- object_name = f"litellm-vertex-files/{_model}/{uuid.uuid4()}"
+ safe_model_path = sanitize_cloud_object_path(_model, fallback="model")
+ object_name = f"{VERTEX_AI_MANAGED_GCS_PREFIX}{safe_model_path}/{uuid.uuid4()}"
return object_name
def get_object_name(
@@ -146,12 +285,19 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
if len(openai_jsonl_content) > 0:
return self._get_gcs_object_name_from_batch_jsonl(openai_jsonl_content)
- ## 2. If not jsonl, return the filename
+ ## 2. If not jsonl, store under a server-generated managed object name
filename = extracted_file_data.get("filename")
- if filename:
- return filename
- ## 3. If no file name, return timestamp
- return str(int(time.time()))
+ return build_managed_cloud_object_name(
+ prefix=f"{VERTEX_AI_MANAGED_GCS_PREFIX}uploads/",
+ filename=filename,
+ fallback_filename="file",
+ )
+
+ def _get_configured_bucket_name(self, litellm_params: Dict) -> str:
+ bucket_name = litellm_params.get("bucket_name") or os.getenv("GCS_BUCKET_NAME")
+ if not bucket_name:
+ raise ValueError("GCS bucket_name is required")
+ return bucket_name
def get_complete_file_url(
self,
@@ -165,13 +311,8 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
"""
Get the complete url for the request
"""
- bucket_name = (
- litellm_params.get("bucket_name")
- or litellm_params.get("litellm_metadata", {}).pop("gcs_bucket_name", None)
- or os.getenv("GCS_BUCKET_NAME")
- )
- if not bucket_name:
- raise ValueError("GCS bucket_name is required")
+ bucket_name = self._get_configured_bucket_name(litellm_params)
+ bucket_name, object_prefix = split_configured_cloud_bucket_name(bucket_name)
file_data = data.get("file")
purpose = data.get("purpose")
if file_data is None:
@@ -180,9 +321,10 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
raise ValueError("purpose is required")
extracted_file_data = extract_file_data(file_data)
object_name = self.get_object_name(extracted_file_data, purpose)
- endpoint = (
- f"upload/storage/v1/b/{bucket_name}/o?uploadType=media&name={object_name}"
- )
+ if object_prefix:
+ object_name = f"{object_prefix}/{object_name}"
+ encoded_object_name = encode_gcs_object_name_for_url(object_name)
+ endpoint = f"upload/storage/v1/b/{bucket_name}/o?uploadType=media&name={encoded_object_name}"
api_base = api_base or "https://storage.googleapis.com"
if not api_base:
raise ValueError("api_base is required")
@@ -227,28 +369,10 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
def _transform_openai_jsonl_content_to_vertex_ai_jsonl_content(
self, openai_jsonl_content: List[Dict[str, Any]]
) -> List[Dict[str, Any]]:
- """
- Transforms OpenAI JSONL content to VertexAI JSONL content
-
- jsonl body for vertex is {"request": }
- Example Vertex jsonl
- {"request":{"contents": [{"role": "user", "parts": [{"text": "What is the relation between the following video and image samples?"}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/video/animals.mp4", "mimeType": "video/mp4"}}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/image/cricket.jpeg", "mimeType": "image/jpeg"}}]}]}}
- {"request":{"contents": [{"role": "user", "parts": [{"text": "Describe what is happening in this video."}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/video/another_video.mov", "mimeType": "video/mov"}}]}]}}
- """
-
- vertex_jsonl_content = []
- for _openai_jsonl_content in openai_jsonl_content:
- openai_request_body = _openai_jsonl_content.get("body") or {}
- vertex_request_body = _transform_request_body(
- messages=openai_request_body.get("messages", []),
- model=openai_request_body.get("model", ""),
- optional_params=self._map_openai_to_vertex_params(openai_request_body),
- custom_llm_provider="vertex_ai",
- litellm_params={},
- cached_content=None,
- )
- vertex_jsonl_content.append({"request": vertex_request_body})
- return vertex_jsonl_content
+ return _openai_batch_jsonl_entries_to_vertex_wrapped_requests(
+ openai_jsonl_content=openai_jsonl_content,
+ map_openai_to_vertex_params=self._map_openai_to_vertex_params,
+ )
def transform_create_file_request(
self,
@@ -339,27 +463,23 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
status_code=status_code, message=error_message, headers=headers
)
- def _parse_gcs_uri(self, file_id: str) -> Tuple[str, str]:
+ def _parse_gcs_uri(
+ self, file_id: str, litellm_params: Optional[Dict] = None
+ ) -> Tuple[str, str]:
"""
- Parse a GCS URI (gs://bucket/path/to/object) into (bucket, url-encoded-object-path).
- Handles both raw and URL-encoded input.
+ Validate a managed GCS file_id and return (bucket, url-encoded-object-path).
"""
- import urllib.parse
-
- decoded = urllib.parse.unquote(file_id)
- if decoded.startswith("gs://"):
- full_path = decoded[5:]
- else:
- full_path = decoded
-
- if "/" in full_path:
- bucket_name, object_path = full_path.split("/", 1)
- else:
- bucket_name = full_path
- object_path = ""
-
- encoded_object = urllib.parse.quote(object_path, safe="")
- return bucket_name, encoded_object
+ configured_bucket_name = self._get_configured_bucket_name(litellm_params or {})
+ bucket_name, object_path = validate_managed_cloud_file_id(
+ file_id=file_id,
+ scheme="gs://",
+ configured_bucket_name=configured_bucket_name,
+ allowed_object_prefixes=(VERTEX_AI_MANAGED_GCS_PREFIX,),
+ allow_legacy_cloud_file_ids=should_allow_legacy_cloud_file_ids(
+ litellm_params
+ ),
+ )
+ return bucket_name, encode_gcs_object_name_for_url(object_path)
def transform_retrieve_file_request(
self,
@@ -367,7 +487,7 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
optional_params: dict,
litellm_params: dict,
) -> tuple[str, dict]:
- bucket, encoded_object = self._parse_gcs_uri(file_id)
+ bucket, encoded_object = self._parse_gcs_uri(file_id, litellm_params)
url = f"https://storage.googleapis.com/storage/v1/b/{bucket}/o/{encoded_object}"
return url, {}
@@ -399,7 +519,7 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
optional_params: dict,
litellm_params: dict,
) -> tuple[str, dict]:
- bucket, encoded_object = self._parse_gcs_uri(file_id)
+ bucket, encoded_object = self._parse_gcs_uri(file_id, litellm_params)
url = f"https://storage.googleapis.com/storage/v1/b/{bucket}/o/{encoded_object}"
return url, {}
@@ -443,7 +563,7 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
litellm_params: dict,
) -> tuple[str, dict]:
file_id = file_content_request.get("file_id", "")
- bucket, encoded_object = self._parse_gcs_uri(file_id)
+ bucket, encoded_object = self._parse_gcs_uri(file_id, litellm_params)
url = f"https://storage.googleapis.com/storage/v1/b/{bucket}/o/{encoded_object}?alt=media"
return url, {}
@@ -453,8 +573,229 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
logging_obj: LiteLLMLoggingObj,
litellm_params: dict,
) -> HttpxBinaryResponseContent:
+ """
+ Transform file content response, converting Vertex AI batch output to OpenAI format if applicable.
+
+ This method automatically detects and transforms Vertex AI batch prediction outputs
+ (predictions.jsonl files) into OpenAI-compatible batch response format.
+
+ If the file is not a batch output or transformation fails, the original content
+ is returned as-is to maintain backward compatibility.
+ """
+ try:
+ # Allow users to opt out of automatic Vertex batch output -> OpenAI
+ # transformation, e.g. if they consume raw `predictions.jsonl` directly.
+ if getattr(litellm, "disable_vertex_batch_output_transformation", False):
+ return HttpxBinaryResponseContent(response=raw_response)
+
+ # Try to transform batch output if it's a JSONL file
+ content = raw_response.content
+ if content:
+ transformed_content = self._try_transform_vertex_batch_output_to_openai(
+ content=content,
+ logging_obj=logging_obj,
+ )
+ if transformed_content != content:
+ # Create a new response with transformed content and updated Content-Length
+ # Update headers with correct Content-Length
+ new_headers = dict(raw_response.headers)
+ new_headers["content-length"] = str(len(transformed_content))
+
+ mock_response = httpx.Response(
+ status_code=raw_response.status_code,
+ content=transformed_content,
+ headers=new_headers,
+ request=raw_response.request,
+ )
+ return HttpxBinaryResponseContent(response=mock_response)
+ except Exception:
+ # If transformation fails, return as-is
+ pass
+
return HttpxBinaryResponseContent(response=raw_response)
+ def _try_transform_vertex_batch_output_to_openai(
+ self, content: bytes, logging_obj: Optional[LiteLLMLoggingObj] = None
+ ) -> bytes:
+ """
+ Try to transform Vertex AI batch output to OpenAI format.
+ If conversion fails at any point, return the original content as-is.
+
+ Vertex AI batch output format (predictions.jsonl):
+ {
+ "request": {"contents": [...], "labels": {"litellm_custom_id": "request-1", "litellm_custom_id_raw": "..."}},
+ "status": "",
+ "response": {"candidates": [...], "modelVersion": "gemini-2.5-flash", ...},
+ "processed_time": "2026-04-13T10:18:18.102004+00:00"
+ }
+
+ OpenAI batch output format:
+ {
+ "id": "batch_req_...",
+ "custom_id": "request-1",
+ "response": {
+ "status_code": 200,
+ "request_id": "chatcmpl-...",
+ "body": {}
+ },
+ "error": null
+ }
+ """
+ try:
+ # Decode content
+ content_str = content.decode("utf-8")
+
+ # Check if it's JSONL (multiple lines)
+ lines = content_str.strip().split("\n")
+ if not lines:
+ return content
+
+ # Try to parse the first line to see if it's Vertex AI batch output
+ first_line = json.loads(lines[0])
+
+ # Check if it has Vertex AI batch output structure with discriminating fields
+ # Must have request, response, and processed_time
+ # Plus either candidates (success) or status (error)
+ has_base_structure = (
+ "response" in first_line
+ and "request" in first_line
+ and "processed_time" in first_line
+ )
+ has_success_or_error = (
+ "candidates" in first_line.get("response", {})
+ or "promptFeedback" in first_line.get("response", {})
+ or bool(first_line.get("status"))
+ )
+
+ if not (has_base_structure and has_success_or_error):
+ # Not a Vertex AI batch output, return as-is
+ return content
+
+ vertex_gemini_config = VertexGeminiConfig()
+ # Always use a fresh local Logging object for the per-line transformation
+ # so we never mutate the caller's logging_obj (which already went through
+ # pre_call and has its own model/start_time/optional_params set).
+ batch_transform_logging_obj = Logging(
+ model="",
+ messages=[],
+ stream=False,
+ call_type="batch_transform",
+ start_time=time.time(),
+ litellm_call_id="",
+ function_id="",
+ )
+ batch_transform_logging_obj.optional_params = {}
+ mock_httpx_response = httpx.Response(
+ status_code=200,
+ headers={"content-type": "application/json"},
+ request=httpx.Request(method="POST", url="https://example.com"),
+ )
+
+ # Transform all lines
+ transformed_lines = []
+ for line in lines:
+ if not line.strip():
+ continue
+
+ try:
+ vertex_output = json.loads(line)
+ openai_output = (
+ self._transform_single_vertex_batch_output_to_openai(
+ vertex_output=vertex_output,
+ vertex_gemini_config=vertex_gemini_config,
+ logging_obj=batch_transform_logging_obj,
+ mock_httpx_response=mock_httpx_response,
+ )
+ )
+ transformed_lines.append(json.dumps(openai_output))
+ except Exception:
+ # If any line fails, return original content
+ return content
+
+ # Return transformed content
+ return "\n".join(transformed_lines).encode("utf-8")
+
+ except Exception:
+ # If anything fails, return original content
+ return content
+
+ def _transform_single_vertex_batch_output_to_openai(
+ self,
+ vertex_output: Dict[str, Any],
+ vertex_gemini_config: VertexGeminiConfig,
+ logging_obj: Logging,
+ mock_httpx_response: httpx.Response,
+ ) -> Dict[str, Any]:
+ """
+ Transform a single Vertex AI batch output line to OpenAI format.
+ Uses the existing VertexGeminiConfig transformation for the response.
+ """
+ # Extract custom_id from request labels (prefer raw for OpenAI round-trip)
+ request_data = vertex_output.get("request", {})
+ labels = request_data.get("labels", {}) or {}
+ custom_id = _get_litellm_batch_custom_id_from_labels(labels)
+
+ # Check if there's an error
+ status = vertex_output.get("status", "")
+ has_error = bool(status)
+
+ if has_error:
+ return {
+ "id": f"batch_req_{uuid.uuid4()}",
+ "custom_id": custom_id,
+ "response": None,
+ "error": {
+ "code": "vertex_ai_error",
+ "message": status,
+ },
+ }
+
+ # Transform successful response using existing transformation
+ vertex_response = vertex_output.get("response", {})
+
+ # Extract model from response
+ model = vertex_response.get("modelVersion", "gemini-1.5-flash-001")
+ if "@" in model:
+ model = model.split("@")[0]
+
+ try:
+ # Use existing VertexGeminiConfig transformation
+ model_response = ModelResponse()
+
+ transformed_response = vertex_gemini_config._transform_google_generate_content_to_openai_model_response(
+ completion_response=vertex_response,
+ model_response=model_response,
+ model=model,
+ logging_obj=logging_obj,
+ raw_response=mock_httpx_response,
+ )
+
+ # Convert ModelResponse to dict
+ response_dict = transformed_response.model_dump()
+
+ # Return in OpenAI batch format
+ return {
+ "id": f"batch_req_{uuid.uuid4()}",
+ "custom_id": custom_id,
+ "response": {
+ "status_code": 200,
+ "request_id": response_dict.get("id", ""),
+ "body": response_dict,
+ },
+ "error": None,
+ }
+
+ except Exception as e:
+ return {
+ "id": f"batch_req_{uuid.uuid4()}",
+ "custom_id": custom_id,
+ "response": None,
+ "error": {
+ "code": "transformation_error",
+ "message": f"Failed to transform response: {str(e)}",
+ },
+ }
+
class VertexAIJsonlFilesTransformation(VertexGeminiConfig):
"""
@@ -492,29 +833,11 @@ class VertexAIJsonlFilesTransformation(VertexGeminiConfig):
def _transform_openai_jsonl_content_to_vertex_ai_jsonl_content(
self, openai_jsonl_content: List[Dict[str, Any]]
- ):
- """
- Transforms OpenAI JSONL content to VertexAI JSONL content
-
- jsonl body for vertex is {"request": }
- Example Vertex jsonl
- {"request":{"contents": [{"role": "user", "parts": [{"text": "What is the relation between the following video and image samples?"}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/video/animals.mp4", "mimeType": "video/mp4"}}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/image/cricket.jpeg", "mimeType": "image/jpeg"}}]}]}}
- {"request":{"contents": [{"role": "user", "parts": [{"text": "Describe what is happening in this video."}, {"fileData": {"fileUri": "gs://cloud-samples-data/generative-ai/video/another_video.mov", "mimeType": "video/mov"}}]}]}}
- """
-
- vertex_jsonl_content = []
- for _openai_jsonl_content in openai_jsonl_content:
- openai_request_body = _openai_jsonl_content.get("body") or {}
- vertex_request_body = _transform_request_body(
- messages=openai_request_body.get("messages", []),
- model=openai_request_body.get("model", ""),
- optional_params=self._map_openai_to_vertex_params(openai_request_body),
- custom_llm_provider="vertex_ai",
- litellm_params={},
- cached_content=None,
- )
- vertex_jsonl_content.append({"request": vertex_request_body})
- return vertex_jsonl_content
+ ) -> List[Dict[str, Any]]:
+ return _openai_batch_jsonl_entries_to_vertex_wrapped_requests(
+ openai_jsonl_content=openai_jsonl_content,
+ map_openai_to_vertex_params=self._map_openai_to_vertex_params,
+ )
def _get_gcs_object_name(
self,
@@ -528,7 +851,8 @@ class VertexAIJsonlFilesTransformation(VertexGeminiConfig):
_model = openai_jsonl_content[0].get("body", {}).get("model", "")
if "publishers/google/models" not in _model:
_model = f"publishers/google/models/{_model}"
- object_name = f"litellm-vertex-files/{_model}/{uuid.uuid4()}"
+ safe_model_path = sanitize_cloud_object_path(_model, fallback="model")
+ object_name = f"{VERTEX_AI_MANAGED_GCS_PREFIX}{safe_model_path}/{uuid.uuid4()}"
return object_name
def _map_openai_to_vertex_params(
diff --git a/litellm/llms/vertex_ai/gemini/transformation.py b/litellm/llms/vertex_ai/gemini/transformation.py
index 87bd484382..9afa5dec46 100644
--- a/litellm/llms/vertex_ai/gemini/transformation.py
+++ b/litellm/llms/vertex_ai/gemini/transformation.py
@@ -212,6 +212,22 @@ def _process_gemini_media(
return _apply_gemini_metadata(
part, model, media_resolution_enum, video_metadata
)
+ elif image_url.startswith(
+ "https://generativelanguage.googleapis.com/v1beta/files/"
+ ):
+ # Gemini Files API URIs — the file is already uploaded to Google's
+ # servers; pass the URI through as file_data without fetching it.
+ # These URLs return 403 when accessed directly, so we must not try
+ # to resolve their MIME type via HTTP.
+ if format:
+ file_data = FileDataType(mime_type=format, file_uri=image_url)
+ else:
+ # Gemini Files API references can be passed through as URI-only.
+ file_data = cast(FileDataType, {"file_uri": image_url})
+ part = {"file_data": file_data}
+ return _apply_gemini_metadata(
+ part, model, media_resolution_enum, video_metadata
+ )
elif (
"https://" in image_url
and (image_type := format or _get_image_mime_type_from_url(image_url))
@@ -743,16 +759,22 @@ def _transform_request_body( # noqa: PLR0915
]
data = RequestBody(contents=content)
- if system_instructions is not None:
- data["system_instruction"] = system_instructions
- if tools is not None:
- data["tools"] = tools
- if tool_choice is not None:
- data["toolConfig"] = tool_choice
- if include_server_side_tool_invocations:
- if "toolConfig" not in data:
- data["toolConfig"] = {}
- data["toolConfig"]["includeServerSideToolInvocations"] = True
+ # Vertex rejects system_instruction/tools/toolConfig alongside cachedContent.
+ # Treat dropping these fields as a request mutation guarded by modify_params.
+ can_send_cache_incompatible_fields = (
+ cached_content is None or litellm.modify_params is False
+ )
+ if can_send_cache_incompatible_fields:
+ if system_instructions is not None:
+ data["system_instruction"] = system_instructions
+ if tools is not None:
+ data["tools"] = tools
+ if tool_choice is not None:
+ data["toolConfig"] = tool_choice
+ if include_server_side_tool_invocations:
+ if "toolConfig" not in data:
+ data["toolConfig"] = {}
+ data["toolConfig"]["includeServerSideToolInvocations"] = True
if safety_settings is not None:
data["safetySettings"] = safety_settings
if generation_config is not None and len(generation_config) > 0:
diff --git a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py
index 474ddb402a..6278de662f 100644
--- a/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py
+++ b/litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py
@@ -979,15 +979,8 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
params["includeThoughts"] = False
else:
params["includeThoughts"] = True
- if thinking_budget >= 10000:
- is_gemini3flash = (
- "gemini-3-flash-preview" in model.lower()
- or "gemini-3-flash" in model.lower()
- )
- params["thinkingLevel"] = (
- "minimal" if is_gemini3flash else "low"
- )
- else:
+ # Follow provider defaults unless explicitly opted into legacy behavior.
+ if litellm.enable_gemini_default_thinking_level_low is True:
is_gemini3flash = (
"gemini-3-flash-preview" in model.lower()
or "gemini-3-flash" in model.lower()
diff --git a/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_handler.py b/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_handler.py
index 2371bc4865..99165c37c9 100644
--- a/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_handler.py
+++ b/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_handler.py
@@ -3,7 +3,7 @@ Google AI Studio /batchEmbedContents Embeddings Endpoint
"""
import json
-from typing import Any, Dict, Literal, Optional, Union
+from typing import Any, Dict, List, Literal, Optional, Tuple, Union
import httpx
@@ -13,8 +13,8 @@ from litellm.llms.custom_httpx.http_handler import (
HTTPHandler,
get_async_httpx_client,
)
-from litellm.types.llms.openai import EmbeddingInput
from litellm.types.llms.vertex_ai import (
+ GeminiEmbeddingInput,
VertexAIBatchEmbeddingsRequestBody,
VertexAIBatchEmbeddingsResponseObject,
)
@@ -23,7 +23,6 @@ from litellm.types.utils import EmbeddingResponse
from ..gemini.vertex_and_google_ai_studio_gemini import VertexLLM
from .batch_embed_content_transformation import (
_is_file_reference,
- _is_multimodal_input,
process_embed_content_response,
process_response,
transform_openai_input_gemini_content,
@@ -32,9 +31,24 @@ from .batch_embed_content_transformation import (
class GoogleBatchEmbeddings(VertexLLM):
+ @staticmethod
+ def _flatten_and_detect_file_refs(
+ input: GeminiEmbeddingInput,
+ ) -> Tuple[List[str], bool]:
+ """Flatten nested input lists and detect file references."""
+ input_list = [input] if isinstance(input, str) else input
+ flat_elements = [
+ e
+ for item in input_list
+ for e in (item if isinstance(item, list) else [item])
+ if isinstance(e, str)
+ ]
+ has_file_refs = any(_is_file_reference(e) for e in flat_elements)
+ return flat_elements, has_file_refs
+
def _resolve_file_references(
self,
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
api_key: str,
sync_handler: HTTPHandler,
) -> Dict[str, Dict[str, str]]:
@@ -42,7 +56,7 @@ class GoogleBatchEmbeddings(VertexLLM):
Resolve Gemini file references (files/...) to get mime_type and uri.
Args:
- input: EmbeddingInput that may contain file references
+ input: GeminiEmbeddingInput that may contain file references
api_key: Gemini API key
sync_handler: HTTP client
@@ -73,7 +87,7 @@ class GoogleBatchEmbeddings(VertexLLM):
async def _async_resolve_file_references(
self,
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
api_key: str,
async_handler: AsyncHTTPHandler,
) -> Dict[str, Dict[str, str]]:
@@ -81,7 +95,7 @@ class GoogleBatchEmbeddings(VertexLLM):
Async version of _resolve_file_references.
Args:
- input: EmbeddingInput that may contain file references
+ input: GeminiEmbeddingInput that may contain file references
api_key: Gemini API key
async_handler: Async HTTP client
@@ -110,10 +124,10 @@ class GoogleBatchEmbeddings(VertexLLM):
return resolved_files
- def batch_embeddings(
+ def batch_embeddings( # noqa: PLR0915
self,
model: str,
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
print_verbose,
model_response: EmbeddingResponse,
custom_llm_provider: Literal["gemini", "vertex_ai"],
@@ -151,8 +165,7 @@ class GoogleBatchEmbeddings(VertexLLM):
optional_params = optional_params or {}
- is_multimodal = _is_multimodal_input(input)
- use_embed_content = is_multimodal or (custom_llm_provider == "vertex_ai")
+ use_embed_content = custom_llm_provider == "vertex_ai"
mode: Literal["embedding", "batch_embedding"]
if use_embed_content:
mode = "embedding"
@@ -215,8 +228,22 @@ class GoogleBatchEmbeddings(VertexLLM):
resolved_files=resolved_files,
)
else:
+ flat_elements, has_file_refs = self._flatten_and_detect_file_refs(input)
+ if has_file_refs and not api_key:
+ raise ValueError(
+ "An API key is required to resolve Gemini file references (files/...). "
+ "Pass api_key= or set GEMINI_API_KEY."
+ )
+ resolved_files = {}
+ if api_key and has_file_refs:
+ resolved_files = self._resolve_file_references(
+ input=flat_elements, api_key=api_key, sync_handler=sync_handler
+ )
request_data = transform_openai_input_gemini_content(
- input=input, model=model, optional_params=optional_params
+ input=input,
+ model=model,
+ optional_params=optional_params,
+ resolved_files=resolved_files,
)
## LOGGING
@@ -264,7 +291,7 @@ class GoogleBatchEmbeddings(VertexLLM):
url: str,
data: Optional[Union[VertexAIBatchEmbeddingsRequestBody, dict]],
model_response: EmbeddingResponse,
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
timeout: Optional[Union[float, httpx.Timeout]],
headers={},
client: Optional[AsyncHTTPHandler] = None,
@@ -303,8 +330,22 @@ class GoogleBatchEmbeddings(VertexLLM):
resolved_files=resolved_files,
)
else:
+ flat_elements, has_file_refs = self._flatten_and_detect_file_refs(input)
+ if has_file_refs and not api_key:
+ raise ValueError(
+ "An API key is required to resolve Gemini file references (files/...). "
+ "Pass api_key= or set GEMINI_API_KEY."
+ )
+ resolved_files = {}
+ if api_key and has_file_refs:
+ resolved_files = await self._async_resolve_file_references(
+ input=flat_elements, api_key=api_key, async_handler=async_handler
+ )
data = transform_openai_input_gemini_content(
- input=input, model=model, optional_params=optional_params or {}
+ input=input,
+ model=model,
+ optional_params=optional_params or {},
+ resolved_files=resolved_files,
)
## LOGGING
diff --git a/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py b/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py
index 34fc95e0af..e1b365c9f4 100644
--- a/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py
+++ b/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py
@@ -6,12 +6,12 @@ Why separate file? Make it easy to see how transformation works
from typing import Dict, List, Optional, Tuple
-from litellm.types.llms.openai import EmbeddingInput
from litellm.types.llms.vertex_ai import (
BlobType,
ContentType,
EmbedContentRequest,
FileDataType,
+ GeminiEmbeddingInput,
PartType,
VertexAIBatchEmbeddingsRequestBody,
VertexAIBatchEmbeddingsResponseObject,
@@ -114,33 +114,77 @@ def _parse_data_url(data_url: str) -> Tuple[str, str]:
return media_type, base64_data
-def _is_multimodal_input(input: EmbeddingInput) -> bool:
+def _is_multimodal_input(input: GeminiEmbeddingInput) -> bool:
"""
- Check if the input contains multimodal data (data URIs, file references, or GCS URLs).
+ Check if the input contains multimodal data (data URIs, file references,
+ GCS URLs, or nested lists for combined embeddings).
Args:
- input: EmbeddingInput (str or List[str])
+ input: GeminiEmbeddingInput — str, List[str], or List[List[str]] for combined embeddings
Returns:
- bool: True if any element is a data URI, file reference, or GCS URL
+ bool: True if any element is multimodal or a nested list
"""
if isinstance(input, str):
- input_list = [input]
- else:
- input_list = input
+ return _is_multimodal_element(input)
- for element in input_list:
- if isinstance(element, str):
- if element.startswith("data:") and ";base64," in element:
- return True
- if _is_file_reference(element):
- return True
- if _is_gcs_url(element):
+ for element in input:
+ if isinstance(element, list):
+ if any(
+ _is_multimodal_element(sub) for sub in element if isinstance(sub, str)
+ ):
return True
+ elif isinstance(element, str) and _is_multimodal_element(element):
+ return True
return False
+def _is_multimodal_element(element: str) -> bool:
+ """Check if a single string element is multimodal."""
+ if element.startswith("data:") and ";base64," in element:
+ return True
+ if _is_file_reference(element):
+ return True
+ if _is_gcs_url(element):
+ return True
+ return False
+
+
+def _build_part_for_input(
+ element: str,
+ resolved_files: Optional[Dict[str, Dict[str, str]]] = None,
+) -> PartType:
+ """
+ Build a single PartType for an input element, handling text, data URIs,
+ file references, and GCS URLs.
+ """
+ resolved_files = resolved_files or {}
+
+ if element.startswith("data:") and ";base64," in element:
+ mime_type, base64_data = _parse_data_url(element)
+ blob: BlobType = {"mime_type": mime_type, "data": base64_data}
+ return PartType(inline_data=blob)
+ elif _is_gcs_url(element):
+ mime_type = _infer_mime_type_from_gcs_url(element)
+ file_data: FileDataType = {
+ "mime_type": mime_type,
+ "file_uri": element,
+ }
+ return PartType(file_data=file_data)
+ elif _is_file_reference(element):
+ if element not in resolved_files:
+ raise ValueError(f"File reference {element} not resolved")
+ file_info = resolved_files[element]
+ file_data_ref: FileDataType = {
+ "mime_type": file_info["mime_type"],
+ "file_uri": file_info["uri"],
+ }
+ return PartType(file_data=file_data_ref)
+ else:
+ return PartType(text=element)
+
+
_SUPPORTED_EMBED_PARAMS = {"outputDimensionality", "taskType", "title"}
@@ -155,37 +199,60 @@ def _filter_embed_params(optional_params: dict) -> dict:
def transform_openai_input_gemini_content(
- input: EmbeddingInput, model: str, optional_params: dict
+ input: GeminiEmbeddingInput,
+ model: str,
+ optional_params: dict,
+ resolved_files: Optional[Dict[str, Dict[str, str]]] = None,
) -> VertexAIBatchEmbeddingsRequestBody:
"""
- The content to embed. Only the parts.text fields will be counted.
+ Transform OpenAI embedding input to Gemini batchEmbedContents format.
+
+ Each input element becomes a separate EmbedContentRequest, supporting
+ text, data URIs, file references, and GCS URLs.
+
+ If an element is a list (nested input), all sub-elements are combined
+ into a single content with multiple parts, producing one combined
+ embedding for the group.
+
+ Examples:
+ input=["text", "image"] → 2 separate embeddings
+ input=[["text", "image"]] → 1 combined embedding
+ input=[["text", "image"], "x"] → 2 embeddings (1 combined + 1 separate)
"""
gemini_model_name = "models/{}".format(model)
gemini_params = _filter_embed_params(optional_params)
+ input_list = [input] if isinstance(input, str) else input
requests: List[EmbedContentRequest] = []
- if isinstance(input, str):
+
+ for element in input_list:
+ if isinstance(element, list):
+ if not element:
+ raise ValueError("Nested input list must not be empty")
+ for sub in element:
+ if not isinstance(sub, str):
+ raise ValueError(
+ f"Elements inside a nested input list must be strings, got {type(sub)}"
+ )
+ parts = [
+ _build_part_for_input(sub, resolved_files=resolved_files)
+ for sub in element
+ ]
+ else:
+ parts = [_build_part_for_input(element, resolved_files=resolved_files)]
request = EmbedContentRequest(
model=gemini_model_name,
- content=ContentType(parts=[PartType(text=input)]),
+ content=ContentType(parts=parts),
**gemini_params,
)
requests.append(request)
- else:
- for i in input:
- request = EmbedContentRequest(
- model=gemini_model_name,
- content=ContentType(parts=[PartType(text=i)]),
- **gemini_params,
- )
- requests.append(request)
return VertexAIBatchEmbeddingsRequestBody(requests=requests)
def transform_openai_input_gemini_embed_content(
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
model: str,
optional_params: dict,
resolved_files: Optional[Dict[str, Dict[str, str]]] = None,
@@ -194,7 +261,7 @@ def transform_openai_input_gemini_embed_content(
Transform OpenAI embedding input to Gemini embedContent format (multimodal).
Args:
- input: EmbeddingInput (str or List[str]) with text, data URIs, or file references
+ input: GeminiEmbeddingInput with text, data URIs, or file references
model: Model name
optional_params: Additional parameters (taskType, outputDimensionality, etc.)
resolved_files: Dict mapping file names (files/abc) to {mime_type, uri}
@@ -210,31 +277,14 @@ def transform_openai_input_gemini_embed_content(
parts: List[PartType] = []
for element in input_list:
+ if isinstance(element, list):
+ raise ValueError(
+ "Nested (combined) embeddings are not supported on the embedContent path. "
+ "Use the batchEmbedContents path or pass a flat list instead."
+ )
if not isinstance(element, str):
raise ValueError(f"Unsupported input type: {type(element)}")
-
- if element.startswith("data:") and ";base64," in element:
- mime_type, base64_data = _parse_data_url(element)
- blob: BlobType = {"mime_type": mime_type, "data": base64_data}
- parts.append(PartType(inline_data=blob))
- elif _is_gcs_url(element):
- mime_type = _infer_mime_type_from_gcs_url(element)
- file_data: FileDataType = {
- "mime_type": mime_type,
- "file_uri": element,
- }
- parts.append(PartType(file_data=file_data))
- elif _is_file_reference(element):
- if element not in resolved_files:
- raise ValueError(f"File reference {element} not resolved")
- file_info = resolved_files[element]
- file_data_ref: FileDataType = {
- "mime_type": file_info["mime_type"],
- "file_uri": file_info["uri"],
- }
- parts.append(PartType(file_data=file_data_ref))
- else:
- parts.append(PartType(text=element))
+ parts.append(_build_part_for_input(element, resolved_files=resolved_files))
request_body: dict = {
"content": ContentType(parts=parts),
@@ -245,7 +295,7 @@ def transform_openai_input_gemini_embed_content(
def process_embed_content_response(
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
model_response: EmbeddingResponse,
model: str,
response_json: dict,
@@ -291,7 +341,7 @@ def process_embed_content_response(
def process_response(
- input: EmbeddingInput,
+ input: GeminiEmbeddingInput,
model_response: EmbeddingResponse,
model: str,
_predictions: VertexAIBatchEmbeddingsResponseObject,
@@ -308,8 +358,29 @@ def process_response(
model_response.data = openai_embeddings
model_response.model = model
- input_text = get_formatted_prompt(data={"input": input}, call_type="embedding")
- prompt_tokens = token_counter(model=model, text=input_text)
+ has_nested = isinstance(input, list) and any(isinstance(e, list) for e in input)
+ if _is_multimodal_input(input) or has_nested:
+ input_list = input if isinstance(input, list) else [input]
+ text_elements: List[str] = []
+ for e in input_list:
+ if isinstance(e, list):
+ text_elements.extend(
+ sub
+ for sub in e
+ if isinstance(sub, str) and not _is_multimodal_element(sub)
+ )
+ elif isinstance(e, str) and not _is_multimodal_element(e):
+ text_elements.append(e)
+ if text_elements:
+ input_text = get_formatted_prompt(
+ data={"input": text_elements}, call_type="embedding"
+ )
+ prompt_tokens = token_counter(model=model, text=input_text)
+ else:
+ prompt_tokens = 0
+ else:
+ input_text = get_formatted_prompt(data={"input": input}, call_type="embedding")
+ prompt_tokens = token_counter(model=model, text=input_text)
model_response.usage = Usage(
prompt_tokens=prompt_tokens, total_tokens=prompt_tokens
)
diff --git a/litellm/llms/vertex_ai/vector_stores/search_api/transformation.py b/litellm/llms/vertex_ai/vector_stores/search_api/transformation.py
index 6cb7a86bea..61fb848b40 100644
--- a/litellm/llms/vertex_ai/vector_stores/search_api/transformation.py
+++ b/litellm/llms/vertex_ai/vector_stores/search_api/transformation.py
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
import httpx
from litellm import get_model_info
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.llms.base_llm.vector_store.transformation import BaseVectorStoreConfig
from litellm.llms.vertex_ai.vertex_llm_base import VertexBase
from litellm.types.router import GenericLiteLLMParams
@@ -91,12 +92,18 @@ class VertexSearchAPIVectorStoreConfig(BaseVectorStoreConfig, VertexBase):
raise ValueError("vector_store_id is required")
if api_base:
return api_base.rstrip("/")
+ encoded_collection_id = encode_url_path_segment(
+ collection_id, field_name="vertex_collection_id"
+ )
+ encoded_datastore_id = encode_url_path_segment(
+ datastore_id, field_name="vector_store_id"
+ )
# Vertex AI Search API endpoint for search
return (
f"https://discoveryengine.googleapis.com/v1/"
f"projects/{vertex_project}/locations/{vertex_location}/"
- f"collections/{collection_id}/dataStores/{datastore_id}/servingConfigs/default_config"
+ f"collections/{encoded_collection_id}/dataStores/{encoded_datastore_id}/servingConfigs/default_config"
)
def transform_search_vector_store_request(
diff --git a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py
index 5c3bbf61ee..4be4c2d5e7 100644
--- a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py
+++ b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py
@@ -13,6 +13,7 @@ from litellm.types.llms.vertex_ai import VertexPartnerProvider
from litellm.types.router import GenericLiteLLMParams
from ....vertex_llm_base import VertexBase
+from ..output_params_utils import sanitize_vertex_anthropic_output_params
class VertexAIPartnerModelsAnthropicMessagesConfig(AnthropicMessagesConfig, VertexBase):
@@ -158,12 +159,6 @@ class VertexAIPartnerModelsAnthropicMessagesConfig(AnthropicMessagesConfig, Vert
"model", None
) # do not pass model in request body to vertex ai
- anthropic_messages_request.pop(
- "output_format", None
- ) # do not pass output_format in request body to vertex ai - vertex ai does not support output_format as yet
-
- anthropic_messages_request.pop(
- "output_config", None
- ) # do not pass output_config in request body to vertex ai - vertex ai does not support output_config
+ sanitize_vertex_anthropic_output_params(anthropic_messages_request)
return anthropic_messages_request
diff --git a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/output_params_utils.py b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/output_params_utils.py
new file mode 100644
index 0000000000..a33ad67778
--- /dev/null
+++ b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/output_params_utils.py
@@ -0,0 +1,48 @@
+"""
+Shared sanitization for ``output_config`` / ``output_format`` on Vertex AI
+Claude. Lives in its own module so both the chat-completion transformation
+(``transformation.py``) and the Messages pass-through transformation
+(``experimental_pass_through/transformation.py``) can import it without
+forming a cycle through the parent module's heavier imports.
+
+CodeQL flagged the ``..transformation`` import path as a potential cyclic
+import; extracting the helper into a leaf module resolves the warning and
+keeps the parent module's import surface narrow.
+"""
+
+# Keys inside ``output_config`` that Vertex AI Claude does not accept.
+# Add an entry only when a 400 "Extra inputs are not permitted" is
+# reproducible against the live Vertex endpoint.
+VERTEX_UNSUPPORTED_OUTPUT_CONFIG_KEYS: frozenset = frozenset()
+
+
+def sanitize_vertex_anthropic_output_params(data: dict) -> None:
+ """
+ Strip Vertex-unsupported keys from ``output_config`` /
+ ``output_format`` in-place; forward whatever remains.
+
+ Behavior:
+ * ``output_config`` containing only unsupported keys (e.g. ``effort``
+ alone) is removed entirely so the request body has no empty dict.
+ * ``output_config`` containing a mix of supported + unsupported keys
+ has the unsupported subset filtered out and the rest forwarded.
+ * ``output_config`` that is supported in full passes through unchanged.
+ * ``output_format`` is forwarded as-is (Vertex AI Claude accepts it).
+ * Non-dict values for ``output_config`` are dropped to avoid sending
+ malformed payloads downstream.
+ """
+ output_config = data.get("output_config")
+ if output_config is None:
+ return
+ if not isinstance(output_config, dict):
+ data.pop("output_config", None)
+ return
+ sanitized = {
+ k: v
+ for k, v in output_config.items()
+ if k not in VERTEX_UNSUPPORTED_OUTPUT_CONFIG_KEYS
+ }
+ if sanitized:
+ data["output_config"] = sanitized
+ else:
+ data.pop("output_config", None)
diff --git a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py
index 504914c479..4627d9f6df 100644
--- a/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py
+++ b/litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py
@@ -10,6 +10,7 @@ from litellm.types.llms.openai import AllMessageValues
from litellm.types.utils import ModelResponse
from ....anthropic.chat.transformation import AnthropicConfig
+from .output_params_utils import sanitize_vertex_anthropic_output_params
class VertexAIError(Exception):
@@ -105,11 +106,7 @@ class VertexAIAnthropicConfig(AnthropicConfig):
data.pop("model", None) # vertex anthropic doesn't accept 'model' parameter
- # VertexAI doesn't support output_format parameter, remove it if present
- data.pop("output_format", None)
-
- # VertexAI doesn't support output_config parameter, remove it if present
- data.pop("output_config", None)
+ sanitize_vertex_anthropic_output_params(data)
tools = optional_params.get("tools")
tool_search_used = self.is_tool_search_used(tools)
diff --git a/litellm/llms/vertex_ai/vertex_model_garden/main.py b/litellm/llms/vertex_ai/vertex_model_garden/main.py
index c37bb449ec..7240d9dce5 100644
--- a/litellm/llms/vertex_ai/vertex_model_garden/main.py
+++ b/litellm/llms/vertex_ai/vertex_model_garden/main.py
@@ -27,6 +27,17 @@ from ..common_utils import VertexAIError, get_vertex_base_model_name
from ..vertex_llm_base import VertexBase
+def _vertex_model_garden_model_id_in_json_body(model: str) -> bool:
+ """
+ Vertex catalog / publisher models are addressed as publisher/model (e.g.
+ xai/grok-4.1-fast-reasoning) on the shared OpenAPI URL, with the id in the JSON body.
+
+ Deployed Model Garden endpoints are typically a single segment (often numeric)
+ and use .../endpoints/{ENDPOINT_ID}/chat/completions with an empty model field.
+ """
+ return "/" in model
+
+
def create_vertex_url(
vertex_location: str,
vertex_project: str,
@@ -34,8 +45,13 @@ def create_vertex_url(
model: str,
api_base: Optional[str] = None,
) -> str:
- """Return the base url for the vertex garden models"""
+ """Return the api base for vertex model garden (without /chat/completions)."""
base_url = get_vertex_base_url(vertex_location)
+ if _vertex_model_garden_model_id_in_json_body(model):
+ return (
+ f"{base_url}/v1/projects/{vertex_project}/locations/{vertex_location}"
+ "/endpoints/openapi"
+ )
return f"{base_url}/v1beta1/projects/{vertex_project}/locations/{vertex_location}/endpoints/{model}"
@@ -129,7 +145,10 @@ class VertexAIModelGardenModels(VertexBase):
vertex_location=vertex_location or "us-central1",
vertex_api_version="v1beta1",
)
- model = ""
+ # Publisher/catalog models: model id must be sent in the JSON body (OpenAPI route).
+ # Single-segment endpoint ids: model is encoded in the URL path; body model stays empty.
+ if not _vertex_model_garden_model_id_in_json_body(model):
+ model = ""
return openai_like_chat_completions.completion(
model=model,
messages=messages,
diff --git a/litellm/llms/volcengine/responses/transformation.py b/litellm/llms/volcengine/responses/transformation.py
index f6dda4dd25..99e0a958ef 100644
--- a/litellm/llms/volcengine/responses/transformation.py
+++ b/litellm/llms/volcengine/responses/transformation.py
@@ -17,6 +17,7 @@ from pydantic import fields as pyd_fields
import litellm
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.core_helpers import process_response_headers
+from litellm.litellm_core_utils.url_utils import encode_url_path_segment
from litellm.litellm_core_utils.llm_response_utils.convert_dict_to_response import (
_safe_convert_created_field,
)
@@ -300,7 +301,10 @@ class VolcEngineResponsesAPIConfig(OpenAIResponsesAPIConfig):
litellm_params: GenericLiteLLMParams,
headers: dict,
) -> Tuple[str, Dict]:
- url = f"{api_base}/{response_id}"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}"
data: Dict = {}
return url, data
@@ -333,7 +337,10 @@ class VolcEngineResponsesAPIConfig(OpenAIResponsesAPIConfig):
litellm_params: GenericLiteLLMParams,
headers: dict,
) -> Tuple[str, Dict]:
- url = f"{api_base}/{response_id}"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}"
data: Dict = {}
return url, data
@@ -372,7 +379,10 @@ class VolcEngineResponsesAPIConfig(OpenAIResponsesAPIConfig):
limit: int = 20,
order: Literal["asc", "desc"] = "desc",
) -> Tuple[str, Dict]:
- url = f"{api_base}/{response_id}/input_items"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}/input_items"
params: Dict[str, Any] = {}
if after is not None:
params["after"] = after
@@ -408,7 +418,10 @@ class VolcEngineResponsesAPIConfig(OpenAIResponsesAPIConfig):
litellm_params: GenericLiteLLMParams,
headers: dict,
) -> Tuple[str, Dict]:
- url = f"{api_base}/{response_id}/cancel"
+ encoded_response_id = encode_url_path_segment(
+ response_id, field_name="response_id"
+ )
+ url = f"{api_base}/{encoded_response_id}/cancel"
data: Dict = {}
return url, data
diff --git a/litellm/llms/xai/chat/transformation.py b/litellm/llms/xai/chat/transformation.py
index bfa55105a6..6300868a64 100644
--- a/litellm/llms/xai/chat/transformation.py
+++ b/litellm/llms/xai/chat/transformation.py
@@ -43,6 +43,7 @@ class XAIChatConfig(OpenAIGPTConfig):
"logprobs",
"max_tokens",
"n",
+ "parallel_tool_calls",
"presence_penalty",
"response_format",
"seed",
@@ -222,8 +223,43 @@ class XAIChatConfig(OpenAIGPTConfig):
self._enhance_usage_with_xai_web_search_fields(response, raw_response_json)
except Exception as e:
verbose_logger.debug(f"Error extracting X.AI web search usage: {e}")
+
+ self._fold_reasoning_tokens_into_completion(response)
return response
+ @staticmethod
+ def _fold_reasoning_tokens_into_completion(model_response: ModelResponse) -> None:
+ """Reconcile xAI Usage to the OpenAI invariant.
+
+ xAI accounts ``reasoning_tokens`` separately from
+ ``completion_tokens`` while still summing them into ``total_tokens``.
+ OpenAI's contract (o1/o3) folds reasoning into ``completion_tokens``,
+ so fold here to keep ``total = prompt + completion``. Idempotent.
+ """
+ usage = getattr(model_response, "usage", None)
+ if usage is None:
+ return
+
+ details = getattr(usage, "completion_tokens_details", None)
+ reasoning_tokens = (
+ int(getattr(details, "reasoning_tokens", 0) or 0) if details else 0
+ )
+ if reasoning_tokens <= 0:
+ return
+
+ prompt_tokens = int(getattr(usage, "prompt_tokens", 0) or 0)
+ completion_tokens = int(getattr(usage, "completion_tokens", 0) or 0)
+ total_tokens = int(getattr(usage, "total_tokens", 0) or 0)
+
+ if total_tokens == prompt_tokens + completion_tokens:
+ return
+
+ # Guard against double-counting if xAI changes accounting.
+ if total_tokens != prompt_tokens + completion_tokens + reasoning_tokens:
+ return
+
+ usage.completion_tokens = completion_tokens + reasoning_tokens
+
def _enhance_usage_with_xai_web_search_fields(
self, model_response: ModelResponse, raw_response_json: dict
) -> None:
diff --git a/litellm/llms/xai/cost_calculator.py b/litellm/llms/xai/cost_calculator.py
index 0cfcfe9841..8edfd0c27a 100644
--- a/litellm/llms/xai/cost_calculator.py
+++ b/litellm/llms/xai/cost_calculator.py
@@ -25,16 +25,25 @@ def cost_per_token(model: str, usage: Usage) -> Tuple[float, float]:
Returns:
Tuple[float, float] - prompt_cost_in_usd, completion_cost_in_usd
"""
- # XAI-specific completion cost calculation
- # For XAI models, completion is billed as (visible completion tokens + reasoning tokens)
+ # XAI-specific completion cost: completion is billed as visible + reasoning
+ # tokens. Detect when the transformation layer already folded them so we
+ # don't double-count; fall back to raw xAI shape for callers that bypass
+ # the transformation (e.g. proxy logs replayed into cost calc).
+ prompt_tokens = int(getattr(usage, "prompt_tokens", 0) or 0)
completion_tokens = int(getattr(usage, "completion_tokens", 0) or 0)
+ total_tokens = int(getattr(usage, "total_tokens", 0) or 0)
reasoning_tokens = 0
if hasattr(usage, "completion_tokens_details") and usage.completion_tokens_details:
reasoning_tokens = int(
getattr(usage.completion_tokens_details, "reasoning_tokens", 0) or 0
)
- total_completion_tokens = completion_tokens + reasoning_tokens
+ already_normalised = total_tokens == prompt_tokens + completion_tokens
+ total_completion_tokens = (
+ completion_tokens
+ if already_normalised
+ else completion_tokens + reasoning_tokens
+ )
modified_usage = Usage(
prompt_tokens=usage.prompt_tokens,
diff --git a/litellm/main.py b/litellm/main.py
index 0079bd750c..0553cf9d42 100644
--- a/litellm/main.py
+++ b/litellm/main.py
@@ -4923,8 +4923,17 @@ def embedding( # noqa: PLR0915
if encoding_format is not None:
optional_params["encoding_format"] = encoding_format
else:
- # Omiting causes openai sdk to add default value of "float"
- optional_params["encoding_format"] = None
+ env_fmt = get_secret_str("LITELLM_DEFAULT_EMBEDDING_ENCODING_FORMAT")
+ if env_fmt is not None and env_fmt.strip().lower() == "none":
+ optional_params.pop("encoding_format", None)
+ else:
+ _default_fmt = (
+ optional_params.get("encoding_format") or env_fmt or "float"
+ )
+ if _default_fmt.strip().lower() == "none":
+ optional_params.pop("encoding_format", None)
+ else:
+ optional_params["encoding_format"] = _default_fmt
api_version = None
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index 13a45fd165..7946e2dcee 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -977,6 +977,7 @@
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
+ "supports_minimal_reasoning_effort": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -1162,6 +1163,21 @@
"supports_max_reasoning_effort": true,
"supports_minimal_reasoning_effort": true
},
+ "anthropic.claude-mythos-preview": {
+ "input_cost_per_token": 0,
+ "output_cost_per_token": 0,
+ "litellm_provider": "bedrock",
+ "max_input_tokens": 1000000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_vision": true,
+ "supports_prompt_caching": false,
+ "supports_reasoning": true,
+ "supports_minimal_reasoning_effort": true,
+ "supports_tool_choice": true
+ },
"global.anthropic.claude-opus-4-7": {
"cache_creation_input_token_cost": 6.25e-06,
"cache_creation_input_token_cost_above_1hr": 1e-05,
@@ -1307,6 +1323,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -1336,6 +1353,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -1365,6 +1383,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -1393,6 +1412,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -1421,6 +1441,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -1915,6 +1936,7 @@
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
+ "supports_minimal_reasoning_effort": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true
@@ -2038,6 +2060,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -9212,6 +9235,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -9347,6 +9371,7 @@
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
+ "supports_minimal_reasoning_effort": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -9374,6 +9399,7 @@
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
+ "supports_minimal_reasoning_effort": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -9477,7 +9503,6 @@
"us": 1.1,
"fast": 6.0
},
- "supports_max_reasoning_effort": true,
"supports_minimal_reasoning_effort": true
},
"claude-opus-4-7-20260416": {
@@ -9512,7 +9537,6 @@
"us": 1.1,
"fast": 6.0
},
- "supports_max_reasoning_effort": true,
"supports_minimal_reasoning_effort": true
},
"claude-sonnet-4-20250514": {
@@ -10790,6 +10814,7 @@
"supports_assistant_prefill": true,
"supports_function_calling": true,
"supports_reasoning": true,
+ "supports_minimal_reasoning_effort": true,
"supports_tool_choice": true
},
"databricks/databricks-claude-sonnet-4": {
@@ -15548,7 +15573,7 @@
"mode": "embedding",
"output_cost_per_token": 0,
"output_vector_size": 3072,
- "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
+ "source": "https://ai.google.dev/gemini-api/docs/embeddings#multimodal",
"supports_multimodal": true,
"uses_embed_content": true
},
@@ -17150,7 +17175,8 @@
],
"supports_function_calling": true,
"supports_parallel_function_calling": true,
- "supports_vision": true
+ "supports_vision": true,
+ "supports_minimal_reasoning_effort": true
},
"github_copilot/claude-opus-4.6-fast": {
"litellm_provider": "github_copilot",
@@ -17663,7 +17689,8 @@
"mode": "chat",
"output_cost_per_token": 2.5e-05,
"supports_function_calling": true,
- "supports_vision": true
+ "supports_vision": true,
+ "supports_minimal_reasoning_effort": true
},
"gmi/anthropic/claude-sonnet-4.5": {
"input_cost_per_token": 3e-06,
@@ -19928,7 +19955,7 @@
"supports_web_search": true,
"supports_none_reasoning_effort": true,
"supports_xhigh_reasoning_effort": true,
- "supports_minimal_reasoning_effort": true
+ "supports_minimal_reasoning_effort": false
},
"gpt-5.5-2026-04-23": {
"cache_read_input_token_cost": 5e-07,
@@ -19976,7 +20003,7 @@
"supports_web_search": true,
"supports_none_reasoning_effort": true,
"supports_xhigh_reasoning_effort": true,
- "supports_minimal_reasoning_effort": true
+ "supports_minimal_reasoning_effort": false
},
"gpt-5.5-pro": {
"cache_read_input_token_cost": 3e-06,
@@ -20019,7 +20046,8 @@
"supports_web_search": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
- "supports_minimal_reasoning_effort": true
+ "supports_minimal_reasoning_effort": false,
+ "supports_low_reasoning_effort": false
},
"gpt-5.5-pro-2026-04-23": {
"cache_read_input_token_cost": 3e-06,
@@ -20062,7 +20090,8 @@
"supports_web_search": true,
"supports_none_reasoning_effort": false,
"supports_xhigh_reasoning_effort": true,
- "supports_minimal_reasoning_effort": true
+ "supports_minimal_reasoning_effort": false,
+ "supports_low_reasoning_effort": false
},
"gpt-5.4": {
"cache_read_input_token_cost": 2.5e-07,
@@ -21140,7 +21169,7 @@
},
"gradient_ai/alibaba-qwen3-32b": {
"litellm_provider": "gradient_ai",
- "max_tokens": 2048,
+ "max_tokens": 40960,
"mode": "chat",
"supported_endpoints": [
"/v1/chat/completions"
@@ -21148,7 +21177,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 131072,
+ "max_output_tokens": 40960
},
"gradient_ai/anthropic-claude-3-opus": {
"input_cost_per_token": 1.5e-05,
@@ -21162,7 +21193,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 1024
},
"gradient_ai/anthropic-claude-3.5-haiku": {
"input_cost_per_token": 8e-07,
@@ -21176,7 +21209,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 1024
},
"gradient_ai/anthropic-claude-3.5-sonnet": {
"input_cost_per_token": 3e-06,
@@ -21190,7 +21225,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 1024
},
"gradient_ai/anthropic-claude-3.7-sonnet": {
"input_cost_per_token": 3e-06,
@@ -21204,7 +21241,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 1024
},
"gradient_ai/deepseek-r1-distill-llama-70b": {
"input_cost_per_token": 9.9e-07,
@@ -21218,7 +21257,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 32768,
+ "max_output_tokens": 8000
},
"gradient_ai/llama3-8b-instruct": {
"input_cost_per_token": 2e-07,
@@ -21232,7 +21273,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 8192,
+ "max_output_tokens": 512
},
"gradient_ai/llama3.3-70b-instruct": {
"input_cost_per_token": 6.5e-07,
@@ -21246,7 +21289,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 2048
},
"gradient_ai/mistral-nemo-instruct-2407": {
"input_cost_per_token": 3e-07,
@@ -21260,7 +21305,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 512
},
"gradient_ai/openai-gpt-4o": {
"litellm_provider": "gradient_ai",
@@ -21272,7 +21319,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 16384
},
"gradient_ai/openai-gpt-4o-mini": {
"litellm_provider": "gradient_ai",
@@ -21284,7 +21333,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 16384
},
"gradient_ai/openai-o3": {
"input_cost_per_token": 2e-06,
@@ -21298,7 +21349,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 100000
},
"gradient_ai/openai-o3-mini": {
"input_cost_per_token": 1.1e-06,
@@ -21312,7 +21365,9 @@
"supported_modalities": [
"text"
],
- "supports_tool_choice": false
+ "supports_tool_choice": false,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 100000
},
"lemonade/Qwen3-Coder-30B-A3B-Instruct-GGUF": {
"input_cost_per_token": 0,
@@ -21612,11 +21667,13 @@
},
"heroku/claude-3-5-haiku": {
"litellm_provider": "heroku",
- "max_tokens": 4096,
+ "max_tokens": 8192,
"mode": "chat",
"supports_function_calling": true,
"supports_system_messages": true,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 8192
},
"heroku/claude-3-5-sonnet-latest": {
"litellm_provider": "heroku",
@@ -21624,7 +21681,9 @@
"mode": "chat",
"supports_function_calling": true,
"supports_system_messages": true,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 8192
},
"heroku/claude-3-7-sonnet": {
"litellm_provider": "heroku",
@@ -21632,7 +21691,9 @@
"mode": "chat",
"supports_function_calling": true,
"supports_system_messages": true,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 8192
},
"heroku/claude-4-sonnet": {
"litellm_provider": "heroku",
@@ -21640,7 +21701,9 @@
"mode": "chat",
"supports_function_calling": true,
"supports_system_messages": true,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 8192
},
"high/1024-x-1024/gpt-image-1": {
"input_cost_per_image": 0.167,
@@ -22061,6 +22124,98 @@
"tool_use_system_prompt_tokens": 346,
"supports_native_structured_output": true
},
+ "crusoe/deepseek-ai/DeepSeek-R1-0528": {
+ "input_cost_per_token": 3e-06,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 163840,
+ "max_output_tokens": 163840,
+ "max_tokens": 163840,
+ "mode": "chat",
+ "output_cost_per_token": 7e-06,
+ "supports_function_calling": false,
+ "supports_reasoning": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": false
+ },
+ "crusoe/deepseek-ai/DeepSeek-V3-0324": {
+ "input_cost_per_token": 1.5e-06,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 163840,
+ "max_output_tokens": 163840,
+ "max_tokens": 163840,
+ "mode": "chat",
+ "output_cost_per_token": 1.5e-06,
+ "supports_function_calling": true,
+ "supports_parallel_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true
+ },
+ "crusoe/google/gemma-3-12b-it": {
+ "input_cost_per_token": 1e-07,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "max_tokens": 131072,
+ "mode": "chat",
+ "output_cost_per_token": 1e-07,
+ "supports_function_calling": true,
+ "supports_parallel_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "supports_vision": true
+ },
+ "crusoe/meta-llama/Llama-3.3-70B-Instruct": {
+ "input_cost_per_token": 2e-07,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "max_tokens": 131072,
+ "mode": "chat",
+ "output_cost_per_token": 2e-07,
+ "supports_function_calling": true,
+ "supports_parallel_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true
+ },
+ "crusoe/moonshotai/Kimi-K2-Thinking": {
+ "input_cost_per_token": 2.5e-06,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 262144,
+ "max_output_tokens": 262144,
+ "max_tokens": 262144,
+ "mode": "chat",
+ "output_cost_per_token": 2.5e-06,
+ "supports_function_calling": false,
+ "supports_reasoning": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": false
+ },
+ "crusoe/openai/gpt-oss-120b": {
+ "input_cost_per_token": 8e-07,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "max_tokens": 131072,
+ "mode": "chat",
+ "output_cost_per_token": 8e-07,
+ "supports_function_calling": true,
+ "supports_parallel_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true
+ },
+ "crusoe/Qwen/Qwen3-235B-A22B-Instruct-2507": {
+ "input_cost_per_token": 3e-06,
+ "litellm_provider": "crusoe",
+ "max_input_tokens": 262144,
+ "max_output_tokens": 262144,
+ "max_tokens": 262144,
+ "mode": "chat",
+ "output_cost_per_token": 3e-06,
+ "supports_function_calling": true,
+ "supports_parallel_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true
+ },
"lambda_ai/deepseek-llama3.3-70b": {
"input_cost_per_token": 2e-07,
"litellm_provider": "lambda_ai",
@@ -22356,48 +22511,6 @@
"/v1/images/generations"
]
},
- "luminous-base": {
- "input_cost_per_token": 3e-05,
- "litellm_provider": "aleph_alpha",
- "max_tokens": 2048,
- "mode": "completion",
- "output_cost_per_token": 3.3e-05
- },
- "luminous-base-control": {
- "input_cost_per_token": 3.75e-05,
- "litellm_provider": "aleph_alpha",
- "max_tokens": 2048,
- "mode": "chat",
- "output_cost_per_token": 4.125e-05
- },
- "luminous-extended": {
- "input_cost_per_token": 4.5e-05,
- "litellm_provider": "aleph_alpha",
- "max_tokens": 2048,
- "mode": "completion",
- "output_cost_per_token": 4.95e-05
- },
- "luminous-extended-control": {
- "input_cost_per_token": 5.625e-05,
- "litellm_provider": "aleph_alpha",
- "max_tokens": 2048,
- "mode": "chat",
- "output_cost_per_token": 6.1875e-05
- },
- "luminous-supreme": {
- "input_cost_per_token": 0.000175,
- "litellm_provider": "aleph_alpha",
- "max_tokens": 2048,
- "mode": "completion",
- "output_cost_per_token": 0.0001925
- },
- "luminous-supreme-control": {
- "input_cost_per_token": 0.00021875,
- "litellm_provider": "aleph_alpha",
- "max_tokens": 2048,
- "mode": "chat",
- "output_cost_per_token": 0.000240625
- },
"max-x-max/50-steps/stability.stable-diffusion-xl-v0": {
"litellm_provider": "bedrock",
"max_input_tokens": 77,
@@ -25869,12 +25982,14 @@
"input_cost_per_image": 0.0004,
"input_cost_per_token": 2.5e-07,
"litellm_provider": "openrouter",
- "max_tokens": 200000,
+ "max_tokens": 4096,
"mode": "chat",
"output_cost_per_token": 1.25e-06,
"supports_function_calling": true,
"supports_tool_choice": true,
- "supports_vision": true
+ "supports_vision": true,
+ "max_input_tokens": 200000,
+ "max_output_tokens": 4096
},
"openrouter/anthropic/claude-3.5-sonnet": {
"input_cost_per_token": 3e-06,
@@ -25993,6 +26108,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 159,
@@ -26011,6 +26127,7 @@
"supports_assistant_prefill": true,
"supports_computer_use": true,
"supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
@@ -26032,6 +26149,7 @@
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -26080,6 +26198,29 @@
"supports_vision": true,
"tool_use_system_prompt_tokens": 346
},
+ "openrouter/anthropic/claude-opus-4.7": {
+ "cache_creation_input_token_cost": 6.25e-06,
+ "cache_read_input_token_cost": 5e-07,
+ "input_cost_per_token": 5e-06,
+ "litellm_provider": "openrouter",
+ "max_input_tokens": 1000000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "output_cost_per_token": 2.5e-05,
+ "supports_assistant_prefill": false,
+ "supports_computer_use": true,
+ "supports_function_calling": true,
+ "supports_pdf_input": true,
+ "supports_prompt_caching": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_xhigh_reasoning_effort": true,
+ "tool_use_system_prompt_tokens": 346
+ },
"openrouter/bytedance/ui-tars-1.5-7b": {
"input_cost_per_token": 1e-07,
"litellm_provider": "openrouter",
@@ -26445,18 +26586,22 @@
"openrouter/mancer/weaver": {
"input_cost_per_token": 5.625e-06,
"litellm_provider": "openrouter",
- "max_tokens": 8000,
+ "max_tokens": 2000,
"mode": "chat",
"output_cost_per_token": 5.625e-06,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 8000,
+ "max_output_tokens": 2000
},
"openrouter/meta-llama/llama-3-70b-instruct": {
"input_cost_per_token": 5.9e-07,
"litellm_provider": "openrouter",
- "max_tokens": 8192,
+ "max_tokens": 8000,
"mode": "chat",
"output_cost_per_token": 7.9e-07,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 8192,
+ "max_output_tokens": 8000
},
"openrouter/minimax/minimax-m2": {
"input_cost_per_token": 2.55e-07,
@@ -26544,34 +26689,42 @@
"openrouter/mistralai/mistral-7b-instruct": {
"input_cost_per_token": 1.3e-07,
"litellm_provider": "openrouter",
- "max_tokens": 8192,
+ "max_tokens": 8191,
"mode": "chat",
"output_cost_per_token": 1.3e-07,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 32768,
+ "max_output_tokens": 8191
},
"openrouter/mistralai/mistral-large": {
"input_cost_per_token": 8e-06,
"litellm_provider": "openrouter",
- "max_tokens": 32000,
+ "max_tokens": 8191,
"mode": "chat",
"output_cost_per_token": 2.4e-05,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 8191
},
"openrouter/mistralai/mistral-small-3.1-24b-instruct": {
"input_cost_per_token": 1e-07,
"litellm_provider": "openrouter",
- "max_tokens": 32000,
+ "max_tokens": 131072,
"mode": "chat",
"output_cost_per_token": 3e-07,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072
},
"openrouter/mistralai/mistral-small-3.2-24b-instruct": {
"input_cost_per_token": 1e-07,
"litellm_provider": "openrouter",
- "max_tokens": 32000,
+ "max_tokens": 128000,
"mode": "chat",
"output_cost_per_token": 3e-07,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 128000
},
"openrouter/mistralai/mixtral-8x22b-instruct": {
"input_cost_per_token": 6.5e-07,
@@ -26579,7 +26732,9 @@
"max_tokens": 65536,
"mode": "chat",
"output_cost_per_token": 6.5e-07,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 65536,
+ "max_output_tokens": 65536
},
"openrouter/moonshotai/kimi-k2.5": {
"cache_read_input_token_cost": 1e-07,
@@ -26599,26 +26754,32 @@
"openrouter/openai/gpt-3.5-turbo": {
"input_cost_per_token": 1.5e-06,
"litellm_provider": "openrouter",
- "max_tokens": 4095,
+ "max_tokens": 4096,
"mode": "chat",
"output_cost_per_token": 2e-06,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 16385,
+ "max_output_tokens": 4096
},
"openrouter/openai/gpt-3.5-turbo-16k": {
"input_cost_per_token": 3e-06,
"litellm_provider": "openrouter",
- "max_tokens": 16383,
+ "max_tokens": 4096,
"mode": "chat",
"output_cost_per_token": 4e-06,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 16385,
+ "max_output_tokens": 4096
},
"openrouter/openai/gpt-4": {
"input_cost_per_token": 3e-05,
"litellm_provider": "openrouter",
- "max_tokens": 8192,
+ "max_tokens": 4096,
"mode": "chat",
"output_cost_per_token": 6e-05,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 8191,
+ "max_output_tokens": 4096
},
"openrouter/openai/gpt-4.1": {
"cache_read_input_token_cost": 5e-07,
@@ -27126,10 +27287,12 @@
"openrouter/undi95/remm-slerp-l2-13b": {
"input_cost_per_token": 1.875e-06,
"litellm_provider": "openrouter",
- "max_tokens": 6144,
+ "max_tokens": 4096,
"mode": "chat",
"output_cost_per_token": 1.875e-06,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 6144,
+ "max_output_tokens": 4096
},
"openrouter/x-ai/grok-4": {
"input_cost_per_token": 3e-06,
@@ -27932,7 +28095,8 @@
"mode": "responses",
"supports_web_search": true,
"supports_reasoning": false,
- "supports_function_calling": true
+ "supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true
},
"perplexity/anthropic/claude-sonnet-4-5": {
"litellm_provider": "perplexity",
@@ -29750,14 +29914,16 @@
"together_ai/deepseek-ai/DeepSeek-V3.1": {
"input_cost_per_token": 6e-07,
"litellm_provider": "together_ai",
- "max_tokens": 128000,
+ "max_tokens": 16384,
"mode": "chat",
"output_cost_per_token": 1.7e-06,
"source": "https://www.together.ai/models/deepseek-v3-1",
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_reasoning": true,
- "supports_tool_choice": true
+ "supports_tool_choice": true,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 16384
},
"together_ai/meta-llama/Llama-3.2-3B-Instruct-Turbo": {
"litellm_provider": "together_ai",
@@ -30409,6 +30575,7 @@
"supports_assistant_prefill": true,
"supports_computer_use": true,
"supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
@@ -30437,6 +30604,7 @@
"supports_assistant_prefill": true,
"supports_computer_use": true,
"supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
@@ -30464,6 +30632,7 @@
"supports_assistant_prefill": true,
"supports_computer_use": true,
"supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
@@ -31044,6 +31213,7 @@
"output_cost_per_token": 2.5e-05,
"supports_assistant_prefill": true,
"supports_computer_use": true,
+ "supports_minimal_reasoning_effort": true,
"supports_function_calling": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
@@ -32236,6 +32406,7 @@
"supports_assistant_prefill": true,
"supports_computer_use": true,
"supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
@@ -32262,6 +32433,7 @@
"supports_assistant_prefill": true,
"supports_computer_use": true,
"supports_function_calling": true,
+ "supports_minimal_reasoning_effort": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_reasoning": true,
@@ -32428,6 +32600,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -33337,6 +33510,72 @@
"source": "https://console.cloud.google.com/vertex-ai/publishers/openai/model-garden/gpt-oss-120b-maas",
"supports_reasoning": true
},
+ "vertex_ai/xai/grok-4.1-fast-non-reasoning": {
+ "cache_read_input_token_cost": 5e-08,
+ "input_cost_per_token": 2e-07,
+ "litellm_provider": "vertex_ai",
+ "max_input_tokens": 2000000,
+ "max_output_tokens": 2000000,
+ "max_tokens": 2000000,
+ "mode": "chat",
+ "output_cost_per_token": 5e-07,
+ "source": "https://docs.x.ai/docs/models (Vertex AI Model Garden)",
+ "supports_function_calling": true,
+ "supports_response_schema": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true
+ },
+ "vertex_ai/xai/grok-4.1-fast-reasoning": {
+ "cache_read_input_token_cost": 5e-08,
+ "input_cost_per_token": 2e-07,
+ "litellm_provider": "vertex_ai",
+ "max_input_tokens": 2000000,
+ "max_output_tokens": 2000000,
+ "max_tokens": 2000000,
+ "mode": "chat",
+ "output_cost_per_token": 5e-07,
+ "source": "https://docs.x.ai/docs/models (Vertex AI Model Garden)",
+ "supports_function_calling": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true
+ },
+ "vertex_ai/xai/grok-4.20-non-reasoning": {
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
+ "litellm_provider": "vertex_ai",
+ "max_input_tokens": 2000000,
+ "max_output_tokens": 2000000,
+ "max_tokens": 2000000,
+ "mode": "chat",
+ "output_cost_per_token": 6e-06,
+ "source": "https://docs.x.ai/docs/models (Vertex AI Model Garden)",
+ "supports_function_calling": true,
+ "supports_response_schema": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true
+ },
+ "vertex_ai/xai/grok-4.20-reasoning": {
+ "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2e-06,
+ "litellm_provider": "vertex_ai",
+ "max_input_tokens": 2000000,
+ "max_output_tokens": 2000000,
+ "max_tokens": 2000000,
+ "mode": "chat",
+ "output_cost_per_token": 6e-06,
+ "source": "https://docs.x.ai/docs/models (Vertex AI Model Garden)",
+ "supports_function_calling": true,
+ "supports_reasoning": true,
+ "supports_response_schema": true,
+ "supports_tool_choice": true,
+ "supports_vision": true,
+ "supports_web_search": true
+ },
"vertex_ai/qwen/qwen3-235b-a22b-instruct-2507-maas": {
"input_cost_per_token": 2.5e-07,
"litellm_provider": "vertex_ai-qwen_models",
@@ -34266,6 +34505,7 @@
"output_cost_per_token": 1.5e-05,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": false,
"supports_tool_choice": true,
"supports_web_search": true
@@ -34281,6 +34521,7 @@
"output_cost_per_token": 1.5e-05,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": false,
"supports_tool_choice": true,
"supports_web_search": true
@@ -34296,6 +34537,7 @@
"output_cost_per_token": 2.5e-05,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": false,
"supports_tool_choice": true,
"supports_web_search": true
@@ -34311,6 +34553,7 @@
"output_cost_per_token": 2.5e-05,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": false,
"supports_tool_choice": true,
"supports_web_search": true
@@ -34326,6 +34569,7 @@
"output_cost_per_token": 1.5e-05,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": false,
"supports_tool_choice": true,
"supports_web_search": true
@@ -34342,6 +34586,7 @@
"output_cost_per_token": 5e-07,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_tool_choice": true,
@@ -34359,6 +34604,7 @@
"output_cost_per_token": 5e-07,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_tool_choice": true,
@@ -34375,6 +34621,7 @@
"output_cost_per_token": 4e-06,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_tool_choice": true,
@@ -34391,6 +34638,7 @@
"output_cost_per_token": 4e-06,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_tool_choice": true,
@@ -34407,6 +34655,7 @@
"output_cost_per_token": 4e-06,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_tool_choice": true,
@@ -34423,6 +34672,7 @@
"output_cost_per_token": 5e-07,
"source": "https://x.ai/api#pricing",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": false,
"supports_tool_choice": true,
@@ -34438,38 +34688,41 @@
"output_cost_per_token": 1.5e-05,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_tool_choice": true,
"supports_web_search": true
},
"xai/grok-4-fast-reasoning": {
+ "cache_read_input_token_cost": 5e-08,
+ "input_cost_per_token": 2e-07,
+ "input_cost_per_token_above_128k_tokens": 4e-07,
"litellm_provider": "xai",
"max_input_tokens": 2000000.0,
"max_output_tokens": 2000000.0,
"max_tokens": 2000000.0,
"mode": "chat",
- "input_cost_per_token": 2e-07,
- "input_cost_per_token_above_128k_tokens": 4e-07,
"output_cost_per_token": 5e-07,
"output_cost_per_token_above_128k_tokens": 1e-06,
- "cache_read_input_token_cost": 5e-08,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_tool_choice": true,
"supports_web_search": true
},
"xai/grok-4-fast-non-reasoning": {
+ "cache_read_input_token_cost": 5e-08,
+ "input_cost_per_token": 2e-07,
+ "input_cost_per_token_above_128k_tokens": 4e-07,
"litellm_provider": "xai",
"max_input_tokens": 2000000.0,
"max_output_tokens": 2000000.0,
- "cache_read_input_token_cost": 5e-08,
"max_tokens": 2000000.0,
"mode": "chat",
- "input_cost_per_token": 2e-07,
- "input_cost_per_token_above_128k_tokens": 4e-07,
"output_cost_per_token": 5e-07,
"output_cost_per_token_above_128k_tokens": 1e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_tool_choice": true,
"supports_web_search": true
},
@@ -34485,6 +34738,7 @@
"output_cost_per_token_above_128k_tokens": 3e-05,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_tool_choice": true,
"supports_web_search": true
},
@@ -34500,6 +34754,7 @@
"output_cost_per_token_above_128k_tokens": 3e-05,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_tool_choice": true,
"supports_web_search": true
},
@@ -34517,6 +34772,7 @@
"source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning",
"supports_audio_input": true,
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
@@ -34537,6 +34793,7 @@
"source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning",
"supports_audio_input": true,
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
@@ -34557,6 +34814,7 @@
"source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning",
"supports_audio_input": true,
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
"supports_tool_choice": true,
@@ -34577,6 +34835,7 @@
"source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning",
"supports_audio_input": true,
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -34596,6 +34855,7 @@
"source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning",
"supports_audio_input": true,
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_response_schema": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -34612,6 +34872,7 @@
"output_cost_per_token": 6e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -34628,6 +34889,7 @@
"output_cost_per_token": 6e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true,
"supports_vision": true,
@@ -34660,6 +34922,7 @@
"output_cost_per_token": 6e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_tool_choice": true,
"supports_vision": true,
"supports_web_search": true
@@ -34688,6 +34951,7 @@
"output_cost_per_token": 1.5e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
},
@@ -34702,6 +34966,7 @@
"output_cost_per_token": 1.5e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
},
@@ -34716,6 +34981,7 @@
"output_cost_per_token": 1.5e-06,
"source": "https://docs.x.ai/docs/models",
"supports_function_calling": true,
+ "supports_prompt_caching": true,
"supports_reasoning": true,
"supports_tool_choice": true
},
@@ -34747,6 +35013,20 @@
"supports_tool_choice": true,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
+ "zai.glm-5": {
+ "input_cost_per_token": 1e-06,
+ "litellm_provider": "bedrock_converse",
+ "max_input_tokens": 200000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "output_cost_per_token": 3.2e-06,
+ "supports_function_calling": true,
+ "supports_reasoning": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
"zai.glm-4.7-flash": {
"input_cost_per_token": 7e-08,
"litellm_provider": "bedrock_converse",
@@ -39332,6 +39612,7 @@
"supports_prompt_caching": true,
"supports_reasoning": true,
"supports_response_schema": true,
+ "supports_max_reasoning_effort": true,
"supports_tool_choice": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 346,
@@ -39556,6 +39837,87 @@
}
]
},
+ "zai.glm-5": {
+ "input_cost_per_token": 1e-06,
+ "output_cost_per_token": 3.2e-06,
+ "litellm_provider": "bedrock_converse",
+ "max_input_tokens": 200000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_reasoning": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
+ "bedrock/us-east-1/zai.glm-5": {
+ "input_cost_per_token": 1e-06,
+ "output_cost_per_token": 3.2e-06,
+ "litellm_provider": "bedrock",
+ "max_input_tokens": 200000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_reasoning": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
+ "bedrock/us-west-2/zai.glm-5": {
+ "input_cost_per_token": 1e-06,
+ "output_cost_per_token": 3.2e-06,
+ "litellm_provider": "bedrock",
+ "max_input_tokens": 200000,
+ "max_output_tokens": 128000,
+ "max_tokens": 128000,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_reasoning": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
+ "minimax.minimax-m2.5": {
+ "input_cost_per_token": 3e-07,
+ "output_cost_per_token": 1.2e-06,
+ "litellm_provider": "bedrock_converse",
+ "max_input_tokens": 1000000,
+ "max_output_tokens": 8192,
+ "max_tokens": 8192,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
+ "bedrock/us-east-1/minimax.minimax-m2.5": {
+ "input_cost_per_token": 3e-07,
+ "output_cost_per_token": 1.2e-06,
+ "litellm_provider": "bedrock",
+ "max_input_tokens": 1000000,
+ "max_output_tokens": 8192,
+ "max_tokens": 8192,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
+ "bedrock/us-west-2/minimax.minimax-m2.5": {
+ "input_cost_per_token": 3e-07,
+ "output_cost_per_token": 1.2e-06,
+ "litellm_provider": "bedrock",
+ "max_input_tokens": 1000000,
+ "max_output_tokens": 8192,
+ "max_tokens": 8192,
+ "mode": "chat",
+ "supports_function_calling": true,
+ "supports_system_messages": true,
+ "supports_tool_choice": true,
+ "source": "https://aws.amazon.com/bedrock/pricing/"
+ },
"bedrock/us-gov-east-1/anthropic.claude-haiku-4-5-20251001-v1:0": {
"cache_creation_input_token_cost": 1.5e-06,
"cache_read_input_token_cost": 1.2e-07,
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 756b2ed91d..a05af66118 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
@@ -409,9 +409,12 @@ class MCPRequestHandler:
Permission hierarchy (all rules are intersections):
1. Get allowed servers from key permissions
- 2. Get allowed servers from team permissions
- 3. Get allowed servers from end_user permissions
- 4. Final result = intersection of key/team AND end_user (if end_user has permissions set)
+ 2. Get allowed servers from team permissions (key inherits from team, or intersection)
+ 3. Get allowed servers from end_user permissions (intersected if set)
+ 4. Get allowed servers from agent permissions (intersected if set)
+ 5. Get allowed servers from org permissions — org acts as a ceiling: if the org
+ has an explicit MCP server list, the combined key/team/end_user/agent result is
+ capped to that list. If the org has no list, no extra restriction is applied.
Returns:
List[str]: List of allowed MCP servers by server id
@@ -435,6 +438,10 @@ class MCPRequestHandler:
# Calculate key/team allowed servers using inheritance and intersection logic
#########################################################
allowed_mcp_servers: List[str] = []
+ has_lower_level_mcp_restrictions = (
+ len(allowed_mcp_servers_for_key) > 0
+ or len(allowed_mcp_servers_for_team) > 0
+ )
if len(allowed_mcp_servers_for_team) > 0:
if len(allowed_mcp_servers_for_key) > 0:
# Key has its own MCP permissions - use intersection with team permissions
@@ -459,6 +466,7 @@ class MCPRequestHandler:
# If end_user has explicit MCP server permissions, apply intersection
if len(allowed_mcp_servers_for_end_user) > 0:
+ has_lower_level_mcp_restrictions = True
verbose_logger.debug(
f"End user {user_api_key_auth.end_user_id} has explicit MCP permissions: {allowed_mcp_servers_for_end_user}"
)
@@ -490,6 +498,7 @@ class MCPRequestHandler:
)
)
if len(allowed_mcp_servers_for_agent) > 0:
+ has_lower_level_mcp_restrictions = True
# Intersect: agent can only use servers allowed by BOTH key/team AND agent config
allowed_mcp_servers = [
s
@@ -500,6 +509,30 @@ class MCPRequestHandler:
f"Applied agent intersection filter. Final allowed servers: {allowed_mcp_servers}"
)
+ #########################################################
+ # Apply org-level ceiling if org_id is set
+ #########################################################
+ if user_api_key_auth and user_api_key_auth.org_id:
+ allowed_mcp_servers_for_org = (
+ await MCPRequestHandler._get_allowed_mcp_servers_for_org(
+ user_api_key_auth
+ )
+ )
+ if len(allowed_mcp_servers_for_org) > 0:
+ if has_lower_level_mcp_restrictions:
+ # Lower-level restrictions exist, so org can only cap them.
+ allowed_mcp_servers = [
+ s
+ for s in allowed_mcp_servers
+ if s in allowed_mcp_servers_for_org
+ ]
+ else:
+ # No lower-level restrictions → org list becomes the ceiling
+ allowed_mcp_servers = allowed_mcp_servers_for_org
+ verbose_logger.debug(
+ f"Applied org ceiling filter. Final allowed servers: {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)}")
@@ -638,6 +671,27 @@ class MCPRequestHandler:
allowed_tools = list(set(allowed_tools) & set(agent_tools))
else:
allowed_tools = agent_tools
+
+ # Apply org-level tool ceiling if org_id is set
+ if user_api_key_auth.org_id:
+ # _get_org_object_permission uses user_api_key_cache, so this is not a
+ # fresh DB round-trip when get_allowed_mcp_servers was already called.
+ org_obj_perm = await MCPRequestHandler._get_org_object_permission(
+ user_api_key_auth
+ )
+ org_tools = (
+ global_mcp_server_manager.expand_tool_permissions(
+ org_obj_perm.mcp_tool_permissions
+ ).get(server_id)
+ if org_obj_perm and org_obj_perm.mcp_tool_permissions
+ else None
+ )
+ if org_tools is not None:
+ if allowed_tools is not None:
+ allowed_tools = list(set(allowed_tools) & set(org_tools))
+ else:
+ allowed_tools = list(org_tools)
+
return allowed_tools
except Exception as e:
@@ -805,6 +859,120 @@ class MCPRequestHandler:
)
return []
+ # Sentinel stored in cache when an org has no object_permission, so we
+ # don't re-query the DB on every MCP request for that org.
+ _ORG_NO_PERMISSION_SENTINEL = "__org_no_mcp_permission__"
+
+ @staticmethod
+ async def _get_org_object_permission(
+ user_api_key_auth: Optional[UserAPIKeyAuth] = None,
+ ):
+ """
+ Get org object_permission, using user_api_key_cache to avoid DB hits on every request.
+
+ Caches both positive results and the absence of an object_permission so that orgs
+ with no MCP permissions configured (the common default) do not trigger a DB query
+ on every request.
+ """
+ from litellm.proxy.proxy_server import prisma_client, user_api_key_cache
+
+ if not user_api_key_auth or not user_api_key_auth.org_id:
+ return None
+
+ if prisma_client is None:
+ verbose_logger.debug("prisma_client is None")
+ return None
+
+ org_id = user_api_key_auth.org_id
+ cache_key = f"org_object_permission:{org_id}"
+
+ from litellm.proxy._types import LiteLLM_ObjectPermissionTable
+
+ try:
+ cached = await user_api_key_cache.async_get_cache(key=cache_key)
+ if cached is not None:
+ # Sentinel means the DB confirmed no object_permission for this org
+ if cached == MCPRequestHandler._ORG_NO_PERMISSION_SENTINEL:
+ return None
+ # Redis deserialises to a plain dict; reconstruct the Pydantic model
+ # so callers can access .mcp_servers / .mcp_tool_permissions as attrs.
+ if isinstance(cached, dict):
+ return LiteLLM_ObjectPermissionTable(**cached)
+ return cached
+
+ org_row = await prisma_client.db.litellm_organizationtable.find_unique(
+ where={"organization_id": org_id},
+ include={"object_permission": True},
+ )
+
+ if org_row is None or org_row.object_permission is None:
+ # Cache the negative result so subsequent calls skip the DB
+ await user_api_key_cache.async_set_cache(
+ key=cache_key,
+ value=MCPRequestHandler._ORG_NO_PERMISSION_SENTINEL,
+ )
+ return None
+
+ # Convert raw Prisma model → Pydantic before caching. Caching the
+ # Pydantic .dict() ensures the value survives a Redis JSON round-trip
+ # as a plain dict that we can reconstruct above (same pattern used by
+ # get_end_user_object / get_team_object in auth_checks.py).
+ obj_perm = LiteLLM_ObjectPermissionTable(**org_row.object_permission.dict())
+ await user_api_key_cache.async_set_cache(
+ key=cache_key, value=obj_perm.dict()
+ )
+ return obj_perm
+ except Exception as e:
+ verbose_logger.warning(f"Failed to get org object permission: {str(e)}")
+ return None
+
+ @staticmethod
+ async def _get_allowed_mcp_servers_for_org(
+ user_api_key_auth: Optional[UserAPIKeyAuth] = None,
+ ) -> List[str]:
+ """
+ Get allowed MCP servers for an organization.
+
+ Returns the MCP servers from the org's object_permission.
+ An empty result means the org places no restriction (allow-all from this level).
+ """
+ try:
+ object_permissions = await MCPRequestHandler._get_org_object_permission(
+ user_api_key_auth
+ )
+
+ if object_permissions is None:
+ return []
+
+ from litellm.proxy._experimental.mcp_server.mcp_server_manager import (
+ global_mcp_server_manager,
+ )
+
+ # Expand names/aliases to canonical server IDs (consistent with key/team/end-user path)
+ direct_mcp_servers = global_mcp_server_manager.expand_permission_list(
+ object_permissions.mcp_servers or []
+ )
+
+ access_group_servers = (
+ await MCPRequestHandler._get_mcp_servers_from_access_groups(
+ object_permissions.mcp_access_groups or []
+ )
+ )
+
+ tool_perm_servers = list(
+ global_mcp_server_manager.expand_tool_permissions(
+ object_permissions.mcp_tool_permissions
+ ).keys()
+ )
+
+ all_servers = direct_mcp_servers + access_group_servers + tool_perm_servers
+ return list(set(all_servers))
+ except Exception as e:
+ verbose_logger.warning(
+ f"Failed to get allowed MCP servers for org: {str(e)}"
+ )
+ return []
+
@staticmethod
async def _get_allowed_mcp_servers_for_end_user(
user_api_key_auth: Optional[UserAPIKeyAuth] = None,
diff --git a/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py b/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py
index cebd224a1a..1794cd1438 100644
--- a/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py
+++ b/litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py
@@ -33,10 +33,12 @@ def get_request_base_url(request: Request) -> str:
"""
Get the base URL for the request, considering X-Forwarded-* headers.
- When behind a proxy (like nginx), the proxy may set:
- - X-Forwarded-Proto: The original protocol (http/https)
- - X-Forwarded-Host: The original host (may include port)
- - X-Forwarded-Port: The original port (if not in Host header)
+ X-Forwarded-Proto / X-Forwarded-Host / X-Forwarded-Port are only honoured
+ when the request comes from a configured trusted proxy
+ (``use_x_forwarded_for`` enabled AND caller in ``mcp_trusted_proxy_ranges``).
+ Otherwise the request's literal ``base_url`` is returned, so an
+ untrusted caller cannot poison OAuth-discovery / redirect_uri values
+ by injecting headers.
Args:
request: FastAPI Request object
@@ -47,34 +49,28 @@ def get_request_base_url(request: Request) -> str:
base_url = str(request.base_url).rstrip("/")
parsed = urlparse(base_url)
- # Get forwarded headers
+ if not IPAddressUtils.is_request_from_trusted_proxy(request):
+ return base_url
+
x_forwarded_proto = request.headers.get("X-Forwarded-Proto")
x_forwarded_host = request.headers.get("X-Forwarded-Host")
x_forwarded_port = request.headers.get("X-Forwarded-Port")
- # Start with the original scheme
scheme = x_forwarded_proto if x_forwarded_proto else parsed.scheme
- # Handle host and port
if x_forwarded_host:
# X-Forwarded-Host may already include port (e.g., "example.com:8080")
if ":" in x_forwarded_host and not x_forwarded_host.startswith("["):
- # Host includes port
netloc = x_forwarded_host
elif x_forwarded_port:
- # Port is separate
netloc = f"{x_forwarded_host}:{x_forwarded_port}"
else:
- # Just host, no explicit port
netloc = x_forwarded_host
else:
- # No X-Forwarded-Host, use original netloc
netloc = parsed.netloc
if x_forwarded_port and ":" not in netloc:
- # Add forwarded port if not already in netloc
netloc = f"{netloc}:{x_forwarded_port}"
- # Reconstruct the URL
return urlunparse((scheme, netloc, parsed.path, "", "", ""))
diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
index f96350500d..9923c3ce4b 100644
--- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
+++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py
@@ -169,6 +169,37 @@ def _deserialize_json_dict(data: Any) -> Optional[Dict[str, str]]:
class MCPServerManager:
_STDIO_ENV_TEMPLATE_PATTERN = re.compile(r"^\$\{(X-[^}]+)\}$")
+ @staticmethod
+ def _resolve_oauth2_flow(
+ *,
+ auth_type: Optional[MCPAuthType],
+ oauth2_flow: Optional[str],
+ token_url: Optional[str],
+ authorization_url: Optional[str],
+ client_id: Optional[str],
+ client_secret: Optional[str],
+ ) -> Optional[Literal["client_credentials", "authorization_code"]]:
+ """Infer oauth2_flow for legacy records that omit the field.
+
+ DB rows created before oauth2_flow support may have OAuth2 client
+ credentials + token_url but a null oauth2_flow. Treat these as M2M,
+ unless authorization_url is present (interactive OAuth).
+ """
+ if oauth2_flow in ("client_credentials", "authorization_code"):
+ return cast(
+ Literal["client_credentials", "authorization_code"], oauth2_flow
+ )
+ if oauth2_flow:
+ # Ignore unknown/untyped values and continue legacy inference.
+ return None
+ if auth_type != MCPAuth.oauth2:
+ return None
+ if authorization_url:
+ return None
+ if token_url and client_id and client_secret:
+ return "client_credentials"
+ return None
+
def __init__(self):
self.registry: Dict[str, MCPServer] = {}
self.config_mcp_servers: Dict[str, MCPServer] = {}
@@ -342,7 +373,14 @@ class MCPServerManager:
# oauth specific fields
client_id=server_config.get("client_id", None),
client_secret=server_config.get("client_secret", None),
- oauth2_flow=server_config.get("oauth2_flow", None),
+ oauth2_flow=self._resolve_oauth2_flow(
+ auth_type=auth_type,
+ oauth2_flow=server_config.get("oauth2_flow", None),
+ token_url=resolved_token_url,
+ authorization_url=resolved_authorization_url,
+ client_id=server_config.get("client_id", None),
+ client_secret=server_config.get("client_secret", None),
+ ),
scopes=resolved_scopes,
authorization_url=resolved_authorization_url,
token_url=resolved_token_url,
@@ -679,7 +717,17 @@ class MCPServerManager:
client_id=client_id_value or getattr(mcp_server, "client_id", None),
client_secret=client_secret_value
or getattr(mcp_server, "client_secret", None),
- oauth2_flow=getattr(mcp_server, "oauth2_flow", None),
+ oauth2_flow=self._resolve_oauth2_flow(
+ auth_type=auth_type,
+ oauth2_flow=getattr(mcp_server, "oauth2_flow", None),
+ token_url=mcp_server.token_url
+ or getattr(mcp_oauth_metadata, "token_url", None),
+ authorization_url=mcp_server.authorization_url
+ or getattr(mcp_oauth_metadata, "authorization_url", None),
+ client_id=client_id_value or getattr(mcp_server, "client_id", None),
+ client_secret=client_secret_value
+ or getattr(mcp_server, "client_secret", None),
+ ),
scopes=resolved_scopes,
authorization_url=mcp_server.authorization_url
or getattr(mcp_oauth_metadata, "authorization_url", None),
@@ -2426,7 +2474,7 @@ class MCPServerManager:
)
)
- async def _call_regular_mcp_tool(
+ async def _call_regular_mcp_tool( # noqa: PLR0915
self,
mcp_server: MCPServer,
original_tool_name: str,
@@ -2489,7 +2537,11 @@ class MCPServerManager:
# oauth2 headers
extra_headers: Optional[Dict[str, str]] = None
if mcp_server.auth_type == MCPAuth.oauth2:
- extra_headers = oauth2_headers
+ if mcp_server.has_client_credentials:
+ # For M2M OAuth servers, Authorization must come from token fetch.
+ extra_headers = None
+ else:
+ extra_headers = oauth2_headers
if mcp_server.extra_headers and raw_headers:
if extra_headers is None:
@@ -2501,6 +2553,11 @@ class MCPServerManager:
for header in mcp_server.extra_headers:
if not isinstance(header, str):
continue
+ if (
+ mcp_server.has_client_credentials
+ and header.lower() == "authorization"
+ ):
+ continue
header_value = normalized_raw_headers.get(header.lower())
if header_value is None:
continue
@@ -2536,6 +2593,10 @@ class MCPServerManager:
)
extra_headers.update(hook_extra_headers)
+ # Reset to None if no headers were actually added
+ if extra_headers is not None and len(extra_headers) == 0:
+ extra_headers = None
+
stdio_env = self._build_stdio_env(mcp_server, raw_headers)
client = await self._create_mcp_client(
diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py
index ae6055217b..54d9bbe6e2 100644
--- a/litellm/proxy/_experimental/mcp_server/server.py
+++ b/litellm/proxy/_experimental/mcp_server/server.py
@@ -153,6 +153,7 @@ if MCP_AVAILABLE:
MCPAuthenticatedUser,
)
from litellm.proxy._experimental.mcp_server.mcp_server_manager import (
+ MCPServerManager,
global_mcp_server_manager,
)
from litellm.proxy._experimental.mcp_server.openapi_to_mcp_generator import (
@@ -900,6 +901,20 @@ if MCP_AVAILABLE:
allowed_mcp_server_id
)
if mcp_server is not None:
+ # Apply oauth2_flow resolution for legacy DB rows where it may be NULL
+ resolved_flow = MCPServerManager._resolve_oauth2_flow(
+ auth_type=mcp_server.auth_type,
+ oauth2_flow=mcp_server.oauth2_flow,
+ token_url=mcp_server.token_url,
+ authorization_url=mcp_server.authorization_url,
+ client_id=mcp_server.client_id,
+ client_secret=mcp_server.client_secret,
+ )
+ if resolved_flow and resolved_flow != mcp_server.oauth2_flow:
+ # Create a new instance with the resolved flow for this request
+ mcp_server = mcp_server.model_copy(
+ update={"oauth2_flow": resolved_flow}
+ )
allowed_mcp_servers.append(mcp_server)
if mcp_servers is not None:
@@ -1100,8 +1115,13 @@ if MCP_AVAILABLE:
extra_headers: Optional[Dict[str, str]] = None
if server.auth_type == MCPAuth.oauth2:
- # Copy to avoid mutating the original dict (important for parallel fetching)
- extra_headers = oauth2_headers.copy() if oauth2_headers else None
+ # For OAuth2 M2M servers, upstream Authorization must come from
+ # client_credentials token fetch, never from caller headers.
+ if server.has_client_credentials:
+ extra_headers = None
+ else:
+ # Copy to avoid mutating the original dict (important for parallel fetching)
+ extra_headers = oauth2_headers.copy() if oauth2_headers else None
if server.extra_headers and raw_headers:
if extra_headers is None:
@@ -1114,11 +1134,17 @@ if MCP_AVAILABLE:
for header in server.extra_headers:
if not isinstance(header, str):
continue
+ if server.has_client_credentials and header.lower() == "authorization":
+ continue
header_value = normalized_raw_headers.get(header.lower())
if header_value is None:
continue
extra_headers[header] = header_value
+ # Reset to None if no headers were actually added
+ if extra_headers is not None and len(extra_headers) == 0:
+ extra_headers = None
+
if server_auth_header is None:
server_auth_header = mcp_auth_header
@@ -1377,11 +1403,19 @@ if MCP_AVAILABLE:
spend_meta["per_server_tool_counts"] = per_server_tool_counts
end_time = datetime.now()
- await litellm_logging_obj.async_success_handler(
- result=all_tools,
- start_time=list_tools_start_time,
- end_time=end_time,
- )
+ try:
+ await litellm_logging_obj.async_success_handler(
+ result=all_tools,
+ start_time=list_tools_start_time,
+ end_time=end_time,
+ )
+ except Exception as log_exc:
+ # list_tools responses must not be dropped due to non-blocking
+ # observability/serialization failures.
+ verbose_logger.warning(
+ "MCP list_tools success logging failed (continuing): %s",
+ log_exc,
+ )
verbose_logger.info(
f"Successfully fetched {len(all_tools)} tools total from all MCP servers"
@@ -2104,6 +2138,47 @@ if MCP_AVAILABLE:
#########################################################
local_tool = global_mcp_tool_registry.get_tool(name)
if local_tool:
+ # OpenAPI-backed tools used to bypass `pre_call_tool_check` —
+ # only the managed path ran allowed/banned-tool checks, key/team
+ # tool permissions, and parameter validation. Run the same checks
+ # before dispatching to the local registry. Refuse the call if
+ # we cannot resolve a server: tools registered via
+ # openapi_to_mcp_generator are always tied to a server, so a
+ # missing mcp_server here means the tool->server mapping has
+ # not finished initializing or the registry entry is orphaned.
+ # Skipping the check would re-open the same authorization gap.
+ if mcp_server is None:
+ raise HTTPException(
+ status_code=503,
+ detail=(
+ f"MCP server for tool '{name}' is not available; "
+ "refusing to dispatch without authorization checks. "
+ "Retry once the server is registered."
+ ),
+ )
+
+ # `pre_call_tool_check` calls into `proxy_logging_obj` for the
+ # pre-call guardrail hooks, so source it from the canonical
+ # `proxy_server` module the same way `_handle_managed_mcp_tool`
+ # does. `kwargs.get("proxy_logging_obj")` is None on the MCP
+ # entry path and would crash with AttributeError after the
+ # security checks pass.
+ from litellm.proxy.proxy_server import proxy_logging_obj
+
+ hook_result = await global_mcp_server_manager.pre_call_tool_check(
+ name=original_tool_name,
+ arguments=arguments or {},
+ server_name=server_name or mcp_server.name,
+ user_api_key_auth=user_api_key_auth,
+ proxy_logging_obj=proxy_logging_obj,
+ server=mcp_server,
+ raw_headers=raw_headers,
+ )
+ # `pre_call_tool_check` may return guardrail-modified
+ # arguments; honor them on the local path too.
+ if isinstance(hook_result, dict) and "arguments" in hook_result:
+ arguments = hook_result["arguments"]
+
verbose_logger.debug(f"Executing local registry tool: {name}")
# For BYOK servers the credential must be injected via a ContextVar
# because the tool function has headers baked into its closure.
diff --git a/litellm/proxy/_experimental/out/404.html b/litellm/proxy/_experimental/out/404.html
index a3e8dd80e8..17fdb3b358 100644
--- a/litellm/proxy/_experimental/out/404.html
+++ b/litellm/proxy/_experimental/out/404.html
@@ -1 +1 @@
-404: This page could not be found.LiteLLM Dashboard404
This page could not be found.
\ No newline at end of file
+404: This page could not be found.LiteLLM Dashboard404
This page could not be found.
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/__next.__PAGE__.txt b/litellm/proxy/_experimental/out/__next.__PAGE__.txt
index 8f751e4781..cf19a1edd6 100644
--- a/litellm/proxy/_experimental/out/__next.__PAGE__.txt
+++ b/litellm/proxy/_experimental/out/__next.__PAGE__.txt
@@ -1,27 +1,30 @@
1:"$Sreact.fragment"
2:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"]
-3:I[952683,["/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","/litellm-asset-prefix/_next/static/chunks/cd677ff381b90c30.js","/litellm-asset-prefix/_next/static/chunks/738efbc0d941f9d2.js","/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","/litellm-asset-prefix/_next/static/chunks/c53c9c7afec96700.js","/litellm-asset-prefix/_next/static/chunks/1fe0596a309ad6cf.js","/litellm-asset-prefix/_next/static/chunks/c0b640cc12a2b90e.js","/litellm-asset-prefix/_next/static/chunks/35e1b31334447d6e.js","/litellm-asset-prefix/_next/static/chunks/40ec1228b231a0d1.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/d8cd2d44272d51c8.js","/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","/litellm-asset-prefix/_next/static/chunks/fe5abdcdb57db543.js","/litellm-asset-prefix/_next/static/chunks/47a838c67cdd745e.js","/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","/litellm-asset-prefix/_next/static/chunks/7149faf92f484aca.js","/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","/litellm-asset-prefix/_next/static/chunks/4b8dcb3ad5dfb8de.js","/litellm-asset-prefix/_next/static/chunks/eaa9f9b9bb3e054b.js","/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","/litellm-asset-prefix/_next/static/chunks/ddcd1fd842a79e55.js","/litellm-asset-prefix/_next/static/chunks/3daef8922b68e600.js","/litellm-asset-prefix/_next/static/chunks/4f6e5b838f18b8e6.js","/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","/litellm-asset-prefix/_next/static/chunks/052aaa8d01e02cd3.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","/litellm-asset-prefix/_next/static/chunks/65968777d52ff874.js","/litellm-asset-prefix/_next/static/chunks/a1b5b0c54192471e.js","/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","/litellm-asset-prefix/_next/static/chunks/341e7c75250f4f40.js","/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","/litellm-asset-prefix/_next/static/chunks/50d8a95e62930b35.js","/litellm-asset-prefix/_next/static/chunks/2005c732f6d6cbb4.js","/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","/litellm-asset-prefix/_next/static/chunks/7c797521435cb59c.js","/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","/litellm-asset-prefix/_next/static/chunks/e7cc7b98b893b20d.js","/litellm-asset-prefix/_next/static/chunks/ca91b0fa4d619698.js","/litellm-asset-prefix/_next/static/chunks/e1f572e8226962e3.js"],"default"]
-17:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"]
-18:"$Sreact.suspense"
+3:I[952683,["/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","/litellm-asset-prefix/_next/static/chunks/0493aafc4891dd29.js","/litellm-asset-prefix/_next/static/chunks/f7e1d08418645368.js","/litellm-asset-prefix/_next/static/chunks/b3d198d6c56a21b8.js","/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","/litellm-asset-prefix/_next/static/chunks/37e77c06e99eb8ff.js","/litellm-asset-prefix/_next/static/chunks/adb8beb738574863.js","/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","/litellm-asset-prefix/_next/static/chunks/0b470ffc60999bf4.js","/litellm-asset-prefix/_next/static/chunks/c847ecdf8c790b0b.js","/litellm-asset-prefix/_next/static/chunks/baadbd26839e7b66.js","/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","/litellm-asset-prefix/_next/static/chunks/4e17b625d75327a7.js","/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","/litellm-asset-prefix/_next/static/chunks/a06cc76a774dd182.js","/litellm-asset-prefix/_next/static/chunks/264fd32eefec52b6.js","/litellm-asset-prefix/_next/static/chunks/86828bdbafb8b581.js","/litellm-asset-prefix/_next/static/chunks/10dc4591ef08a91f.js","/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","/litellm-asset-prefix/_next/static/chunks/fbe12a36d22e9554.js","/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","/litellm-asset-prefix/_next/static/chunks/679dbd657c8b5aef.js","/litellm-asset-prefix/_next/static/chunks/94f7208f5087e27c.js","/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","/litellm-asset-prefix/_next/static/chunks/4e06277331e725da.js","/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","/litellm-asset-prefix/_next/static/chunks/fb125648f2dae104.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","/litellm-asset-prefix/_next/static/chunks/6967a3b4ecbd3785.js","/litellm-asset-prefix/_next/static/chunks/3e917c79aadd945b.js","/litellm-asset-prefix/_next/static/chunks/9bbebdeb3f1cb03f.js","/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","/litellm-asset-prefix/_next/static/chunks/5f2d62a75803a3f7.js","/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","/litellm-asset-prefix/_next/static/chunks/9b0ee76cbdef1a2a.js","/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","/litellm-asset-prefix/_next/static/chunks/878832edb30e99a4.js","/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","/litellm-asset-prefix/_next/static/chunks/8e3d0ce9505a304f.js","/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","/litellm-asset-prefix/_next/static/chunks/0cdfadbcf4b8c9e4.js","/litellm-asset-prefix/_next/static/chunks/8f3bf592254c6c3b.js","/litellm-asset-prefix/_next/static/chunks/8c17e934bd227606.js","/litellm-asset-prefix/_next/static/chunks/b98447395b5d37ef.js"],"default"]
+1a:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"]
+1b:"$Sreact.suspense"
:HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"]
-0:{"buildId":"zxkD4-EPlgfKHDTw8O869","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/cd677ff381b90c30.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/738efbc0d941f9d2.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/c53c9c7afec96700.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/1fe0596a309ad6cf.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/c0b640cc12a2b90e.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/35e1b31334447d6e.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/40ec1228b231a0d1.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/d8cd2d44272d51c8.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","async":true}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","async":true}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","async":true}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/fe5abdcdb57db543.js","async":true}],["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/47a838c67cdd745e.js","async":true}],["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","async":true}],["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","async":true}],["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","async":true}],["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/7149faf92f484aca.js","async":true}],["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","async":true}],["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","async":true}],["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/4b8dcb3ad5dfb8de.js","async":true}],["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/eaa9f9b9bb3e054b.js","async":true}],["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","async":true}],["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/ddcd1fd842a79e55.js","async":true}],["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/3daef8922b68e600.js","async":true}],["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/4f6e5b838f18b8e6.js","async":true}],["$","script","script-29",{"src":"/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","async":true}],["$","script","script-30",{"src":"/litellm-asset-prefix/_next/static/chunks/052aaa8d01e02cd3.js","async":true}],["$","script","script-31",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-32",{"src":"/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","async":true}],["$","script","script-33",{"src":"/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","async":true}],"$L6","$L7","$L8","$L9","$La","$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15"],"$L16"]}],"loading":null,"isPartial":false}
+0:{"buildId":"8TZ2JbOi7SZ6BCj9ScTHW","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/0493aafc4891dd29.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/f7e1d08418645368.js","async":true}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/b3d198d6c56a21b8.js","async":true}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","async":true}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/37e77c06e99eb8ff.js","async":true}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/adb8beb738574863.js","async":true}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","async":true}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/0b470ffc60999bf4.js","async":true}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/c847ecdf8c790b0b.js","async":true}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/baadbd26839e7b66.js","async":true}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","async":true}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","async":true}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/4e17b625d75327a7.js","async":true}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","async":true}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/a06cc76a774dd182.js","async":true}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/264fd32eefec52b6.js","async":true}],["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/86828bdbafb8b581.js","async":true}],["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/10dc4591ef08a91f.js","async":true}],["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","async":true}],["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/fbe12a36d22e9554.js","async":true}],["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","async":true}],["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","async":true}],["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/679dbd657c8b5aef.js","async":true}],["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/94f7208f5087e27c.js","async":true}],["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","async":true}],["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/4e06277331e725da.js","async":true}],["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","async":true}],["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","async":true}],["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/fb125648f2dae104.js","async":true}],["$","script","script-29",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true}],["$","script","script-30",{"src":"/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","async":true}],["$","script","script-31",{"src":"/litellm-asset-prefix/_next/static/chunks/6967a3b4ecbd3785.js","async":true}],["$","script","script-32",{"src":"/litellm-asset-prefix/_next/static/chunks/3e917c79aadd945b.js","async":true}],["$","script","script-33",{"src":"/litellm-asset-prefix/_next/static/chunks/9bbebdeb3f1cb03f.js","async":true}],"$L6","$L7","$L8","$L9","$La","$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17","$L18"],"$L19"]}],"loading":null,"isPartial":false}
4:{}
5:"$0:rsc:props:children:0:props:serverProvidedParams:params"
-6:["$","script","script-34",{"src":"/litellm-asset-prefix/_next/static/chunks/65968777d52ff874.js","async":true}]
-7:["$","script","script-35",{"src":"/litellm-asset-prefix/_next/static/chunks/a1b5b0c54192471e.js","async":true}]
-8:["$","script","script-36",{"src":"/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","async":true}]
-9:["$","script","script-37",{"src":"/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","async":true}]
-a:["$","script","script-38",{"src":"/litellm-asset-prefix/_next/static/chunks/341e7c75250f4f40.js","async":true}]
-b:["$","script","script-39",{"src":"/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","async":true}]
-c:["$","script","script-40",{"src":"/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","async":true}]
-d:["$","script","script-41",{"src":"/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","async":true}]
-e:["$","script","script-42",{"src":"/litellm-asset-prefix/_next/static/chunks/50d8a95e62930b35.js","async":true}]
-f:["$","script","script-43",{"src":"/litellm-asset-prefix/_next/static/chunks/2005c732f6d6cbb4.js","async":true}]
-10:["$","script","script-44",{"src":"/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","async":true}]
-11:["$","script","script-45",{"src":"/litellm-asset-prefix/_next/static/chunks/7c797521435cb59c.js","async":true}]
-12:["$","script","script-46",{"src":"/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","async":true}]
-13:["$","script","script-47",{"src":"/litellm-asset-prefix/_next/static/chunks/e7cc7b98b893b20d.js","async":true}]
-14:["$","script","script-48",{"src":"/litellm-asset-prefix/_next/static/chunks/ca91b0fa4d619698.js","async":true}]
-15:["$","script","script-49",{"src":"/litellm-asset-prefix/_next/static/chunks/e1f572e8226962e3.js","async":true}]
-16:["$","$L17",null,{"children":["$","$18",null,{"name":"Next.MetadataOutlet","children":"$@19"}]}]
-19:null
+6:["$","script","script-34",{"src":"/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","async":true}]
+7:["$","script","script-35",{"src":"/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","async":true}]
+8:["$","script","script-36",{"src":"/litellm-asset-prefix/_next/static/chunks/5f2d62a75803a3f7.js","async":true}]
+9:["$","script","script-37",{"src":"/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","async":true}]
+a:["$","script","script-38",{"src":"/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","async":true}]
+b:["$","script","script-39",{"src":"/litellm-asset-prefix/_next/static/chunks/9b0ee76cbdef1a2a.js","async":true}]
+c:["$","script","script-40",{"src":"/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","async":true}]
+d:["$","script","script-41",{"src":"/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","async":true}]
+e:["$","script","script-42",{"src":"/litellm-asset-prefix/_next/static/chunks/878832edb30e99a4.js","async":true}]
+f:["$","script","script-43",{"src":"/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","async":true}]
+10:["$","script","script-44",{"src":"/litellm-asset-prefix/_next/static/chunks/8e3d0ce9505a304f.js","async":true}]
+11:["$","script","script-45",{"src":"/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","async":true}]
+12:["$","script","script-46",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true}]
+13:["$","script","script-47",{"src":"/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","async":true}]
+14:["$","script","script-48",{"src":"/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","async":true}]
+15:["$","script","script-49",{"src":"/litellm-asset-prefix/_next/static/chunks/0cdfadbcf4b8c9e4.js","async":true}]
+16:["$","script","script-50",{"src":"/litellm-asset-prefix/_next/static/chunks/8f3bf592254c6c3b.js","async":true}]
+17:["$","script","script-51",{"src":"/litellm-asset-prefix/_next/static/chunks/8c17e934bd227606.js","async":true}]
+18:["$","script","script-52",{"src":"/litellm-asset-prefix/_next/static/chunks/b98447395b5d37ef.js","async":true}]
+19:["$","$L1a",null,{"children":["$","$1b",null,{"name":"Next.MetadataOutlet","children":"$@1c"}]}]
+1c:null
diff --git a/litellm/proxy/_experimental/out/__next._full.txt b/litellm/proxy/_experimental/out/__next._full.txt
index 66ed8c623b..6b75bee883 100644
--- a/litellm/proxy/_experimental/out/__next._full.txt
+++ b/litellm/proxy/_experimental/out/__next._full.txt
@@ -4,56 +4,59 @@
4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"]
5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"]
6:I[347257,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ClientPageRoot"]
-7:I[952683,["/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","/litellm-asset-prefix/_next/static/chunks/cd677ff381b90c30.js","/litellm-asset-prefix/_next/static/chunks/738efbc0d941f9d2.js","/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","/litellm-asset-prefix/_next/static/chunks/c53c9c7afec96700.js","/litellm-asset-prefix/_next/static/chunks/1fe0596a309ad6cf.js","/litellm-asset-prefix/_next/static/chunks/c0b640cc12a2b90e.js","/litellm-asset-prefix/_next/static/chunks/35e1b31334447d6e.js","/litellm-asset-prefix/_next/static/chunks/40ec1228b231a0d1.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/d8cd2d44272d51c8.js","/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","/litellm-asset-prefix/_next/static/chunks/fe5abdcdb57db543.js","/litellm-asset-prefix/_next/static/chunks/47a838c67cdd745e.js","/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","/litellm-asset-prefix/_next/static/chunks/7149faf92f484aca.js","/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","/litellm-asset-prefix/_next/static/chunks/4b8dcb3ad5dfb8de.js","/litellm-asset-prefix/_next/static/chunks/eaa9f9b9bb3e054b.js","/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","/litellm-asset-prefix/_next/static/chunks/ddcd1fd842a79e55.js","/litellm-asset-prefix/_next/static/chunks/3daef8922b68e600.js","/litellm-asset-prefix/_next/static/chunks/4f6e5b838f18b8e6.js","/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","/litellm-asset-prefix/_next/static/chunks/052aaa8d01e02cd3.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","/litellm-asset-prefix/_next/static/chunks/65968777d52ff874.js","/litellm-asset-prefix/_next/static/chunks/a1b5b0c54192471e.js","/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","/litellm-asset-prefix/_next/static/chunks/341e7c75250f4f40.js","/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","/litellm-asset-prefix/_next/static/chunks/50d8a95e62930b35.js","/litellm-asset-prefix/_next/static/chunks/2005c732f6d6cbb4.js","/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","/litellm-asset-prefix/_next/static/chunks/7c797521435cb59c.js","/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","/litellm-asset-prefix/_next/static/chunks/e7cc7b98b893b20d.js","/litellm-asset-prefix/_next/static/chunks/ca91b0fa4d619698.js","/litellm-asset-prefix/_next/static/chunks/e1f572e8226962e3.js"],"default"]
-2e:I[168027,[],"default"]
+7:I[952683,["/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","/litellm-asset-prefix/_next/static/chunks/0493aafc4891dd29.js","/litellm-asset-prefix/_next/static/chunks/f7e1d08418645368.js","/litellm-asset-prefix/_next/static/chunks/b3d198d6c56a21b8.js","/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","/litellm-asset-prefix/_next/static/chunks/37e77c06e99eb8ff.js","/litellm-asset-prefix/_next/static/chunks/adb8beb738574863.js","/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","/litellm-asset-prefix/_next/static/chunks/0b470ffc60999bf4.js","/litellm-asset-prefix/_next/static/chunks/c847ecdf8c790b0b.js","/litellm-asset-prefix/_next/static/chunks/baadbd26839e7b66.js","/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","/litellm-asset-prefix/_next/static/chunks/4e17b625d75327a7.js","/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","/litellm-asset-prefix/_next/static/chunks/a06cc76a774dd182.js","/litellm-asset-prefix/_next/static/chunks/264fd32eefec52b6.js","/litellm-asset-prefix/_next/static/chunks/86828bdbafb8b581.js","/litellm-asset-prefix/_next/static/chunks/10dc4591ef08a91f.js","/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","/litellm-asset-prefix/_next/static/chunks/fbe12a36d22e9554.js","/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","/litellm-asset-prefix/_next/static/chunks/679dbd657c8b5aef.js","/litellm-asset-prefix/_next/static/chunks/94f7208f5087e27c.js","/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","/litellm-asset-prefix/_next/static/chunks/4e06277331e725da.js","/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","/litellm-asset-prefix/_next/static/chunks/fb125648f2dae104.js","/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","/litellm-asset-prefix/_next/static/chunks/6967a3b4ecbd3785.js","/litellm-asset-prefix/_next/static/chunks/3e917c79aadd945b.js","/litellm-asset-prefix/_next/static/chunks/9bbebdeb3f1cb03f.js","/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","/litellm-asset-prefix/_next/static/chunks/5f2d62a75803a3f7.js","/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","/litellm-asset-prefix/_next/static/chunks/9b0ee76cbdef1a2a.js","/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","/litellm-asset-prefix/_next/static/chunks/878832edb30e99a4.js","/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","/litellm-asset-prefix/_next/static/chunks/8e3d0ce9505a304f.js","/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","/litellm-asset-prefix/_next/static/chunks/0cdfadbcf4b8c9e4.js","/litellm-asset-prefix/_next/static/chunks/8f3bf592254c6c3b.js","/litellm-asset-prefix/_next/static/chunks/8c17e934bd227606.js","/litellm-asset-prefix/_next/static/chunks/b98447395b5d37ef.js"],"default"]
+31:I[168027,[],"default"]
:HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"]
-:HL["/litellm-asset-prefix/_next/static/chunks/e0cb6755699177c1.css","style"]
+:HL["/litellm-asset-prefix/_next/static/chunks/91037395c95e366d.css","style"]
:HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
:HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"]
-0:{"P":null,"b":"zxkD4-EPlgfKHDTw8O869","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/e0cb6755699177c1.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L6",null,{"Component":"$7","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@8","$@9"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/cd677ff381b90c30.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/738efbc0d941f9d2.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/c53c9c7afec96700.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/1fe0596a309ad6cf.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/c0b640cc12a2b90e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/35e1b31334447d6e.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/40ec1228b231a0d1.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/d8cd2d44272d51c8.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","async":true,"nonce":"$undefined"}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/fe5abdcdb57db543.js","async":true,"nonce":"$undefined"}],"$La","$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17","$L18","$L19","$L1a","$L1b","$L1c","$L1d","$L1e","$L1f","$L20","$L21","$L22","$L23","$L24","$L25","$L26","$L27","$L28","$L29","$L2a","$L2b"],"$L2c"]}],{},null,false,false]},null,false,false],"$L2d",false]],"m":"$undefined","G":["$2e",[]],"S":true}
-2f:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"]
-30:"$Sreact.suspense"
-32:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"]
-34:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"]
-a:["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/47a838c67cdd745e.js","async":true,"nonce":"$undefined"}]
-b:["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","async":true,"nonce":"$undefined"}]
+0:{"P":null,"b":"8TZ2JbOi7SZ6BCj9ScTHW","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/91037395c95e366d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L6",null,{"Component":"$7","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@8","$@9"]}}],[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/0493aafc4891dd29.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/f7e1d08418645368.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/litellm-asset-prefix/_next/static/chunks/b3d198d6c56a21b8.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/litellm-asset-prefix/_next/static/chunks/403c4d96324c23a6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/litellm-asset-prefix/_next/static/chunks/37e77c06e99eb8ff.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/litellm-asset-prefix/_next/static/chunks/adb8beb738574863.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/litellm-asset-prefix/_next/static/chunks/0549bc9afa7d4888.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/litellm-asset-prefix/_next/static/chunks/0b470ffc60999bf4.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/litellm-asset-prefix/_next/static/chunks/c847ecdf8c790b0b.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/litellm-asset-prefix/_next/static/chunks/baadbd26839e7b66.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/litellm-asset-prefix/_next/static/chunks/ee5f9a39a526e423.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","async":true,"nonce":"$undefined"}],["$","script","script-12",{"src":"/litellm-asset-prefix/_next/static/chunks/4e17b625d75327a7.js","async":true,"nonce":"$undefined"}],["$","script","script-13",{"src":"/litellm-asset-prefix/_next/static/chunks/7b788dd93ad868b3.js","async":true,"nonce":"$undefined"}],["$","script","script-14",{"src":"/litellm-asset-prefix/_next/static/chunks/a06cc76a774dd182.js","async":true,"nonce":"$undefined"}],["$","script","script-15",{"src":"/litellm-asset-prefix/_next/static/chunks/264fd32eefec52b6.js","async":true,"nonce":"$undefined"}],"$La","$Lb","$Lc","$Ld","$Le","$Lf","$L10","$L11","$L12","$L13","$L14","$L15","$L16","$L17","$L18","$L19","$L1a","$L1b","$L1c","$L1d","$L1e","$L1f","$L20","$L21","$L22","$L23","$L24","$L25","$L26","$L27","$L28","$L29","$L2a","$L2b","$L2c","$L2d","$L2e"],"$L2f"]}],{},null,false,false]},null,false,false],"$L30",false]],"m":"$undefined","G":["$31",[]],"S":true}
+32:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"OutletBoundary"]
+33:"$Sreact.suspense"
+35:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"ViewportBoundary"]
+37:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"]
+a:["$","script","script-16",{"src":"/litellm-asset-prefix/_next/static/chunks/86828bdbafb8b581.js","async":true,"nonce":"$undefined"}]
+b:["$","script","script-17",{"src":"/litellm-asset-prefix/_next/static/chunks/10dc4591ef08a91f.js","async":true,"nonce":"$undefined"}]
c:["$","script","script-18",{"src":"/litellm-asset-prefix/_next/static/chunks/e099566e8bd4ee4e.js","async":true,"nonce":"$undefined"}]
-d:["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","async":true,"nonce":"$undefined"}]
-e:["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/7149faf92f484aca.js","async":true,"nonce":"$undefined"}]
-f:["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","async":true,"nonce":"$undefined"}]
-10:["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","async":true,"nonce":"$undefined"}]
-11:["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/4b8dcb3ad5dfb8de.js","async":true,"nonce":"$undefined"}]
-12:["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/eaa9f9b9bb3e054b.js","async":true,"nonce":"$undefined"}]
-13:["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","async":true,"nonce":"$undefined"}]
-14:["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/ddcd1fd842a79e55.js","async":true,"nonce":"$undefined"}]
-15:["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/3daef8922b68e600.js","async":true,"nonce":"$undefined"}]
-16:["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/4f6e5b838f18b8e6.js","async":true,"nonce":"$undefined"}]
-17:["$","script","script-29",{"src":"/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","async":true,"nonce":"$undefined"}]
-18:["$","script","script-30",{"src":"/litellm-asset-prefix/_next/static/chunks/052aaa8d01e02cd3.js","async":true,"nonce":"$undefined"}]
-19:["$","script","script-31",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}]
-1a:["$","script","script-32",{"src":"/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","async":true,"nonce":"$undefined"}]
-1b:["$","script","script-33",{"src":"/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","async":true,"nonce":"$undefined"}]
-1c:["$","script","script-34",{"src":"/litellm-asset-prefix/_next/static/chunks/65968777d52ff874.js","async":true,"nonce":"$undefined"}]
-1d:["$","script","script-35",{"src":"/litellm-asset-prefix/_next/static/chunks/a1b5b0c54192471e.js","async":true,"nonce":"$undefined"}]
-1e:["$","script","script-36",{"src":"/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","async":true,"nonce":"$undefined"}]
-1f:["$","script","script-37",{"src":"/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","async":true,"nonce":"$undefined"}]
-20:["$","script","script-38",{"src":"/litellm-asset-prefix/_next/static/chunks/341e7c75250f4f40.js","async":true,"nonce":"$undefined"}]
-21:["$","script","script-39",{"src":"/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","async":true,"nonce":"$undefined"}]
-22:["$","script","script-40",{"src":"/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","async":true,"nonce":"$undefined"}]
-23:["$","script","script-41",{"src":"/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","async":true,"nonce":"$undefined"}]
-24:["$","script","script-42",{"src":"/litellm-asset-prefix/_next/static/chunks/50d8a95e62930b35.js","async":true,"nonce":"$undefined"}]
-25:["$","script","script-43",{"src":"/litellm-asset-prefix/_next/static/chunks/2005c732f6d6cbb4.js","async":true,"nonce":"$undefined"}]
-26:["$","script","script-44",{"src":"/litellm-asset-prefix/_next/static/chunks/6eee262391715440.js","async":true,"nonce":"$undefined"}]
-27:["$","script","script-45",{"src":"/litellm-asset-prefix/_next/static/chunks/7c797521435cb59c.js","async":true,"nonce":"$undefined"}]
-28:["$","script","script-46",{"src":"/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","async":true,"nonce":"$undefined"}]
-29:["$","script","script-47",{"src":"/litellm-asset-prefix/_next/static/chunks/e7cc7b98b893b20d.js","async":true,"nonce":"$undefined"}]
-2a:["$","script","script-48",{"src":"/litellm-asset-prefix/_next/static/chunks/ca91b0fa4d619698.js","async":true,"nonce":"$undefined"}]
-2b:["$","script","script-49",{"src":"/litellm-asset-prefix/_next/static/chunks/e1f572e8226962e3.js","async":true,"nonce":"$undefined"}]
-2c:["$","$L2f",null,{"children":["$","$30",null,{"name":"Next.MetadataOutlet","children":"$@31"}]}]
-2d:["$","$1","h",{"children":[null,["$","$L32",null,{"children":"$L33"}],["$","div",null,{"hidden":true,"children":["$","$L34",null,{"children":["$","$30",null,{"name":"Next.Metadata","children":"$L35"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}]
+d:["$","script","script-19",{"src":"/litellm-asset-prefix/_next/static/chunks/fbe12a36d22e9554.js","async":true,"nonce":"$undefined"}]
+e:["$","script","script-20",{"src":"/litellm-asset-prefix/_next/static/chunks/2971c4658f1bcd7d.js","async":true,"nonce":"$undefined"}]
+f:["$","script","script-21",{"src":"/litellm-asset-prefix/_next/static/chunks/134f728fa7099e3e.js","async":true,"nonce":"$undefined"}]
+10:["$","script","script-22",{"src":"/litellm-asset-prefix/_next/static/chunks/679dbd657c8b5aef.js","async":true,"nonce":"$undefined"}]
+11:["$","script","script-23",{"src":"/litellm-asset-prefix/_next/static/chunks/94f7208f5087e27c.js","async":true,"nonce":"$undefined"}]
+12:["$","script","script-24",{"src":"/litellm-asset-prefix/_next/static/chunks/43f6fc3c2ab9cf23.js","async":true,"nonce":"$undefined"}]
+13:["$","script","script-25",{"src":"/litellm-asset-prefix/_next/static/chunks/4e06277331e725da.js","async":true,"nonce":"$undefined"}]
+14:["$","script","script-26",{"src":"/litellm-asset-prefix/_next/static/chunks/3b30ab8eaa03bc21.js","async":true,"nonce":"$undefined"}]
+15:["$","script","script-27",{"src":"/litellm-asset-prefix/_next/static/chunks/ac3cf77acb5bf234.js","async":true,"nonce":"$undefined"}]
+16:["$","script","script-28",{"src":"/litellm-asset-prefix/_next/static/chunks/fb125648f2dae104.js","async":true,"nonce":"$undefined"}]
+17:["$","script","script-29",{"src":"/litellm-asset-prefix/_next/static/chunks/7e417dd24c8becd0.js","async":true,"nonce":"$undefined"}]
+18:["$","script","script-30",{"src":"/litellm-asset-prefix/_next/static/chunks/a09028cd611c08ef.js","async":true,"nonce":"$undefined"}]
+19:["$","script","script-31",{"src":"/litellm-asset-prefix/_next/static/chunks/6967a3b4ecbd3785.js","async":true,"nonce":"$undefined"}]
+1a:["$","script","script-32",{"src":"/litellm-asset-prefix/_next/static/chunks/3e917c79aadd945b.js","async":true,"nonce":"$undefined"}]
+1b:["$","script","script-33",{"src":"/litellm-asset-prefix/_next/static/chunks/9bbebdeb3f1cb03f.js","async":true,"nonce":"$undefined"}]
+1c:["$","script","script-34",{"src":"/litellm-asset-prefix/_next/static/chunks/0a65da2cd24e2ab6.js","async":true,"nonce":"$undefined"}]
+1d:["$","script","script-35",{"src":"/litellm-asset-prefix/_next/static/chunks/908828a91f602d8b.js","async":true,"nonce":"$undefined"}]
+1e:["$","script","script-36",{"src":"/litellm-asset-prefix/_next/static/chunks/5f2d62a75803a3f7.js","async":true,"nonce":"$undefined"}]
+1f:["$","script","script-37",{"src":"/litellm-asset-prefix/_next/static/chunks/ca5fbafaf3826374.js","async":true,"nonce":"$undefined"}]
+20:["$","script","script-38",{"src":"/litellm-asset-prefix/_next/static/chunks/d3ac82723ec9e30d.js","async":true,"nonce":"$undefined"}]
+21:["$","script","script-39",{"src":"/litellm-asset-prefix/_next/static/chunks/9b0ee76cbdef1a2a.js","async":true,"nonce":"$undefined"}]
+22:["$","script","script-40",{"src":"/litellm-asset-prefix/_next/static/chunks/1bc2898be56acd1b.js","async":true,"nonce":"$undefined"}]
+23:["$","script","script-41",{"src":"/litellm-asset-prefix/_next/static/chunks/fcdf7322b0aa3e2e.js","async":true,"nonce":"$undefined"}]
+24:["$","script","script-42",{"src":"/litellm-asset-prefix/_next/static/chunks/878832edb30e99a4.js","async":true,"nonce":"$undefined"}]
+25:["$","script","script-43",{"src":"/litellm-asset-prefix/_next/static/chunks/496b84010c33cf69.js","async":true,"nonce":"$undefined"}]
+26:["$","script","script-44",{"src":"/litellm-asset-prefix/_next/static/chunks/8e3d0ce9505a304f.js","async":true,"nonce":"$undefined"}]
+27:["$","script","script-45",{"src":"/litellm-asset-prefix/_next/static/chunks/e1f23fd814ac3500.js","async":true,"nonce":"$undefined"}]
+28:["$","script","script-46",{"src":"/litellm-asset-prefix/_next/static/chunks/88c74f8b4b20d25a.js","async":true,"nonce":"$undefined"}]
+29:["$","script","script-47",{"src":"/litellm-asset-prefix/_next/static/chunks/99cf9cf99df5ccfc.js","async":true,"nonce":"$undefined"}]
+2a:["$","script","script-48",{"src":"/litellm-asset-prefix/_next/static/chunks/4980372eaa37b78b.js","async":true,"nonce":"$undefined"}]
+2b:["$","script","script-49",{"src":"/litellm-asset-prefix/_next/static/chunks/0cdfadbcf4b8c9e4.js","async":true,"nonce":"$undefined"}]
+2c:["$","script","script-50",{"src":"/litellm-asset-prefix/_next/static/chunks/8f3bf592254c6c3b.js","async":true,"nonce":"$undefined"}]
+2d:["$","script","script-51",{"src":"/litellm-asset-prefix/_next/static/chunks/8c17e934bd227606.js","async":true,"nonce":"$undefined"}]
+2e:["$","script","script-52",{"src":"/litellm-asset-prefix/_next/static/chunks/b98447395b5d37ef.js","async":true,"nonce":"$undefined"}]
+2f:["$","$L32",null,{"children":["$","$33",null,{"name":"Next.MetadataOutlet","children":"$@34"}]}]
+30:["$","$1","h",{"children":[null,["$","$L35",null,{"children":"$L36"}],["$","div",null,{"hidden":true,"children":["$","$L37",null,{"children":["$","$33",null,{"name":"Next.Metadata","children":"$L38"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}]
8:{}
9:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
-33:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
-36:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"]
-31:null
-35:[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"./favicon.ico"}],["$","$L36","4",{}]]
+36:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
+39:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"]
+34:null
+38:[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"./favicon.ico"}],["$","$L39","4",{}]]
diff --git a/litellm/proxy/_experimental/out/__next._head.txt b/litellm/proxy/_experimental/out/__next._head.txt
index 635c8e398b..680119eb91 100644
--- a/litellm/proxy/_experimental/out/__next._head.txt
+++ b/litellm/proxy/_experimental/out/__next._head.txt
@@ -3,4 +3,4 @@
3:I[897367,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"MetadataBoundary"]
4:"$Sreact.suspense"
5:I[27201,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"IconMark"]
-0:{"buildId":"zxkD4-EPlgfKHDTw8O869","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"./favicon.ico"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false}
+0:{"buildId":"8TZ2JbOi7SZ6BCj9ScTHW","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"LiteLLM Dashboard"}],["$","meta","1",{"name":"description","content":"LiteLLM Proxy Admin UI"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.1d32c690.ico","sizes":"48x48","type":"image/x-icon"}],["$","link","3",{"rel":"icon","href":"./favicon.ico"}],["$","$L5","4",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"loading":null,"isPartial":false}
diff --git a/litellm/proxy/_experimental/out/__next._index.txt b/litellm/proxy/_experimental/out/__next._index.txt
index d026a48036..f23ca44427 100644
--- a/litellm/proxy/_experimental/out/__next._index.txt
+++ b/litellm/proxy/_experimental/out/__next._index.txt
@@ -4,5 +4,5 @@
4:I[339756,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"]
5:I[837457,["/litellm-asset-prefix/_next/static/chunks/d96012bcfc98706a.js","/litellm-asset-prefix/_next/static/chunks/dbca964212122d58.js"],"default"]
:HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"]
-:HL["/litellm-asset-prefix/_next/static/chunks/e0cb6755699177c1.css","style"]
-0:{"buildId":"zxkD4-EPlgfKHDTw8O869","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/e0cb6755699177c1.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]]}],"loading":null,"isPartial":false}
+:HL["/litellm-asset-prefix/_next/static/chunks/91037395c95e366d.css","style"]
+0:{"buildId":"8TZ2JbOi7SZ6BCj9ScTHW","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/chunks/91037395c95e366d.css","precedence":"next"}],["$","script","script-0",{"src":"/litellm-asset-prefix/_next/static/chunks/9e09de50158b3159.js","async":true}],["$","script","script-1",{"src":"/litellm-asset-prefix/_next/static/chunks/7e5fe5584502da06.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"inter_5972bc34-module__OU16Qa__className","children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]]}],"loading":null,"isPartial":false}
diff --git a/litellm/proxy/_experimental/out/__next._tree.txt b/litellm/proxy/_experimental/out/__next._tree.txt
index 44f06b2376..45dbee6602 100644
--- a/litellm/proxy/_experimental/out/__next._tree.txt
+++ b/litellm/proxy/_experimental/out/__next._tree.txt
@@ -1,5 +1,5 @@
:HL["/litellm-asset-prefix/_next/static/chunks/4e20891f2fd03463.css","style"]
-:HL["/litellm-asset-prefix/_next/static/chunks/e0cb6755699177c1.css","style"]
+:HL["/litellm-asset-prefix/_next/static/chunks/91037395c95e366d.css","style"]
:HL["/litellm-asset-prefix/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
:HL["/litellm-asset-prefix/_next/static/chunks/3f3fa56b5786d58c.css","style"]
-0:{"buildId":"zxkD4-EPlgfKHDTw8O869","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
+0:{"buildId":"8TZ2JbOi7SZ6BCj9ScTHW","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
diff --git a/litellm/proxy/_experimental/out/_next/static/zxkD4-EPlgfKHDTw8O869/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/8TZ2JbOi7SZ6BCj9ScTHW/_buildManifest.js
similarity index 100%
rename from litellm/proxy/_experimental/out/_next/static/zxkD4-EPlgfKHDTw8O869/_buildManifest.js
rename to litellm/proxy/_experimental/out/_next/static/8TZ2JbOi7SZ6BCj9ScTHW/_buildManifest.js
diff --git a/litellm/proxy/_experimental/out/_next/static/zxkD4-EPlgfKHDTw8O869/_clientMiddlewareManifest.json b/litellm/proxy/_experimental/out/_next/static/8TZ2JbOi7SZ6BCj9ScTHW/_clientMiddlewareManifest.json
similarity index 100%
rename from litellm/proxy/_experimental/out/_next/static/zxkD4-EPlgfKHDTw8O869/_clientMiddlewareManifest.json
rename to litellm/proxy/_experimental/out/_next/static/8TZ2JbOi7SZ6BCj9ScTHW/_clientMiddlewareManifest.json
diff --git a/litellm/proxy/_experimental/out/_next/static/zxkD4-EPlgfKHDTw8O869/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/8TZ2JbOi7SZ6BCj9ScTHW/_ssgManifest.js
similarity index 100%
rename from litellm/proxy/_experimental/out/_next/static/zxkD4-EPlgfKHDTw8O869/_ssgManifest.js
rename to litellm/proxy/_experimental/out/_next/static/8TZ2JbOi7SZ6BCj9ScTHW/_ssgManifest.js
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/0377ae18aae60c57.js b/litellm/proxy/_experimental/out/_next/static/chunks/0377ae18aae60c57.js
new file mode 100644
index 0000000000..66e4d15294
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/0377ae18aae60c57.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,362133,457202,439061,182399,234779,374615,330995,592143,372943,899268,87316,655900,299023,25652,882293,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"};var l=e.i(9583),r=a.forwardRef(function(e,r){return a.createElement(l.default,(0,t.default)({},e,{ref:r,icon:s}))});e.s(["ApartmentOutlined",0,r],362133);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 250c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm184 144H296c-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-8zm-48 458H208V148h560v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm440-88H728v-36.6c46.3-13.8 80-56.6 80-107.4 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 50.7 33.7 93.6 80 107.4V764H520c-8.8 0-16 7.2-16 16v152c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16V780c0-8.8-7.2-16-16-16zM646 620c0-27.6 22.4-50 50-50s50 22.4 50 50-22.4 50-50 50-50-22.4-50-50zm180 266H566v-60h260v60z"}}]},name:"audit",theme:"outlined"};var n=a.forwardRef(function(e,s){return a.createElement(l.default,(0,t.default)({},e,{ref:s,icon:i}))});e.s(["AuditOutlined",0,n],457202);let o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M766.4 744.3c43.7 0 79.4-36.2 79.4-80.5 0-53.5-79.4-140.8-79.4-140.8S687 610.3 687 663.8c0 44.3 35.7 80.5 79.4 80.5zm-377.1-44.1c7.1 7.1 18.6 7.1 25.6 0l256.1-256c7.1-7.1 7.1-18.6 0-25.6l-256-256c-.6-.6-1.3-1.2-2-1.7l-78.2-78.2a9.11 9.11 0 00-12.8 0l-48 48a9.11 9.11 0 000 12.8l67.2 67.2-207.8 207.9c-7.1 7.1-7.1 18.6 0 25.6l255.9 256zm12.9-448.6l178.9 178.9H223.4l178.8-178.9zM904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"bg-colors",theme:"outlined"};var d=a.forwardRef(function(e,s){return a.createElement(l.default,(0,t.default)({},e,{ref:s,icon:o}))});e.s(["BgColorsOutlined",0,d],439061);let c={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"};var m=a.forwardRef(function(e,s){return a.createElement(l.default,(0,t.default)({},e,{ref:s,icon:c}))});e.s(["BlockOutlined",0,m],182399);let u={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-260 72h96v209.9L621.5 312 572 347.4V136zm220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3a15.9 15.9 0 0022.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z"}}]},name:"book",theme:"outlined"};var g=a.forwardRef(function(e,s){return a.createElement(l.default,(0,t.default)({},e,{ref:s,icon:u}))});e.s(["BookOutlined",0,g],234779);let x={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-792 72h752v120H136V232zm752 560H136V440h752v352zm-237-64h165c4.4 0 8-3.6 8-8v-72c0-4.4-3.6-8-8-8H651c-4.4 0-8 3.6-8 8v72c0 4.4 3.6 8 8 8z"}}]},name:"credit-card",theme:"outlined"};var p=a.forwardRef(function(e,s){return a.createElement(l.default,(0,t.default)({},e,{ref:s,icon:x}))});e.s(["CreditCardOutlined",0,p],374615);var h=e.i(366845);e.s(["FolderOutlined",()=>h.default],330995);var f=e.i(609587);e.s(["ConfigProvider",()=>f.default],592143);var y=e.i(8211),b=e.i(343794),v=e.i(529681),j=e.i(242064),N=e.i(704914),k=e.i(876556),w=e.i(290224),O=e.i(251224),_=function(e,t){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(a[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,s=Object.getOwnPropertySymbols(e);lt.indexOf(s[l])&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(a[s[l]]=e[s[l]]);return a};function L({suffixCls:e,tagName:t,displayName:s}){return s=>a.forwardRef((l,r)=>a.createElement(s,Object.assign({ref:r,suffixCls:e,tagName:t},l)))}let C=a.forwardRef((e,t)=>{let{prefixCls:s,suffixCls:l,className:r,tagName:i}=e,n=_(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:o}=a.useContext(j.ConfigContext),d=o("layout",s),[c,m,u]=(0,O.default)(d),g=l?`${d}-${l}`:d;return c(a.createElement(i,Object.assign({className:(0,b.default)(s||g,r,m,u),ref:t},n)))}),S=a.forwardRef((e,t)=>{let{direction:s}=a.useContext(j.ConfigContext),[l,r]=a.useState([]),{prefixCls:i,className:n,rootClassName:o,children:d,hasSider:c,tagName:m,style:u}=e,g=_(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),x=(0,v.default)(g,["suffixCls"]),{getPrefixCls:p,className:h,style:f}=(0,j.useComponentConfig)("layout"),L=p("layout",i),C="boolean"==typeof c?c:!!l.length||(0,k.default)(d).some(e=>e.type===w.default),[S,M,P]=(0,O.default)(L),H=(0,b.default)(L,{[`${L}-has-sider`]:C,[`${L}-rtl`]:"rtl"===s},h,n,o,M,P),z=a.useMemo(()=>({siderHook:{addSider:e=>{r(t=>[].concat((0,y.default)(t),[e]))},removeSider:e=>{r(t=>t.filter(t=>t!==e))}}}),[]);return S(a.createElement(N.LayoutContext.Provider,{value:z},a.createElement(m,Object.assign({ref:t,className:H,style:Object.assign(Object.assign({},f),u)},x),d)))}),M=L({tagName:"div",displayName:"Layout"})(S),P=L({suffixCls:"header",tagName:"header",displayName:"Header"})(C),H=L({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(C),z=L({suffixCls:"content",tagName:"main",displayName:"Content"})(C);M.Header=P,M.Footer=H,M.Content=z,M.Sider=w.default,M._InternalSiderContext=w.SiderContext,e.s(["Layout",0,M],372943);var T=e.i(60699);e.s(["Menu",()=>T.default],899268);var R=e.i(475254);let E=(0,R.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",()=>E],87316);var U=e.i(399219);e.s(["ChevronUp",()=>U.default],655900);let V=(0,R.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",()=>V],299023);let A=(0,R.default)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);e.s(["TrendingUp",()=>A],25652);let B=(0,R.default)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);e.s(["UserCheck",()=>B],882293)},761911,98740,e=>{"use strict";let t=(0,e.i(475254).default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);e.s(["default",()=>t],98740),e.s(["Users",()=>t],761911)},111672,e=>{"use strict";var t=e.i(247167),a=e.i(843476),s=e.i(109799),l=e.i(785242),r=e.i(135214),i=e.i(218129),n=e.i(362133),o=e.i(477189),d=e.i(457202),c=e.i(299251),m=e.i(153702),u=e.i(439061),g=e.i(182399),x=e.i(234779),p=e.i(374615),h=e.i(210612),f=e.i(19732),y=e.i(872934),b=e.i(993914),v=e.i(330995),j=e.i(438957),N=e.i(777579),k=e.i(788191),w=e.i(983561),O=e.i(602073),_=e.i(928685),L=e.i(313603),C=e.i(232164),S=e.i(645526),M=e.i(366308),P=e.i(771674),H=e.i(592143),z=e.i(372943),T=e.i(899268),R=e.i(271645),E=e.i(708347),U=e.i(844444),V=e.i(371401);e.i(389083);var A=e.i(878894),B=e.i(87316);e.i(664659),e.i(655900);var $=e.i(531278),I=e.i(299023),D=e.i(25652),K=e.i(882293),F=e.i(761911),W=e.i(764205);let G=(...e)=>e.filter(Boolean).join(" ");function q({accessToken:e,width:t=220}){let s=(0,V.useDisableUsageIndicator)(),[l,r]=(0,R.useState)(!1),[i,n]=(0,R.useState)(!1),[o,d]=(0,R.useState)(null),[c,m]=(0,R.useState)(null),[u,g]=(0,R.useState)(!1),[x,p]=(0,R.useState)(null);(0,R.useEffect)(()=>{(async()=>{if(e){g(!0),p(null);try{let[t,a]=await Promise.all([(0,W.getRemainingUsers)(e),(0,W.getLicenseInfo)(e).catch(()=>null)]);d(t),m(a)}catch(e){console.error("Failed to fetch usage data:",e),p("Failed to load usage data")}finally{g(!1)}}})()},[e]);let h=c?.expiration_date?(e=>{if(!e)return null;let t=new Date(e+"T00:00:00Z"),a=new Date;return a.setHours(0,0,0,0),Math.ceil((t.getTime()-a.getTime())/864e5)})(c.expiration_date):null,f=null!==h&&h<0,y=null!==h&&h>=0&&h<30,{isOverLimit:b,isNearLimit:v,usagePercentage:j,userMetrics:N,teamMetrics:k}=(e=>{if(!e)return{isOverLimit:!1,isNearLimit:!1,usagePercentage:0,userMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0},teamMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0}};let t=e.total_users?e.total_users_used/e.total_users*100:0,a=t>100,s=t>=80&&t<=100,l=e.total_teams?e.total_teams_used/e.total_teams*100:0,r=l>100,i=l>=80&&l<=100,n=a||r;return{isOverLimit:n,isNearLimit:(s||i)&&!n,usagePercentage:Math.max(t,l),userMetrics:{isOverLimit:a,isNearLimit:s,usagePercentage:t},teamMetrics:{isOverLimit:r,isNearLimit:i,usagePercentage:l}}})(o),w=b||v||f||y,O=b||f,_=(v||y)&&!O;return s||!e||o?.total_users===null&&o?.total_teams===null?null:(0,a.jsx)("div",{className:"fixed bottom-4 left-4 z-50",style:{width:`${Math.min(t,220)}px`},children:(0,a.jsx)(()=>i?(0,a.jsx)("button",{onClick:()=>n(!1),className:G("bg-white border border-gray-200 rounded-lg shadow-sm p-3 hover:shadow-md transition-all w-full"),title:"Show usage details",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(F.Users,{className:"h-4 w-4 flex-shrink-0"}),w&&(0,a.jsx)("span",{className:"flex-shrink-0",children:O?(0,a.jsx)(A.AlertTriangle,{className:"h-3 w-3"}):_?(0,a.jsx)(D.TrendingUp,{className:"h-3 w-3"}):null}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium truncate",children:[o&&null!==o.total_users&&(0,a.jsxs)("span",{className:G("flex-shrink-0 px-1.5 py-0.5 rounded text-xs border",N.isOverLimit&&"bg-red-50 text-red-700 border-red-200",N.isNearLimit&&"bg-yellow-50 text-yellow-700 border-yellow-200",!N.isOverLimit&&!N.isNearLimit&&"bg-gray-50 text-gray-700 border-gray-200"),children:["U: ",o.total_users_used,"/",o.total_users]}),o&&null!==o.total_teams&&(0,a.jsxs)("span",{className:G("flex-shrink-0 px-1.5 py-0.5 rounded text-xs border",k.isOverLimit&&"bg-red-50 text-red-700 border-red-200",k.isNearLimit&&"bg-yellow-50 text-yellow-700 border-yellow-200",!k.isOverLimit&&!k.isNearLimit&&"bg-gray-50 text-gray-700 border-gray-200"),children:["T: ",o.total_teams_used,"/",o.total_teams]}),c?.expiration_date&&null!==h&&(0,a.jsx)("span",{className:G("flex-shrink-0 px-1.5 py-0.5 rounded text-xs border",f&&"bg-red-50 text-red-700 border-red-200",y&&"bg-yellow-50 text-yellow-700 border-yellow-200",!f&&!y&&"bg-gray-50 text-gray-700 border-gray-200"),children:h<0?"Exp!":`${h}d`}),!o||null===o.total_users&&null===o.total_teams&&!c&&(0,a.jsx)("span",{className:"truncate",children:"Usage"})]})]})}):u?(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 w-full",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,a.jsx)($.Loader2,{className:"h-4 w-4 animate-spin"}),(0,a.jsx)("span",{className:"text-sm text-gray-500 truncate",children:"Loading..."})]})}):x||!o?(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 group w-full",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)("span",{className:"text-sm text-gray-500 truncate block",children:x||"No data"})}),(0,a.jsx)("button",{onClick:()=>n(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,a.jsx)(I.Minus,{className:"h-3 w-3 text-gray-400"})})]})}):(0,a.jsxs)("div",{className:G("bg-white border rounded-lg shadow-sm p-3 transition-all duration-200 group w-full"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,a.jsx)(F.Users,{className:"h-4 w-4 flex-shrink-0"}),(0,a.jsx)("span",{className:"font-medium text-sm truncate",children:"Usage"})]}),(0,a.jsx)("button",{onClick:()=>n(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,a.jsx)(I.Minus,{className:"h-3 w-3 text-gray-400"})})]}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[c?.has_license&&c.expiration_date&&(0,a.jsxs)("div",{className:G("space-y-1 border rounded-md p-2",f&&"border-red-200 bg-red-50",y&&"border-yellow-200 bg-yellow-50"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-600 mb-1",children:[(0,a.jsx)(B.Calendar,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"font-medium",children:"License"}),(0,a.jsx)("span",{className:G("ml-1 px-1.5 py-0.5 rounded border",f&&"bg-red-50 text-red-700 border-red-200",y&&"bg-yellow-50 text-yellow-700 border-yellow-200",!f&&!y&&"bg-gray-50 text-gray-600 border-gray-200"),children:f?"Expired":y?"Expiring soon":"OK"})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Status:"}),(0,a.jsx)("span",{className:G("font-medium text-right",f&&"text-red-600",y&&"text-yellow-600"),children:(e=>{if(null===e)return"No expiration";if(e<0)return"Expired";if(0===e)return"Expires today";if(1===e)return"1 day remaining";if(e<30)return`${e} days remaining`;if(e<60)return"1 month remaining";let t=Math.floor(e/30);return`${t} months remaining`})(h)})]}),c.license_type&&(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Type:"}),(0,a.jsx)("span",{className:"font-medium text-right capitalize",children:c.license_type})]})]}),null!==o.total_users&&(0,a.jsxs)("div",{className:G("space-y-1 border rounded-md p-2",N.isOverLimit&&"border-red-200 bg-red-50",N.isNearLimit&&"border-yellow-200 bg-yellow-50"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-600 mb-1",children:[(0,a.jsx)(F.Users,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"font-medium",children:"Users"}),(0,a.jsx)("span",{className:G("ml-1 px-1.5 py-0.5 rounded border",N.isOverLimit&&"bg-red-50 text-red-700 border-red-200",N.isNearLimit&&"bg-yellow-50 text-yellow-700 border-yellow-200",!N.isOverLimit&&!N.isNearLimit&&"bg-gray-50 text-gray-600 border-gray-200"),children:N.isOverLimit?"Over limit":N.isNearLimit?"Near limit":"OK"})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,a.jsxs)("span",{className:"font-medium text-right",children:[o.total_users_used,"/",o.total_users]})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,a.jsx)("span",{className:G("font-medium text-right",N.isOverLimit&&"text-red-600",N.isNearLimit&&"text-yellow-600"),children:o.total_users_remaining})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,a.jsxs)("span",{className:"font-medium text-right",children:[Math.round(N.usagePercentage),"%"]})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,a.jsx)("div",{className:G("h-2 rounded-full transition-all duration-300",N.isOverLimit&&"bg-red-500",N.isNearLimit&&"bg-yellow-500",!N.isOverLimit&&!N.isNearLimit&&"bg-green-500"),style:{width:`${Math.min(N.usagePercentage,100)}%`}})})]}),null!==o.total_teams&&(0,a.jsxs)("div",{className:G("space-y-1 border rounded-md p-2",k.isOverLimit&&"border-red-200 bg-red-50",k.isNearLimit&&"border-yellow-200 bg-yellow-50"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-600 mb-1",children:[(0,a.jsx)(K.UserCheck,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"font-medium",children:"Teams"}),(0,a.jsx)("span",{className:G("ml-1 px-1.5 py-0.5 rounded border",k.isOverLimit&&"bg-red-50 text-red-700 border-red-200",k.isNearLimit&&"bg-yellow-50 text-yellow-700 border-yellow-200",!k.isOverLimit&&!k.isNearLimit&&"bg-gray-50 text-gray-600 border-gray-200"),children:k.isOverLimit?"Over limit":k.isNearLimit?"Near limit":"OK"})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,a.jsxs)("span",{className:"font-medium text-right",children:[o.total_teams_used,"/",o.total_teams]})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,a.jsx)("span",{className:G("font-medium text-right",k.isOverLimit&&"text-red-600",k.isNearLimit&&"text-yellow-600"),children:o.total_teams_remaining})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,a.jsxs)("span",{className:"font-medium text-right",children:[Math.round(k.usagePercentage),"%"]})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,a.jsx)("div",{className:G("h-2 rounded-full transition-all duration-300",k.isOverLimit&&"bg-red-500",k.isNearLimit&&"bg-yellow-500",!k.isOverLimit&&!k.isNearLimit&&"bg-green-500"),style:{width:`${Math.min(k.usagePercentage,100)}%`}})})]})]})]}),{})})}let{Sider:Y}=z.Layout,X={"api-reference":"api-reference"},Z=[{groupLabel:"AI GATEWAY",items:[{key:"api-keys",page:"api-keys",label:"Virtual Keys",icon:(0,a.jsx)(j.KeyOutlined,{})},{key:"llm-playground",page:"llm-playground",label:"Playground",icon:(0,a.jsx)(k.PlayCircleOutlined,{}),roles:E.rolesWithWriteAccess},{key:"models",page:"models",label:"Models + Endpoints",icon:(0,a.jsx)(g.BlockOutlined,{}),roles:E.rolesAllowedToViewWriteScopedPages},{key:"agentic",page:"agentic",label:"Agentic",icon:(0,a.jsx)(w.RobotOutlined,{}),children:[{key:"agents",page:"agents",label:"Agents",icon:(0,a.jsx)(w.RobotOutlined,{}),roles:E.rolesAllowedToViewWriteScopedPages},{key:"workflows",page:"workflows",label:"Workflow Runs",icon:(0,a.jsx)(n.ApartmentOutlined,{})},{key:"memory",page:"memory",label:"Memory",icon:(0,a.jsx)(x.BookOutlined,{})}]},{key:"mcp-servers",page:"mcp-servers",label:"MCP Servers",icon:(0,a.jsx)(M.ToolOutlined,{})},{key:"skills",page:"skills",label:"Skills",icon:(0,a.jsx)(i.ApiOutlined,{}),roles:E.all_admin_roles},{key:"guardrails",page:"guardrails",label:"Guardrails",icon:(0,a.jsx)(O.SafetyOutlined,{})},{key:"policies",page:"policies",label:(0,a.jsx)("span",{className:"flex items-center gap-4",children:"Policies"}),icon:(0,a.jsx)(d.AuditOutlined,{}),roles:E.all_admin_roles},{key:"tools",page:"tools",label:"Tools",icon:(0,a.jsx)(M.ToolOutlined,{}),children:[{key:"search-tools",page:"search-tools",label:"Search Tools",icon:(0,a.jsx)(_.SearchOutlined,{})},{key:"vector-stores",page:"vector-stores",label:"Vector Stores",icon:(0,a.jsx)(h.DatabaseOutlined,{})},{key:"tool-policies",page:"tool-policies",label:"Tool Policies",icon:(0,a.jsx)(O.SafetyOutlined,{})}]}]},{groupLabel:"OBSERVABILITY",items:[{key:"new_usage",page:"new_usage",icon:(0,a.jsx)(m.BarChartOutlined,{}),roles:[...E.all_admin_roles,...E.internalUserRoles],label:"Usage"},{key:"logs",page:"logs",label:"Logs",icon:(0,a.jsx)(N.LineChartOutlined,{})},{key:"guardrails-monitor",page:"guardrails-monitor",label:"Guardrails Monitor",icon:(0,a.jsx)(O.SafetyOutlined,{}),roles:[...E.all_admin_roles,...E.internalUserRoles]}]},{groupLabel:"ACCESS CONTROL",items:[{key:"teams",page:"teams",label:"Teams",icon:(0,a.jsx)(S.TeamOutlined,{})},{key:"projects",page:"projects",label:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:["Projects ",(0,a.jsx)(U.default,{})]}),icon:(0,a.jsx)(v.FolderOutlined,{}),roles:E.all_admin_roles},{key:"users",page:"users",label:"Internal Users",icon:(0,a.jsx)(P.UserOutlined,{}),roles:E.all_admin_roles},{key:"organizations",page:"organizations",label:"Organizations",icon:(0,a.jsx)(c.BankOutlined,{}),roles:E.all_admin_roles},{key:"access-groups",page:"access-groups",label:"Access Groups",icon:(0,a.jsx)(g.BlockOutlined,{}),roles:E.all_admin_roles},{key:"budgets",page:"budgets",label:"Budgets",icon:(0,a.jsx)(p.CreditCardOutlined,{}),roles:E.all_admin_roles}]},{groupLabel:"DEVELOPER TOOLS",items:[{key:"api-reference",page:"api-reference",label:"API Reference",icon:(0,a.jsx)(i.ApiOutlined,{})},{key:"model-hub-table",page:"model-hub-table",label:"AI Hub",icon:(0,a.jsx)(o.AppstoreOutlined,{})},{key:"learning-resources",page:"learning-resources",label:"Learning Resources",icon:(0,a.jsx)(x.BookOutlined,{}),external_url:"https://models.litellm.ai/cookbook"},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,a.jsx)(f.ExperimentOutlined,{}),children:[{key:"caching",page:"caching",label:"Caching",icon:(0,a.jsx)(h.DatabaseOutlined,{}),roles:E.all_admin_roles},{key:"prompts",page:"prompts",label:"Prompts",icon:(0,a.jsx)(b.FileTextOutlined,{}),roles:E.all_admin_roles},{key:"transform-request",page:"transform-request",label:"API Playground",icon:(0,a.jsx)(i.ApiOutlined,{}),roles:[...E.all_admin_roles,...E.internalUserRoles]},{key:"tag-management",page:"tag-management",label:"Tag Management",icon:(0,a.jsx)(C.TagsOutlined,{}),roles:E.all_admin_roles},{key:"4",page:"usage",label:"Old Usage",icon:(0,a.jsx)(m.BarChartOutlined,{})}]}]},{groupLabel:"SETTINGS",roles:E.all_admin_roles,items:[{key:"settings",page:"settings",label:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:["Settings ",(0,a.jsx)(U.default,{})]}),icon:(0,a.jsx)(L.SettingOutlined,{}),roles:E.all_admin_roles,children:[{key:"router-settings",page:"router-settings",label:"Router Settings",icon:(0,a.jsx)(L.SettingOutlined,{}),roles:E.all_admin_roles},{key:"logging-and-alerts",page:"logging-and-alerts",label:"Logging & Alerts",icon:(0,a.jsx)(L.SettingOutlined,{}),roles:E.all_admin_roles},{key:"admin-panel",page:"admin-panel",label:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:["Admin Settings ",(0,a.jsx)(U.default,{dot:!0,children:(0,a.jsx)("span",{})})]}),icon:(0,a.jsx)(L.SettingOutlined,{}),roles:E.all_admin_roles},{key:"cost-tracking",page:"cost-tracking",label:"Cost Tracking",icon:(0,a.jsx)(m.BarChartOutlined,{}),roles:E.all_admin_roles},{key:"ui-theme",page:"ui-theme",label:"UI Theme",icon:(0,a.jsx)(u.BgColorsOutlined,{}),roles:E.all_admin_roles}]}]}];e.s(["default",0,({setPage:e,defaultSelectedKey:i,collapsed:n=!1,enabledPagesInternalUsers:o,enableProjectsUI:d,disableAgentsForInternalUsers:c,allowAgentsForTeamAdmins:m,disableVectorStoresForInternalUsers:u,allowVectorStoresForTeamAdmins:g})=>{let x,{userId:p,accessToken:h,userRole:f}=(0,r.default)(),{data:b}=(0,s.useOrganizations)(),{data:v}=(0,l.useTeams)(),j=(0,R.useMemo)(()=>!!p&&!!b&&b.some(e=>e.members?.some(e=>e.user_id===p&&"org_admin"===e.user_role)),[p,b]),N=(0,R.useMemo)(()=>(0,E.isUserTeamAdminForAnyTeam)(v??null,p??""),[v,p]),k=t=>{if(X[t])return void e(t);let a=new URLSearchParams(window.location.search);a.set("page",t),window.history.pushState(null,"",`?${a.toString()}`),e(t)},w=(e,s,l)=>{let r;if(l)return(0,a.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),style:{color:"inherit",textDecoration:"none"},children:[e," ",(0,a.jsx)(y.ExportOutlined,{style:{fontSize:10,marginLeft:4}})]});let i=X[s],n=i?function(e){let a=(t.default.env.NEXT_PUBLIC_BASE_URL??"").replace(/^\/+|\/+$/g,""),s=a?`/${a}/`:"/";if(W.serverRootPath&&"/"!==W.serverRootPath){let e=W.serverRootPath.replace(/\/+$/,""),t=s.replace(/^\/+/,"");s=`${e}/${t}`}return`${s}${e}`}(i):((r=new URLSearchParams(window.location.search)).set("page",s),`?${r.toString()}`);return(0,a.jsx)("a",{href:n,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||1===e.button?e.stopPropagation():e.preventDefault()},style:{color:"inherit",textDecoration:"none"},children:e})},O=e=>{let t=(0,E.isAdminRole)(f);return null!=o&&console.log("[LeftNav] Filtering with enabled pages:",{userRole:f,isAdmin:t,enabledPagesInternalUsers:o}),e.map(e=>({...e,children:e.children?O(e.children):void 0})).filter(e=>{if("organizations"===e.key||"users"===e.key){if(!(!e.roles||e.roles.includes(f)||j))return!1;if(!t&&null!=o){let t=o.includes(e.page);return console.log(`[LeftNav] Page "${e.page}" (${e.key}): ${t?"VISIBLE":"HIDDEN"}`),t}return!0}if("projects"===e.key&&!d||!t&&"agents"===e.key&&c&&!(m&&N)||!t&&"vector-stores"===e.key&&u&&!(g&&N)||e.roles&&!e.roles.includes(f))return!1;if(!t&&null!=o){if(e.children&&e.children.length>0&&e.children.some(e=>o.includes(e.page)))return console.log(`[LeftNav] Parent "${e.page}" (${e.key}): VISIBLE (has visible children)`),!0;let t=o.includes(e.page);return console.log(`[LeftNav] Page "${e.page}" (${e.key}): ${t?"VISIBLE":"HIDDEN"}`),t}return!0})},_=(e=>{for(let t of Z)for(let a of t.items){if(a.page===e)return a.key;if(a.children){let t=a.children.find(t=>t.page===e);if(t)return t.key}}return"api-keys"})(i);return(0,a.jsx)(z.Layout,{children:(0,a.jsxs)(Y,{theme:"light",width:220,collapsed:n,collapsedWidth:80,collapsible:!0,trigger:null,style:{transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative"},children:[(0,a.jsx)(H.ConfigProvider,{theme:{components:{Menu:{iconSize:15,fontSize:13,itemMarginInline:4,itemPaddingInline:8,itemHeight:30,itemBorderRadius:6,subMenuItemBorderRadius:6,groupTitleFontSize:10,groupTitleLineHeight:1.5}}},children:(0,a.jsx)(T.Menu,{mode:"inline",selectedKeys:[_],defaultOpenKeys:[],inlineCollapsed:n,className:"custom-sidebar-menu",style:{borderRight:0,backgroundColor:"transparent",fontSize:"13px",paddingTop:"4px"},items:(x=[],Z.forEach(e=>{if(e.roles&&!e.roles.includes(f))return;let t=O(e.items);0!==t.length&&x.push({type:"group",label:n?null:(0,a.jsx)("span",{style:{fontSize:"10px",fontWeight:600,color:"#6b7280",letterSpacing:"0.05em",padding:"12px 0 4px 12px",display:"block",marginBottom:"2px"},children:e.groupLabel}),children:t.map(e=>({key:e.key,icon:e.icon,label:w(e.label,e.page,e.external_url),children:e.children?.map(e=>({key:e.key,icon:e.icon,label:w(e.label,e.page,e.external_url),onClick:()=>{e.external_url?window.open(e.external_url,"_blank"):k(e.page)}})),onClick:e.children?void 0:()=>{e.external_url?window.open(e.external_url,"_blank"):k(e.page)}}))})}),x)})}),(0,E.isAdminRole)(f)&&!n&&(0,a.jsx)(q,{accessToken:h,width:220})]})})},"menuGroups",()=>Z],111672)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/038e83c8eab81a79.js b/litellm/proxy/_experimental/out/_next/static/chunks/038e83c8eab81a79.js
deleted file mode 100644
index a0f95ffb2b..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/038e83c8eab81a79.js
+++ /dev/null
@@ -1,84 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,185357,180766,782719,969641,476993,824296,64352,230312,e=>{"use strict";var t,a,l=e.i(843476),r=e.i(808613),i=e.i(311451),s=e.i(212931),n=e.i(199133),o=e.i(262218),d=e.i(898586),c=e.i(464571),m=e.i(271645),u=e.i(727749),p=e.i(764205),g=e.i(770914),x=e.i(515831),h=e.i(175712),f=e.i(646563),y=e.i(519756);let{Text:j}=d.Typography,{Option:_}=n.Select,b=({visible:e,prebuiltPatterns:t,categories:a,selectedPatternName:r,patternAction:i,onPatternNameChange:o,onActionChange:d,onAdd:m,onCancel:u})=>(0,l.jsxs)(s.Modal,{title:"Add prebuilt pattern",open:e,onCancel:u,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Pattern type"}),(0,l.jsx)(n.Select,{placeholder:"Choose pattern type",value:r,onChange:o,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,a)=>{let l=t.find(e=>e.name===a?.value);return!!l&&(l.display_name.toLowerCase().includes(e.toLowerCase())||l.name.toLowerCase().includes(e.toLowerCase()))},children:a.map(e=>{let a=t.filter(t=>t.category===e);return 0===a.length?null:(0,l.jsx)(n.Select.OptGroup,{label:e,children:a.map(e=>(0,l.jsx)(_,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Action"}),(0,l.jsx)(j,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:i,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(_,{value:"BLOCK",children:"Block"}),(0,l.jsx)(_,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:u,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:m,children:"Add"})]})]}),{Text:v}=d.Typography,{Option:w}=n.Select,N=({visible:e,patternName:t,patternRegex:a,patternAction:r,onNameChange:o,onRegexChange:d,onActionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add custom regex pattern",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Pattern name"}),(0,l.jsx)(i.Input,{placeholder:"e.g., internal_id, employee_code",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Regex pattern"}),(0,l.jsx)(i.Input,{placeholder:"e.g., ID-[0-9]{6}",value:a,onChange:e=>d(e.target.value),style:{marginTop:8}}),(0,l.jsx)(v,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Action"}),(0,l.jsx)(v,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:r,onChange:m,style:{width:"100%"},children:[(0,l.jsx)(w,{value:"BLOCK",children:"Block"}),(0,l.jsx)(w,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]}),{Text:C}=d.Typography,{Option:S}=n.Select,k=({visible:e,keyword:t,action:a,description:r,onKeywordChange:o,onActionChange:d,onDescriptionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add blocked keyword",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Keyword"}),(0,l.jsx)(i.Input,{placeholder:"Enter sensitive keyword or phrase",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Action"}),(0,l.jsx)(C,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,l.jsxs)(n.Select,{value:a,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(S,{value:"BLOCK",children:"Block"}),(0,l.jsx)(S,{value:"MASK",children:"Mask"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Description (optional)"}),(0,l.jsx)(i.Input.TextArea,{placeholder:"Explain why this keyword is sensitive",value:r,onChange:e=>m(e.target.value),rows:3,style:{marginTop:8}})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]});var I=e.i(291542),A=e.i(955135);let{Text:O}=d.Typography,{Option:T}=n.Select,P=({patterns:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,l.jsx)(o.Tag,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,t)=>t.display_name||t.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,l.jsxs)(O,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(T,{value:"BLOCK",children:"Block"}),(0,l.jsx)(T,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})},{Text:L}=d.Typography,{Option:B}=n.Select,F=({keywords:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,"action",e),style:{width:120},size:"small",children:[(0,l.jsx)(B,{value:"BLOCK",children:"Block"}),(0,l.jsx)(B,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})};var $=e.i(362024),E=e.i(993914);let{Title:M,Text:R}=d.Typography,{Option:G}=n.Select,z=({availableCategories:e,selectedCategories:t,onCategoryAdd:a,onCategoryRemove:r,onCategoryUpdate:i,accessToken:s,pendingSelection:d,onPendingSelectionChange:u})=>{let[g,x]=m.default.useState(""),y=void 0!==d?d:g,j=u||x,[_,b]=m.default.useState({}),[v,w]=m.default.useState({}),[N,C]=m.default.useState({}),[S,k]=m.default.useState([]),[O,T]=m.default.useState(""),[P,L]=m.default.useState(!1),B=async e=>{if(s&&!_[e]){C(t=>({...t,[e]:!0}));try{let t=await (0,p.getCategoryYaml)(s,e),a=t.yaml_content;if("json"===t.file_type)try{let e=JSON.parse(a);a=JSON.stringify(e,null,2)}catch(t){console.warn(`Failed to format JSON for ${e}:`,t)}b(t=>({...t,[e]:a})),w(a=>({...a,[e]:t.file_type||"yaml"}))}catch(t){console.error(`Failed to fetch content for category ${e}:`,t)}finally{C(t=>({...t,[e]:!1}))}}};m.default.useEffect(()=>{if(y&&s){let e=_[y];if(e)return void T(e);L(!0),console.log(`Fetching content for category: ${y}`,{accessToken:s?"present":"missing"}),(0,p.getCategoryYaml)(s,y).then(e=>{console.log(`Successfully fetched content for ${y}:`,e);let t=e.yaml_content;if("json"===e.file_type)try{let e=JSON.parse(t);t=JSON.stringify(e,null,2)}catch(e){console.warn(`Failed to format JSON for ${y}:`,e)}T(t),b(e=>({...e,[y]:t})),w(t=>({...t,[y]:e.file_type||"yaml"}))}).catch(e=>{console.error(`Failed to fetch preview content for category ${y}:`,e),T("")}).finally(()=>{L(!1)})}else T(""),L(!1)},[y,s]);let F=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(t,a)=>{let r=e.find(e=>e.name===a.category);return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:t}),r?.description&&(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888",marginTop:"4px"},children:r.description})]})}},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"action",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"BLOCK",children:(0,l.jsx)(o.Tag,{color:"red",children:"BLOCK"})}),(0,l.jsx)(G,{value:"MASK",children:(0,l.jsx)(o.Tag,{color:"orange",children:"MASK"})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"severity_threshold",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"low",children:"Low"}),(0,l.jsx)(G,{value:"medium",children:"Medium"}),(0,l.jsx)(G,{value:"high",children:"High"})]})},{title:"",key:"actions",width:80,render:(e,t)=>(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r(t.id),size:"small",children:"Remove"})}],z=e.filter(e=>!t.some(t=>t.category===e.name));return(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:8},children:[(0,l.jsx)(M,{level:5,style:{margin:0},children:"Blocked topics"}),(0,l.jsx)(R,{type:"secondary",style:{fontSize:12,fontWeight:400},children:"Select topics to block using keyword and semantic analysis"})]}),size:"small",children:[(0,l.jsxs)("div",{style:{marginBottom:16,display:"flex",gap:8},children:[(0,l.jsx)(n.Select,{placeholder:"Select a content category",value:y||void 0,onChange:j,style:{flex:1},showSearch:!0,optionLabelProp:"label",filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),children:z.map(e=>(0,l.jsx)(G,{value:e.name,label:e.display_name,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:e.display_name}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:e.description})]})},e.name))}),(0,l.jsx)(c.Button,{type:"primary",onClick:()=>{if(!y)return;let l=e.find(e=>e.name===y);!l||t.some(e=>e.category===y)||(a({id:`category-${Date.now()}`,category:l.name,display_name:l.display_name,action:l.default_action,severity_threshold:"medium"}),j(""),T(""))},disabled:!y,icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add"})]}),y&&(0,l.jsxs)("div",{style:{marginBottom:16,padding:"12px",background:"#f9f9f9",border:"1px solid #e0e0e0",borderRadius:"4px"},children:[(0,l.jsxs)("div",{style:{marginBottom:8,fontWeight:500,fontSize:"14px"},children:["Preview: ",e.find(e=>e.name===y)?.display_name,v[y]&&(0,l.jsxs)("span",{style:{marginLeft:8,fontSize:"12px",color:"#888",fontWeight:400},children:["(",v[y]?.toUpperCase(),")"]})]}),P?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):O?(0,l.jsx)("pre",{style:{background:"#fff",padding:"12px",borderRadius:"4px",overflow:"auto",maxHeight:"300px",maxWidth:"100%",fontSize:"12px",lineHeight:"1.5",margin:0,border:"1px solid #e0e0e0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,l.jsx)("code",{children:O})}):(0,l.jsx)("div",{style:{padding:"8px",textAlign:"center",color:"#888",fontSize:"12px"},children:"Unable to load category content"})]}),t.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Table,{dataSource:t,columns:F,pagination:!1,size:"small",rowKey:"id"}),(0,l.jsx)("div",{style:{marginTop:16},children:(0,l.jsx)($.Collapse,{activeKey:S,onChange:e=>{let t=Array.isArray(e)?e:e?[e]:[],a=new Set(S);t.forEach(e=>{a.has(e)||_[e]||B(e)}),k(t)},ghost:!0,items:t.map(e=>{let t=(v[e.category]||"yaml").toUpperCase();return{key:e.category,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(E.FileTextOutlined,{}),(0,l.jsxs)("span",{children:["View ",t," for ",e.display_name]})]}),children:N[e.category]?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):_[e.category]?(0,l.jsx)("pre",{style:{background:"#f5f5f5",padding:"16px",borderRadius:"4px",overflow:"auto",maxHeight:"400px",fontSize:"12px",lineHeight:"1.5",margin:0},children:(0,l.jsx)("code",{children:_[e.category]})}):(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Content will load when expanded"})}})})})]}):(0,l.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"#888",border:"1px dashed #d9d9d9",borderRadius:"4px"},children:"No blocked topics selected. Add topics to detect and block harmful content."})]})};var D=e.i(790848),K=e.i(28651);let{Title:H,Text:q}=d.Typography,{Option:J}=n.Select,U={competitor_intent_type:"airline",brand_self:[],locations:[],policy:{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:.7,threshold_medium:.45,threshold_low:.3},W=({enabled:e,config:t,onChange:a,accessToken:i})=>{let s=t??U,[o,d]=(0,m.useState)([]),[c,u]=(0,m.useState)(!1);(0,m.useEffect)(()=>{"airline"===s.competitor_intent_type&&i&&0===o.length&&(u(!0),(0,p.getMajorAirlines)(i).then(e=>d(e.airlines??[])).catch(()=>d([])).finally(()=>u(!1)))},[s.competitor_intent_type,i,o.length]);let x=e=>{a(e,e?{...U}:null)},f=(t,l)=>{a(e,{...s,[t]:l})},y=(t,l)=>{a(e,{...s,policy:{...s.policy,[t]:l}})},j=(t,l)=>{a(e,{...s,[t]:l.filter(Boolean)})};return e?(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(H,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:e,onChange:x})]}),size:"small",children:[(0,l.jsx)(q,{type:"secondary",style:{display:"block",marginBottom:16},children:"Block or reframe competitor comparison questions. Airline type uses major airlines (excluding your brand); generic requires manual competitor list."}),(0,l.jsxs)(r.Form,{layout:"vertical",size:"small",children:[(0,l.jsx)(r.Form.Item,{label:"Type",children:(0,l.jsxs)(n.Select,{value:s.competitor_intent_type,onChange:e=>f("competitor_intent_type",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"airline",children:"Airline (auto-load competitors from IATA)"}),(0,l.jsx)(J,{value:"generic",children:"Generic (specify competitors manually)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Your Brand (brand_self)",required:!0,help:"airline"===s.competitor_intent_type?"Select your airline from the list (excluded from competitors) or type to add a custom term":"Names/codes users use for your brand",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:c?"Loading airlines...":"airline"===s.competitor_intent_type?"Search or select airline, or type to add custom":"Type and press Enter to add",value:s.brand_self,onChange:t=>"airline"===s.competitor_intent_type&&o.length>0?(t=>{let l=t.filter(Boolean),r=[],i=new Set;for(let e of l){let t=o.find(t=>t.match.split("|")[0]?.trim().toLowerCase()===e.toLowerCase());if(t)for(let e of t.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean))i.has(e)||(i.add(e),r.push(e));else i.has(e.toLowerCase())||(i.add(e.toLowerCase()),r.push(e))}a(e,{...s,brand_self:r})})(t??[]):j("brand_self",t??[]),tokenSeparators:[","],loading:c,showSearch:!0,filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),optionFilterProp:"label",options:"airline"===s.competitor_intent_type&&o.length>0?o.map(e=>{let t=e.match.split("|")[0]?.trim()??e.id,a=e.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean);return{value:t.toLowerCase(),label:`${t}${a.length>1?` (${a.slice(1).join(", ")})`:""}`}}):void 0})}),"airline"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Locations (optional)",help:"Countries, cities, airports for disambiguation (e.g. qatar, doha)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.locations??[],onChange:e=>j("locations",e??[]),tokenSeparators:[","]})}),"generic"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Competitors",required:!0,help:"Competitor names to detect (required for generic type)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.competitors??[],onChange:e=>j("competitors",e??[]),tokenSeparators:[","]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.competitor_comparison??"refuse",onChange:e=>y("competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Possible competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.possible_competitor_comparison??"reframe",onChange:e=>y("possible_competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative to backend LLM)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Confidence thresholds",help:(0,l.jsxs)(l.Fragment,{children:["Classify competitor intent by confidence (0–1). Higher confidence → stronger intent.",(0,l.jsxs)("ul",{style:{marginBottom:0,marginTop:4,paddingLeft:20},children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"High (≥)"}),': Treat as full competitor comparison → uses "Competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Medium (≥)"}),': Treat as possible comparison → uses "Possible competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Low (≥)"}),": Log only; allow request. Below Low → allow with no action"]})]}),"Raise thresholds to be more permissive; lower them to be stricter."]}),children:(0,l.jsxs)(g.Space,{wrap:!0,children:[(0,l.jsx)(r.Form.Item,{label:"High",style:{marginBottom:0},help:"e.g. 0.7",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_high??.7,onChange:e=>f("threshold_high",e??.7),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Medium",style:{marginBottom:0},help:"e.g. 0.45",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_medium??.45,onChange:e=>f("threshold_medium",e??.45),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Low",style:{marginBottom:0},help:"e.g. 0.3",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_low??.3,onChange:e=>f("threshold_low",e??.3),style:{width:80}})})]})})]})]}):(0,l.jsx)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(H,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:!1,onChange:x})]}),size:"small",children:(0,l.jsx)(q,{type:"secondary",children:"Block or reframe competitor comparison questions. When enabled, airline type auto-loads competitors from IATA; generic type requires manual competitor list."})})},{Title:V,Text:Y}=d.Typography,Q=({prebuiltPatterns:e,categories:t,selectedPatterns:a,blockedWords:r,onPatternAdd:i,onPatternRemove:s,onPatternActionChange:n,onBlockedWordAdd:o,onBlockedWordRemove:d,onBlockedWordUpdate:j,onFileUpload:_,accessToken:v,showStep:w,contentCategories:C=[],selectedContentCategories:S=[],onContentCategoryAdd:I,onContentCategoryRemove:A,onContentCategoryUpdate:O,pendingCategorySelection:T,onPendingCategorySelectionChange:L,competitorIntentEnabled:B=!1,competitorIntentConfig:$=null,onCompetitorIntentChange:E})=>{let[M,R]=(0,m.useState)(!1),[G,D]=(0,m.useState)(!1),[K,H]=(0,m.useState)(!1),[q,J]=(0,m.useState)(""),[U,Q]=(0,m.useState)("BLOCK"),[Z,X]=(0,m.useState)(""),[ee,et]=(0,m.useState)(""),[ea,el]=(0,m.useState)("BLOCK"),[er,ei]=(0,m.useState)(""),[es,en]=(0,m.useState)("BLOCK"),[eo,ed]=(0,m.useState)(""),[ec,em]=(0,m.useState)(!1),eu=async e=>{em(!0);try{let t=await e.text();if(v){let e=await (0,p.validateBlockedWordsFile)(v,t);if(e.valid)_&&_(t),u.default.success(e.message||"File uploaded successfully");else{let t=e.error||e.errors&&e.errors.join(", ")||"Invalid file";u.default.error(`Validation failed: ${t}`)}}}catch(e){u.default.error(`Failed to upload file: ${e}`)}finally{em(!1)}return!1};return(0,l.jsxs)("div",{className:"space-y-6",children:[!w&&(0,l.jsx)("div",{children:(0,l.jsx)(Y,{type:"secondary",children:"Configure patterns, keywords, and content categories to detect and filter sensitive information in requests and responses."})}),(!w||"patterns"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>R(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add prebuilt pattern"}),(0,l.jsx)(c.Button,{onClick:()=>H(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add custom regex"})]})}),(0,l.jsx)(P,{patterns:a,onActionChange:n,onRemove:s})]}),(!w||"keywords"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>D(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add keyword"}),(0,l.jsx)(x.Upload,{beforeUpload:eu,accept:".yaml,.yml",showUploadList:!1,children:(0,l.jsx)(c.Button,{icon:(0,l.jsx)(y.UploadOutlined,{}),loading:ec,children:"Upload YAML file"})})]})}),(0,l.jsx)(F,{keywords:r,onActionChange:j,onRemove:d})]}),(!w||"competitor_intent"===w||"categories"===w)&&E&&(0,l.jsx)(W,{enabled:B,config:$,onChange:E,accessToken:v}),(!w||"categories"===w)&&C.length>0&&I&&A&&O&&(0,l.jsx)(z,{availableCategories:C,selectedCategories:S,onCategoryAdd:I,onCategoryRemove:A,onCategoryUpdate:O,accessToken:v,pendingSelection:T,onPendingSelectionChange:L}),(0,l.jsx)(b,{visible:M,prebuiltPatterns:e,categories:t,selectedPatternName:q,patternAction:U,onPatternNameChange:J,onActionChange:e=>Q(e),onAdd:()=>{if(!q)return void u.default.error("Please select a pattern");let t=e.find(e=>e.name===q);i({id:`pattern-${Date.now()}`,type:"prebuilt",name:q,display_name:t?.display_name,action:U}),R(!1),J(""),Q("BLOCK")},onCancel:()=>{R(!1),J(""),Q("BLOCK")}}),(0,l.jsx)(N,{visible:K,patternName:Z,patternRegex:ee,patternAction:ea,onNameChange:X,onRegexChange:et,onActionChange:e=>el(e),onAdd:()=>{Z&&ee?(i({id:`custom-${Date.now()}`,type:"custom",name:Z,pattern:ee,action:ea}),H(!1),X(""),et(""),el("BLOCK")):u.default.error("Please provide pattern name and regex")},onCancel:()=>{H(!1),X(""),et(""),el("BLOCK")}}),(0,l.jsx)(k,{visible:G,keyword:er,action:es,description:eo,onKeywordChange:ei,onActionChange:e=>en(e),onDescriptionChange:ed,onAdd:()=>{er?(o({id:`word-${Date.now()}`,keyword:er,action:es,description:eo||void 0}),D(!1),ei(""),ed(""),en("BLOCK")):u.default.error("Please enter a keyword")},onCancel:()=>{D(!1),ei(""),ed(""),en("BLOCK")}})]})};var Z=((t={}).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t);let X={},ee=e=>{let t={};return t.PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t.LlmAsAJudge="LiteLLM LLM as a Judge",Object.entries(e).forEach(([e,a])=>{a&&"object"==typeof a&&"ui_friendly_name"in a&&(t[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=a.ui_friendly_name)}),X=t,t},et=()=>Object.keys(X).length>0?X:Z,ea={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission",BlockCodeExecution:"block_code_execution",Promptguard:"promptguard",LlmAsAJudge:"llm_as_a_judge"},el=e=>{Object.entries(e).forEach(([e,t])=>{t&&"object"==typeof t&&"ui_friendly_name"in t&&(ea[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=e)})},er=e=>!!e&&"Presidio PII"===et()[e],ei=e=>!!e&&"LiteLLM Content Filter"===et()[e],es=e=>!!e&&"llm_as_a_judge"===ea[e],en="../ui/assets/logos/",eo={"Zscaler AI Guard":`${en}zscaler.svg`,"Presidio PII":`${en}microsoft_azure.svg`,"Bedrock Guardrail":`${en}bedrock.svg`,Lakera:`${en}lakeraai.jpeg`,"Azure Content Safety Prompt Shield":`${en}microsoft_azure.svg`,"Azure Content Safety Text Moderation":`${en}microsoft_azure.svg`,"Aporia AI":`${en}aporia.png`,"PANW Prisma AIRS":`${en}palo_alto_networks.jpeg`,"Noma Security":`${en}noma_security.png`,"Javelin Guardrails":`${en}javelin.png`,"Pillar Guardrail":`${en}pillar.jpeg`,"Google Cloud Model Armor":`${en}google.svg`,"Guardrails AI":`${en}guardrails_ai.jpeg`,"Lasso Guardrail":`${en}lasso.png`,"Pangea Guardrail":`${en}pangea.png`,"AIM Guardrail":`${en}aim_security.jpeg`,"OpenAI Moderation":`${en}openai_small.svg`,EnkryptAI:`${en}enkrypt_ai.avif`,"Prompt Security":`${en}prompt_security.png`,PromptGuard:`${en}promptguard.svg`,"LiteLLM Content Filter":`${en}litellm_logo.jpg`,"LiteLLM LLM as a Judge":`${en}litellm_logo.jpg`,Akto:`${en}akto.svg`},ed=e=>{if(!e)return{logo:"",displayName:"-"};let t=Object.keys(ea).find(t=>ea[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let a=et()[t];return{logo:eo[a]||"",displayName:a||e}};function ec(e){return!0===e?"yes":!1===e?"no":"inherit"}function em(e){return"yes"===e||"no"!==e&&void 0}e.s(["choiceToSkipSystemForCreate",()=>em,"getGuardrailLogoAndName",0,ed,"getGuardrailProviders",0,et,"guardrailLogoMap",0,eo,"guardrail_provider_map",0,ea,"populateGuardrailProviderMap",0,el,"populateGuardrailProviders",0,ee,"shouldRenderContentFilterConfigSettings",0,ei,"shouldRenderLLMJudgeFields",0,es,"shouldRenderPIIConfigSettings",0,er,"skipSystemMessageToChoice",()=>ec],180766);var eu=e.i(435451);let{Title:ep}=d.Typography,eg=({field:e,fieldKey:t,fullFieldKey:a,value:s})=>{let[o,d]=m.default.useState([]),[u,p]=m.default.useState(e.dict_key_options||[]);return m.default.useEffect(()=>{if(s&&"object"==typeof s){let t=Object.keys(s);d(t.map(e=>({key:e,id:`${e}_${Date.now()}_${Math.random()}`}))),p((e.dict_key_options||[]).filter(e=>!t.includes(e)))}},[s,e.dict_key_options]),(0,l.jsxs)("div",{className:"space-y-3",children:[o.map(t=>(0,l.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,l.jsx)("div",{className:"w-24 font-medium text-sm",children:t.key}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(r.Form.Item,{name:Array.isArray(a)?[...a,t.key]:[a,t.key],style:{marginBottom:0},initialValue:s&&"object"==typeof s?s[t.key]:void 0,normalize:"number"===e.dict_value_type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"number"===e.dict_value_type?(0,l.jsx)(eu.default,{step:1,width:200,placeholder:`Enter ${t.key} value`}):"boolean"===e.dict_value_type?(0,l.jsxs)(n.Select,{placeholder:`Select ${t.key} value`,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):(0,l.jsx)(i.Input,{placeholder:`Enter ${t.key} value`})})}),(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>{var e,a;return e=t.id,a=t.key,void(d(o.filter(t=>t.id!==e)),p([...u,a].sort()))},children:"Remove"})]},t.id)),u.length>0&&(0,l.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,l.jsx)(n.Select,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&void(!e||(d([...o,{key:e,id:`${e}_${Date.now()}`}]),p(u.filter(t=>t!==e)))),value:void 0,children:u.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}),(0,l.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})},ex=({optionalParams:e,parentFieldKey:t,values:a})=>e.fields&&0!==Object.keys(e.fields).length?(0,l.jsxs)("div",{className:"guardrail-optional-params",children:[(0,l.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,l.jsx)(ep,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,l.jsx)("p",{className:"text-gray-600 text-sm",children:e.description||"Configure additional settings for this guardrail provider"})]}),(0,l.jsx)("div",{className:"space-y-8",children:Object.entries(e.fields).map(([e,s])=>{let o,d;return o=`${t}.${e}`,(console.log("value",d=a?.[e]),"dict"===s.type&&s.dict_key_options)?(0,l.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,l.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,l.jsx)(eg,{field:s,fieldKey:e,fullFieldKey:[t,e],value:d})]},o):(0,l.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,l.jsx)(r.Form.Item,{name:[t,e],label:(0,l.jsxs)("div",{className:"mb-2",children:[(0,l.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:`${e} is required`}]:void 0,className:"mb-0",initialValue:void 0!==d?d:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"select"===s.type&&s.options?(0,l.jsx)(n.Select,{placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,l.jsxs)(n.Select,{placeholder:s.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"number"===s.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:s.description}):(0,l.jsx)(i.Input,{placeholder:s.description})})},o)})})]}):null;var eh=e.i(482725),ef=e.i(850627);let ey=({selectedProvider:e,accessToken:t,providerParams:a=null,value:s=null})=>{let[o,d]=(0,m.useState)(!1),[c,u]=(0,m.useState)(a),[g,x]=(0,m.useState)(null);if((0,m.useEffect)(()=>{if(a)return void u(a);let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,p.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),ee(e),el(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};a||e()},[t,a]),!e)return null;if(o)return(0,l.jsx)(eh.Spin,{tip:"Loading provider parameters..."});if(g)return(0,l.jsx)("div",{className:"text-red-500",children:g});let h=ea[e]?.toLowerCase(),f=c&&c[h];if(console.log("Provider key:",h),console.log("Provider fields:",f),!f||0===Object.keys(f).length)return(0,l.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",s);let y=new Set(["patterns","blocked_words","blocked_words_file","categories","severity_threshold","pattern_redaction_format","keyword_redaction_tag"]),j=ei(e),_=(e,t="",a)=>Object.entries(e).map(([e,o])=>{let d=t?`${t}.${e}`:e,c=a?a[e]:s?.[e];if(console.log("Field value:",c),"ui_friendly_name"===e||"optional_params"===e&&"nested"===o.type&&o.fields||j&&y.has(e))return null;if("nested"===o.type&&o.fields)return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 font-medium",children:e}),(0,l.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:_(o.fields,d,c)})]},d);let m=void 0!==c?c:o.default_value??("percentage"===o.type?.5:void 0);return(0,l.jsx)(r.Form.Item,{name:d,label:e,tooltip:o.description,rules:o.required?[{required:!0,message:`${e} is required`}]:void 0,initialValue:m,children:"select"===o.type&&o.options?(0,l.jsx)(n.Select,{placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===o.type&&o.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===o.type||"boolean"===o.type?(0,l.jsxs)(n.Select,{placeholder:o.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"percentage"===o.type&&null!=o.min&&null!=o.max?(0,l.jsx)(ef.Slider,{min:o.min,max:o.max,step:o.step??.1,marks:{[o.min]:"0%",[(o.min+o.max)/2]:"50%",[o.max]:"100%"}}):"number"===o.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:o.description,defaultValue:void 0!==c?Number(c):void 0}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:o.description,defaultValue:c||""}):(0,l.jsx)(i.Input,{placeholder:o.description,defaultValue:c||""})},d)});return(0,l.jsx)(l.Fragment,{children:_(f)})};var ej=e.i(592968),e_=e.i(750113);let eb=({availableModels:e,form:t})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6,padding:"10px 14px",marginBottom:16,fontSize:13,color:"#389e0d"},children:["After each LLM response, the ",(0,l.jsx)("strong",{children:"Judge Model"})," scores it 0–100 against your criteria. If the weighted average falls below the threshold, the response is blocked (or logged)."]}),(0,l.jsx)(r.Form.Item,{name:"judge_model",label:(0,l.jsxs)("span",{children:["Judge Model ",(0,l.jsx)(ej.Tooltip,{title:"The LLM that reads each response and grades it. Pick a capable model — it never sees end-user data beyond what the LLM returned.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),rules:[{required:!0,message:"Select a judge model"}],children:(0,l.jsx)(n.Select,{showSearch:!0,placeholder:"Select a model",options:e.map(e=>({label:e,value:e}))})}),(0,l.jsx)(r.Form.Item,{name:"overall_threshold",label:(0,l.jsxs)("span",{children:["Minimum Score to Pass ",(0,l.jsx)(ej.Tooltip,{title:"0–100. If the weighted average of criterion scores falls below this, the guardrail triggers. 80 is a good default.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:80,children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"/ 100",style:{width:"100%"}})}),(0,l.jsx)(r.Form.Item,{name:"on_failure",label:(0,l.jsxs)("span",{children:["On Failure ",(0,l.jsx)(ej.Tooltip,{title:"Block: return HTTP 422 when the score is too low. Log: record the result but let the response through.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:"block",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block (return 422)"}),(0,l.jsx)(n.Select.Option,{value:"log",children:"Log only"})]})}),(0,l.jsx)(r.Form.Item,{label:(0,l.jsxs)("span",{children:["Evaluation Criteria ",(0,l.jsx)(ej.Tooltip,{title:"Each criterion is something the judge checks. Weights must add up to 100%.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,l.jsx)(r.Form.List,{name:"criteria",initialValue:[{name:"",weight:100,description:""}],children:(e,{add:a,remove:s})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...a})=>(0,l.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,padding:"12px 12px 0",marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-end"},children:[(0,l.jsx)(r.Form.Item,{...a,name:[t,"name"],rules:[{required:!0,message:"Enter criterion name"}],style:{flex:2,marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"Criterion name (e.g. Policy accuracy)"})}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"weight"],label:(0,l.jsx)(ej.Tooltip,{title:"How much this criterion counts toward the final score. All weights must add up to 100%.",children:(0,l.jsxs)("span",{style:{fontSize:12,color:"#595959"},children:["Weight ",(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#bfbfbf"}})]})}),rules:[{required:!0,message:"Enter weight"}],style:{flex:1,marginBottom:8},children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"%",style:{width:"100%"},placeholder:"e.g. 50"})}),(0,l.jsx)("div",{style:{marginBottom:8},children:(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>s(t),children:"×"})})]}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"description"],rules:[{required:!0,message:"Describe what to check"}],style:{marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"What should the judge check for this criterion?"})})]},e)),(0,l.jsx)(c.Button,{type:"dashed",block:!0,style:{marginTop:4},onClick:()=>a({name:"",weight:0,description:""}),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add Criterion"}),e.length>0&&(0,l.jsx)(r.Form.Item,{shouldUpdate:!0,noStyle:!0,children:()=>{let e=(t.getFieldValue("criteria")||[]).reduce((e,t)=>e+(Number(t?.weight)||0),0),a=100===e;return(0,l.jsxs)("div",{style:{marginTop:6,fontSize:12,color:a?"#52c41a":"#faad14"},children:["Weights total: ",e,"%",a?" ✓":" — must add up to 100%"]})}})]})})})]});var ev=e.i(536916),ew=e.i(149192),eN=e.i(741585),eN=eN,eC=e.i(724154);e.i(247167);var eS=e.i(931067);let ek={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"};var eI=e.i(9583),eA=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:ek}))});let{Text:eO}=d.Typography,{Option:eT}=n.Select,eP=({categories:e,selectedCategories:t,onChange:a})=>(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-2",children:[(0,l.jsx)(eA,{className:"text-gray-500 mr-1"}),(0,l.jsx)(eO,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,l.jsx)(n.Select,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:a,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,l.jsx)(o.Tag,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:e.map(e=>(0,l.jsx)(eT,{value:e.category,children:e.category},e.category))})]}),eL=({onSelectAll:e,onUnselectAll:t,hasSelectedEntities:a})=>(0,l.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(eO,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,l.jsx)(ej.Tooltip,{title:"Apply action to all PII types at once",children:(0,l.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:t,disabled:!a,icon:(0,l.jsx)(ew.CloseOutlined,{}),children:"Unselect All"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(c.Button,{color:"primary",variant:"outlined",onClick:()=>e("MASK"),className:"h-10",block:!0,icon:(0,l.jsx)(eN.default,{}),children:"Select All & Mask"}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:()=>e("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,l.jsx)(eC.StopOutlined,{}),children:"Select All & Block"})]})]}),eB=({entities:e,selectedEntities:t,selectedActions:a,actions:r,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:d})=>(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eO,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,l.jsx)(eO,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===e.length?(0,l.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):e.map(e=>(0,l.jsxs)("div",{className:`px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ${t.includes(e)?"bg-blue-50":""}`,children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)(ev.Checkbox,{checked:t.includes(e),onChange:()=>i(e),className:"mr-3"}),(0,l.jsx)(eO,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:e.replace(/_/g," ")}),d.get(e)&&(0,l.jsx)(o.Tag,{className:"ml-2 text-xs",color:"blue",children:d.get(e)})]}),(0,l.jsx)("div",{className:"w-32",children:(0,l.jsx)(n.Select,{value:t.includes(e)&&a[e]||"MASK",onChange:t=>s(e,t),style:{width:120},disabled:!t.includes(e),className:`${!t.includes(e)?"opacity-50":""}`,dropdownMatchSelectWidth:!1,children:r.map(e=>(0,l.jsx)(eT,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center",children:[(e=>{switch(e){case"MASK":return(0,l.jsx)(eN.default,{style:{marginRight:4}});case"BLOCK":return(0,l.jsx)(eC.StopOutlined,{style:{marginRight:4}});default:return null}})(e),e]})},e))})})]},e))})]}),{Title:eF,Text:e$}=d.Typography,eE=({entities:e,actions:t,selectedEntities:a,selectedActions:r,onEntitySelect:i,onActionSelect:s,entityCategories:n=[]})=>{let[o,d]=(0,m.useState)([]),c=new Map;n.forEach(e=>{e.entities.forEach(t=>{c.set(t,e.category)})});let u=e.filter(e=>0===o.length||o.includes(c.get(e)||""));return(0,l.jsxs)("div",{className:"pii-configuration",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,l.jsx)("div",{className:"flex items-center",children:(0,l.jsx)(eF,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,l.jsxs)(e$,{className:"text-gray-500",children:[a.length," items selected"]})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)(eP,{categories:n,selectedCategories:o,onChange:d}),(0,l.jsx)(eL,{onSelectAll:t=>{e.forEach(e=>{a.includes(e)||i(e),s(e,t)})},onUnselectAll:()=>{a.forEach(e=>{i(e)})},hasSelectedEntities:a.length>0})]}),(0,l.jsx)(eB,{entities:u,selectedEntities:a,selectedActions:r,actions:t,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:c})]})};var eM=e.i(304967),eR=e.i(599724),eG=e.i(312361),ez=e.i(21548),eD=e.i(827252);let eK={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eH=({value:e,onChange:t,disabled:a=!1})=>{let r={...eK,...e||{},rules:e?.rules?[...e.rules]:[]},s=e=>{let a={...r,...e};t?.(a)},o=(e,t)=>{s({rules:r.rules.map((a,l)=>l===e?{...a,...t}:a)})},d=(e,t)=>{let a=r.rules[e];if(!a)return;let l=Object.entries(a.allowed_param_patterns||{});t(l);let i={};l.forEach(([e,t])=>{i[e]=t}),o(e,{allowed_param_patterns:Object.keys(i).length>0?i:void 0})};return(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,l.jsx)(eR.Text,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!a&&(0,l.jsx)(c.Button,{icon:(0,l.jsx)(f.PlusOutlined,{}),type:"primary",onClick:()=>{s({rules:[...r.rules,{id:`rule_${Math.random().toString(36).slice(2,8)}`,decision:"allow",allowed_param_patterns:void 0}]})},className:"!bg-blue-600 !text-white hover:!bg-blue-500",children:"Add Rule"})]}),(0,l.jsx)(eG.Divider,{}),0===r.rules.length?(0,l.jsx)(ez.Empty,{description:"No tool rules added yet"}):(0,l.jsx)("div",{className:"space-y-4",children:r.rules.map((e,t)=>{let m;return(0,l.jsxs)(eM.Card,{className:"bg-gray-50",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,l.jsxs)(eR.Text,{className:"font-semibold",children:["Rule ",t+1]}),(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,type:"text",disabled:a,onClick:()=>{s({rules:r.rules.filter((e,a)=>a!==t)})},children:"Remove"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Rule ID"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"unique_rule_id",value:e.id,onChange:e=>o(t,{id:e.target.value})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^mcp__github_.*$",value:e.tool_name??"",onChange:e=>o(t,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^function$",value:e.tool_type??"",onChange:e=>o(t,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,l.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Decision"}),(0,l.jsxs)(n.Select,{disabled:a,value:e.decision,style:{width:200},onChange:e=>o(t,{decision:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsx)("div",{className:"mt-4",children:0===(m=Object.entries(e.allowed_param_patterns||{})).length?(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),m.map(([r,s],n)=>(0,l.jsxs)(g.Space,{align:"start",children:[(0,l.jsx)(i.Input,{disabled:a,placeholder:"messages[0].content",value:r,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[,t]=e[n];e[n]=[a,t]})}}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^email@.*$",value:s,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[t]=e[n];e[n]=[t,a]})}}),(0,l.jsx)(c.Button,{disabled:a,icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,onClick:()=>d(t,e=>{e.splice(n,1)})})]},`${e.id||t}-${n}`)),(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})})]},e.id||t)})}),(0,l.jsx)(eG.Divider,{}),(0,l.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Default action"}),(0,l.jsxs)(n.Select,{disabled:a,value:r.default_action,onChange:e=>s({default_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(eR.Text,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,l.jsx)(ej.Tooltip,{title:"Block returns an error when a forbidden tool is invoked. Rewrite strips the tool call but lets the rest of the response continue.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})})]}),(0,l.jsxs)(n.Select,{disabled:a,value:r.on_disallowed_action,onChange:e=>s({on_disallowed_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block"}),(0,l.jsx)(n.Select.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,l.jsx)(i.Input.TextArea,{disabled:a,rows:3,placeholder:"This violates our org policy...",value:r.violation_message_template,onChange:e=>s({violation_message_template:e.target.value})})]})]})},{Title:eq,Text:eJ,Link:eU}=d.Typography,{Option:eW}=n.Select,eV={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};e.s(["default",0,({visible:e,onClose:t,accessToken:a,onSuccess:d,preset:g})=>{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(0),[I,A]=(0,m.useState)(null),[O,T]=(0,m.useState)([]),[P,L]=(0,m.useState)(2),[B,F]=(0,m.useState)({}),[$,E]=(0,m.useState)([]),[M,R]=(0,m.useState)([]),[G,z]=(0,m.useState)([]),[D,K]=(0,m.useState)(""),[H,q]=(0,m.useState)(!1),[J,U]=(0,m.useState)(null),[W,V]=(0,m.useState)(""),[Y,Z]=(0,m.useState)(void 0),[X,en]=(0,m.useState)("warn"),[ed,ec]=(0,m.useState)(""),[eu,ep]=(0,m.useState)(!1),[eg,eh]=(0,m.useState)([]),[ef,ej]=(0,m.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),e_=(0,m.useMemo)(()=>!!y&&"tool_permission"===(ea[y]||"").toLowerCase(),[y]);(0,m.useEffect)(()=>{a&&(async()=>{try{let[e,t,l]=await Promise.all([(0,p.getGuardrailUISettings)(a),(0,p.getGuardrailProviderSpecificParams)(a),(0,p.modelAvailableCall)(a,"","").catch(()=>null)]);b(e),A(t),l?.data&&eh(l.data.map(e=>e.id)),ee(t),el(t)}catch(e){console.error("Error fetching guardrail data:",e),u.default.fromBackend("Failed to load guardrail configuration")}})()},[a]),(0,m.useEffect)(()=>{if(!g||!e||!_)return;j(g.provider);let t={provider:g.provider,guardrail_name:g.guardrailNameSuggestion,mode:g.mode,default_on:g.defaultOn,skip_system_message_choice:"inherit"};if("BlockCodeExecution"===g.provider&&(t.confidence_threshold=.5),x.setFieldsValue(t),g.categoryName&&_.content_filter_settings?.content_categories){let e=_.content_filter_settings.content_categories.find(e=>e.name===g.categoryName);e&&z([{id:`category-${Date.now()}`,category:e.name,display_name:e.display_name,action:e.default_action,severity_threshold:"medium"}])}},[g,e,_]);let ev=e=>{j(e);let t={config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0};"BlockCodeExecution"===e&&(t.confidence_threshold=.5),x.setFieldsValue(t),w([]),C({}),T([]),L(2),F({}),E([]),R([]),z([]),K(""),q(!1),U(null),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),"LlmAsAJudge"===e&&x.setFieldsValue({mode:"post_call"})},ew=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eN=(e,t)=>{C(a=>({...a,[e]:t}))},eC=async()=>{try{if(0===S&&(await x.validateFields(["guardrail_name","provider","mode","default_on"]),y)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===y&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await x.validateFields(e)}if(1===S&&er(y)&&0===v.length)return void u.default.fromBackend("Please select at least one PII entity to continue");k(S+1)}catch(e){console.error("Form validation failed:",e)}},eS=()=>{x.resetFields(),j(null),w([]),C({}),T([]),L(2),F({}),E([]),R([]),z([]),K(""),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),V(""),Z(void 0),en("warn"),ec(""),ep(!1),k(0)},ek=()=>{eS(),t()},eI=async()=>{try{f(!0),await x.validateFields();let e=x.getFieldsValue(!0),l=ea[e.provider],r={guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}},i=em(e.skip_system_message_choice);if(void 0!==i&&(r.litellm_params.skip_system_message_in_guardrail=i),"PresidioPII"===e.provider&&v.length>0){let t={};v.forEach(e=>{t[e]=N[e]||"MASK"}),r.litellm_params.pii_entities_config=t,e.presidio_analyzer_api_base&&(r.litellm_params.presidio_analyzer_api_base=e.presidio_analyzer_api_base),e.presidio_anonymizer_api_base&&(r.litellm_params.presidio_anonymizer_api_base=e.presidio_anonymizer_api_base)}if(ei(e.provider)){let e=H&&J?.brand_self?.length>0;if(0===$.length&&0===M.length&&0===G.length&&!e){u.default.fromBackend("Please configure at least one content filter setting (category, pattern, keyword, or competitor intent)"),f(!1);return}$.length>0&&(r.litellm_params.patterns=$.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action}))),M.length>0&&(r.litellm_params.blocked_words=M.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))),G.length>0&&(r.litellm_params.categories=G.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),H&&J?.brand_self?.length>0&&(r.litellm_params.competitor_intent_config={competitor_intent_type:J.competitor_intent_type??"airline",brand_self:J.brand_self,locations:J.locations?.length>0?J.locations:void 0,competitors:"generic"===J.competitor_intent_type&&J.competitors?.length>0?J.competitors:void 0,policy:J.policy,threshold_high:J.threshold_high,threshold_medium:J.threshold_medium,threshold_low:J.threshold_low})}else if(e.config)try{r.guardrail_info=JSON.parse(e.config)}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}if("llm_as_a_judge"===l){let t=e.criteria||[];if(0===t.length){u.default.fromBackend("Add at least one evaluation criterion"),f(!1);return}let a=t.reduce((e,t)=>e+(Number(t?.weight)||0),0);if(100!==a){u.default.fromBackend(`Criterion weights must sum to 100% (currently ${a}%)`),f(!1);return}r.litellm_params.judge_model=e.judge_model,r.litellm_params.overall_threshold=e.overall_threshold??80,r.litellm_params.on_failure=e.on_failure??"block",r.litellm_params.criteria=t.map(e=>({name:e.name,weight:Number(e.weight),description:e.description||""}))}if("tool_permission"===l){if(0===ef.rules.length){u.default.fromBackend("Add at least one tool permission rule"),f(!1);return}r.litellm_params.rules=ef.rules,r.litellm_params.default_action=ef.default_action,r.litellm_params.on_disallowed_action=ef.on_disallowed_action,ef.violation_message_template&&(r.litellm_params.violation_message_template=ef.violation_message_template)}if(ei(e.provider)&&(void 0!==Y&&Y>0&&(r.litellm_params.end_session_after_n_fails=Y),X&&"realtime"===W&&(r.litellm_params.on_violation=X),ed.trim()&&(r.litellm_params.realtime_violation_message=ed.trim())),console.log("values: ",JSON.stringify(e)),I&&y&&"llm_as_a_judge"!==l){let t=ea[y]?.toLowerCase();console.log("providerKey: ",t);let a=I[t]||{},l=new Set;console.log("providerSpecificParams: ",JSON.stringify(a)),Object.keys(a).forEach(e=>{"optional_params"!==e&&l.add(e)}),a.optional_params&&a.optional_params.fields&&Object.keys(a.optional_params.fields).forEach(e=>{l.add(e)}),console.log("allowedParams: ",l),l.forEach(t=>{let a=e[t];(null==a||""===a)&&(a=e.optional_params?.[t]),null!=a&&""!==a&&(r.litellm_params[t]=a)})}if(!a)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(r)),await (0,p.createGuardrailCall)(a,r),u.default.success("Guardrail created successfully"),eS(),d(),t()}catch(e){console.error("Failed to create guardrail:",e),u.default.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}},eA=e=>{if(!_||!ei(y))return null;let t=_.content_filter_settings;return t?(0,l.jsx)(Q,{prebuiltPatterns:t.prebuilt_patterns||[],categories:t.pattern_categories||[],selectedPatterns:$,blockedWords:M,onPatternAdd:e=>E([...$,e]),onPatternRemove:e=>E($.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>{E($.map(a=>a.id===e?{...a,action:t}:a))},onBlockedWordAdd:e=>R([...M,e]),onBlockedWordRemove:e=>R(M.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>{R(M.map(l=>l.id===e?{...l,[t]:a}:l))},contentCategories:t.content_categories||[],selectedContentCategories:G,onContentCategoryAdd:e=>z([...G,e]),onContentCategoryRemove:e=>z(G.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>{z(G.map(l=>l.id===e?{...l,[t]:a}:l))},pendingCategorySelection:D,onPendingCategorySelectionChange:K,accessToken:a,showStep:e,competitorIntentEnabled:H,competitorIntentConfig:J,onCompetitorIntentChange:(e,t)=>{q(e),U(t)}}):null},eO=ei(y)?[{title:"Basic Info",optional:!1},{title:"Topics",optional:!1},{title:"Patterns",optional:!1},{title:"Keywords",optional:!1},{title:"Endpoint Settings (Optional)",optional:!0}]:er(y)?[{title:"Basic Info",optional:!1},{title:"PII Configuration",optional:!1}]:[{title:"Basic Info",optional:!1},{title:"Provider Configuration",optional:!1}];return(0,l.jsx)(s.Modal,{title:null,open:e,onCancel:ek,footer:null,width:1e3,closable:!1,className:"top-8",styles:{body:{padding:0}},children:(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 m-0",children:"Create guardrail"}),(0,l.jsx)("button",{onClick:ek,className:"text-gray-400 hover:text-gray-600 bg-transparent border-none cursor-pointer text-base leading-none p-1",children:"✕"})]}),(0,l.jsx)("div",{className:"overflow-auto px-6 py-4",style:{maxHeight:"calc(80vh - 120px)"},children:(0,l.jsx)(r.Form,{form:x,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1,skip_system_message_choice:"inherit"},children:eO.map((e,t)=>{let s=t{s&&k(t)},style:{minHeight:24},children:[(0,l.jsx)("span",{className:"text-sm",style:{fontWeight:d?600:500,color:d?"#1e293b":s?"#4f46e5":"#94a3b8"},children:e.title}),e.optional&&!d&&(0,l.jsx)("span",{className:"text-[11px] text-slate-400",children:"optional"}),s&&(0,l.jsx)("span",{className:"text-[11px] text-indigo-500 hover:underline",children:"Edit"})]}),d&&(0,l.jsx)("div",{className:"mt-3",children:(()=>{switch(S){case 0:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:ev,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(eW,{value:e,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]}),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{optionLabelProp:"label",mode:"multiple",children:_?.supported_modes?.map(e=>(0,l.jsx)(eW,{value:e,label:e,children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:e}),"pre_call"===e&&(0,l.jsx)(o.Tag,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV[e]})]})},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eW,{value:"pre_call",label:"pre_call",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"pre_call"})," ",(0,l.jsx)(o.Tag,{color:"green",children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.pre_call})]})}),(0,l.jsx)(eW,{value:"during_call",label:"during_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"during_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.during_call})]})}),(0,l.jsx)(eW,{value:"post_call",label:"post_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"post_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.post_call})]})}),(0,l.jsx)(eW,{value:"logging_only",label:"logging_only",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"logging_only"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.logging_only})]})})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: omit role: system from guardrail evaluation input (OpenAI chat + Anthropic messages). The model still receives full messages. Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),!e_&&!ei(y)&&!es(y)&&(0,l.jsx)(ey,{selectedProvider:y,accessToken:a,providerParams:I})]});case 1:if(er(y))return _&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:ew,onActionSelect:eN,entityCategories:_.pii_entity_categories}):null;if(ei(y))return eA("categories");if(es(y))return(0,l.jsx)(eb,{availableModels:eg,form:x});if(!y)return null;if(e_)return(0,l.jsx)(eH,{value:ef,onChange:ej});if(!I)return null;console.log("guardrail_provider_map: ",ea),console.log("selectedProvider: ",y);let e=ea[y]?.toLowerCase(),t=I&&I[e];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null;case 2:if(ei(y))return eA("patterns");return null;case 3:if(ei(y))return eA("keywords");return null;case 4:return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Configure settings for a specific call type. Most guardrails don't need this — skip it unless you're using a specific endpoint like ",(0,l.jsx)("code",{children:"/v1/realtime"}),"."]})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Call type"}),(0,l.jsx)(n.Select,{placeholder:"Select a call type",value:W||void 0,onChange:e=>{V(e),ep(!1)},style:{width:260},allowClear:!0,options:[{value:"realtime",label:"/v1/realtime"}]}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"More call types coming soon."})]}),"realtime"===W&&(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>ep(e=>!e),className:"w-full flex items-center justify-between px-4 py-3 bg-gray-50 hover:bg-gray-100 text-sm font-medium text-gray-700",children:[(0,l.jsx)("span",{children:"/v1/realtime settings"}),(0,l.jsx)("svg",{className:`w-4 h-4 text-gray-500 transition-transform ${eu?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),eu&&(0,l.jsxs)("div",{className:"space-y-5 px-4 py-4 border-t border-gray-200",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"End session after X violations"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Automatically close the session after this many guardrail violations. Leave empty to never auto-close."}),(0,l.jsx)("input",{type:"number",min:1,placeholder:"e.g. 3",value:Y??"",onChange:e=>Z(e.target.value?parseInt(e.target.value,10):void 0),className:"border border-gray-300 rounded px-3 py-1.5 text-sm w-32"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"On violation"}),(0,l.jsx)("div",{className:"space-y-2",children:["warn","end_session"].map(e=>(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"on_violation",value:e,checked:X===e,onChange:()=>en(e),className:"mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"warn"===e?"Warn":"End session"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 m-0",children:"warn"===e?"Bot speaks the message, session continues":"Bot speaks the message, connection closes immediately"})]})]},e))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message the user hears"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"What the bot says aloud when this guardrail fires. Falls back to the default violation message if empty."}),(0,l.jsx)("textarea",{rows:3,placeholder:"e.g. I'm not able to continue this conversation. Please contact us at 1-800-774-2678.",value:ed,onChange:e=>ec(e.target.value),className:"border border-gray-300 rounded px-3 py-2 text-sm w-full resize-none"})]})]})]})]});default:return null}})()})]})]},t)})})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 px-6 py-3 border-t border-gray-200",children:[(0,l.jsx)(c.Button,{onClick:ek,children:"Cancel"}),S>0&&(0,l.jsx)(c.Button,{onClick:()=>{k(S-1)},children:"Previous"}),S{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(g?.provider||null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({});(0,m.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);b(e)}catch(e){console.error("Error fetching guardrail settings:",e),u.default.fromBackend("Failed to load guardrail settings")}})()},[a]),(0,m.useEffect)(()=>{g?.pii_entities_config&&Object.keys(g.pii_entities_config).length>0&&(w(Object.keys(g.pii_entities_config)),C(g.pii_entities_config))},[g]);let S=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},k=(e,t)=>{C(a=>({...a,[e]:t}))},I=async()=>{try{f(!0);let e=await x.validateFields(),l=ea[e.provider],r=c&&"object"==typeof c?{...c}:{};r.guardrail=l,r.mode=e.mode,r.default_on=e.default_on;let i=e.skip_system_message_choice;"yes"===i?r.skip_system_message_in_guardrail=!0:"no"===i?r.skip_system_message_in_guardrail=!1:delete r.skip_system_message_in_guardrail;let s={};if("PresidioPII"===e.provider&&v.length>0){let e={};v.forEach(t=>{e[t]=N[t]||"MASK"}),r.pii_entities_config=e}else if(e.config)try{let t=JSON.parse(e.config);"Bedrock"===e.provider&&t?(t.guardrail_id&&(r.guardrailIdentifier=t.guardrail_id),t.guardrail_version&&(r.guardrailVersion=t.guardrail_version)):s=t}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}let n={guardrail_id:d,guardrail:{guardrail_name:e.guardrail_name,litellm_params:r,guardrail_info:s}};if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(n));let m=`/guardrails/${d}`,g=await fetch(m,{method:"PUT",headers:{[(0,p.getGlobalLitellmHeaderName)()]:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!g.ok){let e=await g.text();throw Error(e||"Failed to update guardrail")}u.default.success("Guardrail updated successfully"),o(),t()}catch(e){console.error("Failed to update guardrail:",e),u.default.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}};return(0,l.jsx)(s.Modal,{title:"Edit Guardrail",open:e,onCancel:t,footer:null,width:700,children:(0,l.jsxs)(r.Form,{form:x,layout:"vertical",initialValues:g,children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(tt.TextInput,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:e=>{j(e),x.setFieldsValue({config:void 0}),w([]),C({})},disabled:!0,optionLabelProp:"label",children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(tr,{value:e,label:t,children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{children:_?.supported_modes?.map(e=>(0,l.jsx)(tr,{value:e,children:e},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tr,{value:"pre_call",children:"pre_call"}),(0,l.jsx)(tr,{value:"post_call",children:"post_call"})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,l.jsx)(D.Switch,{})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: whether role: system content is omitted from guardrail input (LLM still receives full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(tr,{value:"inherit",children:"Use global default"}),(0,l.jsx)(tr,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(tr,{value:"no",children:"No — always include in scan"})]})}),(()=>{if(!y)return null;if("PresidioPII"===y)return _&&y&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:S,onActionSelect:k,entityCategories:_.pii_entity_categories}):null;switch(y){case"Aporia":return(0,l.jsx)(r.Form.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_aporia_api_key",
- "project_name": "your_project_name"
-}`})});case"AimSecurity":return(0,l.jsx)(r.Form.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_aim_api_key"
-}`})});case"Bedrock":return(0,l.jsx)(r.Form.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "guardrail_id": "your_guardrail_id",
- "guardrail_version": "your_guardrail_version"
-}`})});case"GuardrailsAI":return(0,l.jsx)(r.Form.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_guardrails_api_key",
- "guardrail_id": "your_guardrail_id"
-}`})});case"LakeraAI":return(0,l.jsx)(r.Form.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_lakera_api_key"
-}`})});case"PromptInjection":return(0,l.jsx)(r.Form.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "threshold": 0.8
-}`})});default:return(0,l.jsx)(r.Form.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "key1": "value1",
- "key2": "value2"
-}`})})}})(),(0,l.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:I,loading:h,children:"Update Guardrail"})]})]})})};var ts=((a={}).DB="db",a.CONFIG="config",a);e.s(["default",0,({guardrailsList:e,isLoading:t,onDeleteClick:a,accessToken:r,onGuardrailUpdated:i,isAdmin:s=!1,onGuardrailClick:n})=>{let[o,d]=(0,m.useState)([{id:"created_at",desc:!0}]),[c,u]=(0,m.useState)(!1),[p,g]=(0,m.useState)(null),x=e=>e?new Date(e).toLocaleString():"-",h=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,l.jsx)(ej.Tooltip,{title:String(e.getValue()||""),children:(0,l.jsx)(e4.Button,{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 overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?`${String(e.getValue()).slice(0,7)}...`:""})})},{header:"Name",accessorKey:"guardrail_name",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.guardrail_name,children:(0,l.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:({row:e})=>{let{logo:t,displayName:a}=ed(e.original.litellm_params.guardrail);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:`${a} logo`,className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)("span",{className:"text-xs",children:a})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:({row:e})=>{let t=e.original;return(0,l.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(e7.Badge,{color:t.litellm_params?.default_on?"green":"gray",className:"text-xs font-normal",size:"xs",children:t.litellm_params?.default_on?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.created_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.updated_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.updated_at)})})}},{id:"actions",header:"Actions",cell:({row:e})=>{let t=e.original,r=t.guardrail_definition_location===ts.CONFIG;return(0,l.jsx)("div",{className:"flex space-x-2",children:r?(0,l.jsx)(ej.Tooltip,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,l.jsx)(e2.Icon,{"data-testid":"config-delete-icon",icon:e5.TrashIcon,size:"sm",className:"cursor-not-allowed text-gray-400",title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.","aria-label":"Delete guardrail (config)"})}):(0,l.jsx)(ej.Tooltip,{title:"Delete guardrail",children:(0,l.jsx)(e2.Icon,{icon:e5.TrashIcon,size:"sm",onClick:()=>t.guardrail_id&&a(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],f=(0,e9.useReactTable)({data:e,columns:h,state:{sorting:o},onSortingChange:d,getCoreRowModel:(0,te.getCoreRowModel)(),getSortedRowModel:(0,te.getSortedRowModel)(),enableSorting:!0});return(0,l.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)(eY.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,l.jsx)(eX.TableHead,{children:f.getHeaderGroups().map(e=>(0,l.jsx)(e1.TableRow,{children:e.headers.map(e=>(0,l.jsx)(e0.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,e9.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,l.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,l.jsx)(e8.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,l.jsx)(e3.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,l.jsx)(e6.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,l.jsx)(eQ.TableBody,{children:t?(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eZ.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"Loading..."})})})}):e.length>0?f.getRowModel().rows.map(e=>(0,l.jsx)(e1.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,l.jsx)(eZ.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,e9.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eZ.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"No guardrails found"})})})})})]})}),p&&(0,l.jsx)(ti,{visible:c,onClose:()=>u(!1),accessToken:r,onSuccess:()=>{u(!1),g(null),i()},guardrailId:p.guardrail_id||"",fullLitellmParams:p.litellm_params,initialValues:{guardrail_name:p.guardrail_name||"",provider:Object.keys(ea).find(e=>ea[e]===p?.litellm_params.guardrail)||"",mode:p.litellm_params.mode,default_on:p.litellm_params.default_on,pii_entities_config:p.litellm_params.pii_entities_config,skip_system_message_choice:ec(p.litellm_params?.skip_system_message_in_guardrail),...p.guardrail_info}})]})}],782719);var tn=e.i(500330),to=e.i(245094),eN=eN,td=e.i(530212),tc=e.i(350967),tm=e.i(197647),tu=e.i(653824),tp=e.i(881073),tg=e.i(404206),tx=e.i(723731),th=e.i(629569),tf=e.i(678784),ty=e.i(118366),tj=e.i(560445);let{Text:t_}=d.Typography,{Option:tb}=n.Select,tv=({categories:e,onActionChange:t,onSeverityChange:a,onRemove:r,readOnly:i=!1})=>{let s=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(t_,{strong:!0,children:e}),e!==t.category&&(0,l.jsx)("div",{children:(0,l.jsx)(t_,{type:"secondary",style:{fontSize:12},children:t.category})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>i?(0,l.jsx)(o.Tag,{color:{high:"red",medium:"orange",low:"yellow"}[e],children:e.toUpperCase()}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>a?.(t.id,e),style:{width:150},size:"small",children:[(0,l.jsx)(tb,{value:"high",children:"High"}),(0,l.jsx)(tb,{value:"medium",children:"Medium"}),(0,l.jsx)(tb,{value:"low",children:"Low"})]})},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>i?(0,l.jsx)(o.Tag,{color:"BLOCK"===e?"red":"blue",children:e}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>t?.(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(tb,{value:"BLOCK",children:"Block"}),(0,l.jsx)(tb,{value:"MASK",children:"Mask"})]})}];return(i||s.push({title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r?.(t.id),children:"Delete"})}),0===e.length)?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No categories configured."}):(0,l.jsx)(I.Table,{dataSource:e,columns:s,rowKey:"id",pagination:!1,size:"small"})},tw=({patterns:e,blockedWords:t,categories:a=[],readOnly:r=!0,onPatternActionChange:i,onPatternRemove:s,onBlockedWordUpdate:n,onBlockedWordRemove:o,onCategoryActionChange:d,onCategorySeverityChange:c,onCategoryRemove:m})=>{if(0===e.length&&0===t.length&&0===a.length)return null;let u=()=>{};return(0,l.jsxs)(l.Fragment,{children:[a.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Content Categories"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[a.length," categories configured"]})]}),(0,l.jsx)(tv,{categories:a,onActionChange:r?void 0:d,onSeverityChange:r?void 0:c,onRemove:r?void 0:m,readOnly:r})]}),e.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[e.length," patterns configured"]})]}),(0,l.jsx)(P,{patterns:e,onActionChange:r?u:i||u,onRemove:r?u:s||u})]}),t.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[t.length," keywords configured"]})]}),(0,l.jsx)(F,{keywords:t,onActionChange:r?u:n||u,onRemove:r?u:o||u})]})]})},{Text:tN}=d.Typography,tC=({guardrailData:e,guardrailSettings:t,isEditing:a,accessToken:r,onDataChange:i,onUnsavedChanges:s})=>{let[n,o]=(0,m.useState)([]),[d,c]=(0,m.useState)([]),[u,p]=(0,m.useState)([]),[g,x]=(0,m.useState)([]),[h,f]=(0,m.useState)([]),[y,j]=(0,m.useState)([]),[_,b]=(0,m.useState)(!1),[v,w]=(0,m.useState)(null),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(e?.litellm_params?.patterns){let t=e.litellm_params.patterns.map((e,t)=>({id:`pattern-${t}`,type:"prebuilt"===e.pattern_type?"prebuilt":"custom",name:e.pattern_name||e.name,display_name:e.display_name,pattern:e.pattern,action:e.action||"BLOCK"}));o(t),x(t)}else o([]),x([]);if(e?.litellm_params?.blocked_words){let t=e.litellm_params.blocked_words.map((e,t)=>({id:`word-${t}`,keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));c(t),f(t)}else c([]),f([]);if(e?.litellm_params?.categories?.length>0){let a=t?.content_filter_settings?.content_categories?Object.fromEntries(t.content_filter_settings.content_categories.map(e=>[e.name,e])):{},l=e.litellm_params.categories.map((e,t)=>{let l=a[e.category];return{id:`category-${t}`,category:e.category,display_name:l?.display_name??e.category,action:e.action||"BLOCK",severity_threshold:e.severity_threshold||"medium"}});p(l),j(l)}else p([]),j([]);let a=e?.litellm_params?.competitor_intent_config;if(a&&"object"==typeof a){let e=!!(a.brand_self&&Array.isArray(a.brand_self)&&a.brand_self.length>0),t={competitor_intent_type:a.competitor_intent_type??"airline",brand_self:Array.isArray(a.brand_self)?a.brand_self:[],locations:Array.isArray(a.locations)?a.locations:[],competitors:Array.isArray(a.competitors)?a.competitors:[],policy:a.policy??{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:"number"==typeof a.threshold_high?a.threshold_high:.7,threshold_medium:"number"==typeof a.threshold_medium?a.threshold_medium:.45,threshold_low:"number"==typeof a.threshold_low?a.threshold_low:.3};b(e),w(t),C(e),k(t)}else b(!1),w(null),C(!1),k(null)},[e,t?.content_filter_settings?.content_categories]),(0,m.useEffect)(()=>{i&&i(n,d,u,_,v)},[n,d,u,_,v,i]);let I=m.default.useMemo(()=>{let e=JSON.stringify(n)!==JSON.stringify(g),t=JSON.stringify(d)!==JSON.stringify(h),a=JSON.stringify(u)!==JSON.stringify(y),l=_!==N||JSON.stringify(v)!==JSON.stringify(S);return e||t||a||l},[n,d,u,_,v,g,h,y,N,S]);return((0,m.useEffect)(()=>{a&&s&&s(I)},[I,a,s]),e?.litellm_params?.guardrail!=="litellm_content_filter")?null:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"Content Filter Configuration"}),I&&(0,l.jsx)(tj.Alert,{type:"warning",showIcon:!0,className:"mb-4",message:(0,l.jsx)(tN,{children:'You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,l.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,l.jsx)(Q,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:n,blockedWords:d,onPatternAdd:e=>o([...n,e]),onPatternRemove:e=>o(n.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>o(n.map(a=>a.id===e?{...a,action:t}:a)),onBlockedWordAdd:e=>c([...d,e]),onBlockedWordRemove:e=>c(d.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>c(d.map(l=>l.id===e?{...l,[t]:a}:l)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r,contentCategories:t.content_filter_settings.content_categories||[],selectedContentCategories:u,onContentCategoryAdd:e=>p([...u,e]),onContentCategoryRemove:e=>p(u.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>p(u.map(l=>l.id===e?{...l,[t]:a}:l)),competitorIntentEnabled:_,competitorIntentConfig:v,onCompetitorIntentChange:(e,t)=>{b(e),w(t)}})})]}):(0,l.jsx)(tw,{patterns:n,blockedWords:d,categories:u,readOnly:!0})};var tS=e.i(788191),tk=e.i(245704),tI=e.i(518617);let tA={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};var tO=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tA}))}),tT=e.i(987432);let tP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M892 772h-80v-80c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v80h-80c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h80v80c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-80h80c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM373.5 498.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.8-1.7-203.2 89.2-203.2 200 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.8-1.1 6.4-4.8 5.9-8.8zM824 472c0-109.4-87.9-198.3-196.9-200C516.3 270.3 424 361.2 424 472c0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C357 742.6 326 814.8 324 891.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.5C505.8 695.7 563 672 624 672c110.4 0 200-89.5 200-200zm-109.5 90.5C690.3 586.7 658.2 600 624 600s-66.3-13.3-90.5-37.5a127.26 127.26 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-.1 34.2-13.4 66.3-37.6 90.5z"}}]},name:"usergroup-add",theme:"outlined"};var tL=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tP}))}),tB=e.i(872934);let{Panel:tF}=$.Collapse,{TextArea:t$}=i.Input,tE={empty:{name:"Empty Template",code:`async def apply_guardrail(inputs, request_data, input_type):
- # inputs: {texts, images, tools, tool_calls, structured_messages, model}
- # request_data: {model, user_id, team_id, end_user_id, metadata}
- # input_type: "request" or "response"
- return allow()`},blockSSN:{name:"Block SSN",code:`def apply_guardrail(inputs, request_data, input_type):
- for text in inputs["texts"]:
- if regex_match(text, r"\\d{3}-\\d{2}-\\d{4}"):
- return block("SSN detected")
- return allow()`},redactEmail:{name:"Redact Emails",code:`def apply_guardrail(inputs, request_data, input_type):
- pattern = r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
- modified = []
- for text in inputs["texts"]:
- modified.append(regex_replace(text, pattern, "[EMAIL REDACTED]"))
- return modify(texts=modified)`},blockSQL:{name:"Block SQL Injection",code:`def apply_guardrail(inputs, request_data, input_type):
- if input_type != "request":
- return allow()
- for text in inputs["texts"]:
- if contains_code_language(text, ["sql"]):
- return block("SQL code not allowed")
- return allow()`},validateJSON:{name:"Validate JSON",code:`def apply_guardrail(inputs, request_data, input_type):
- if input_type != "response":
- return allow()
-
- schema = {"type": "object", "required": ["name", "value"]}
-
- for text in inputs["texts"]:
- obj = json_parse(text)
- if obj is None:
- return block("Invalid JSON response")
- if not json_schema_valid(obj, schema):
- return block("Response missing required fields")
- return allow()`},externalAPI:{name:"External API Check (async)",code:`async def apply_guardrail(inputs, request_data, input_type):
- # Call an external moderation API (async for non-blocking)
- for text in inputs["texts"]:
- response = await http_post(
- "https://api.example.com/moderate",
- body={"text": text, "user_id": request_data["user_id"]},
- headers={"Authorization": "Bearer YOUR_API_KEY"},
- timeout=10
- )
-
- if not response["success"]:
- # API call failed, allow by default or block
- return allow()
-
- if response["body"].get("flagged"):
- return block(response["body"].get("reason", "Content flagged"))
-
- return allow()`}},tM={"Return Values":[{name:"allow()",desc:"Let request/response through"},{name:"block(reason)",desc:"Reject with message"},{name:"modify(texts=[], images=[], tool_calls=[])",desc:"Transform content"}],"HTTP Requests (async)":[{name:"await http_request(url, method, headers, body)",desc:"Make async HTTP request"},{name:"await http_get(url, headers)",desc:"Async GET request"},{name:"await http_post(url, body, headers)",desc:"Async POST request"}],"Regex Functions":[{name:"regex_match(text, pattern)",desc:"Returns True if pattern found"},{name:"regex_replace(text, pattern, replacement)",desc:"Replace all matches"},{name:"regex_find_all(text, pattern)",desc:"Return list of matches"}],"JSON Functions":[{name:"json_parse(text)",desc:"Parse JSON string, returns None on error"},{name:"json_stringify(obj)",desc:"Convert to JSON string"},{name:"json_schema_valid(obj, schema)",desc:"Validate against JSON schema"}],"URL Functions":[{name:"extract_urls(text)",desc:"Extract all URLs from text"},{name:"is_valid_url(url)",desc:"Check if URL is valid"},{name:"all_urls_valid(text)",desc:"Check all URLs in text are valid"}],"Code Detection":[{name:"detect_code(text)",desc:"Returns True if code detected"},{name:"detect_code_languages(text)",desc:"Returns list of detected languages"},{name:'contains_code_language(text, ["sql"])',desc:"Check for specific languages"}],"Text Utilities":[{name:"contains(text, substring)",desc:"Check if substring exists"},{name:"contains_any(text, [substr1, substr2])",desc:"Check if any substring exists"},{name:"word_count(text)",desc:"Count words"},{name:"char_count(text)",desc:"Count characters"},{name:"lower(text) / upper(text) / trim(text)",desc:"String transforms"}]},tR=[{value:"pre_call",label:"pre_call (Request)"},{value:"post_call",label:"post_call (Response)"},{value:"during_call",label:"during_call (Parallel)"},{value:"logging_only",label:"logging_only"},{value:"pre_mcp_call",label:"pre_mcp_call (Before MCP Tool Call)"},{value:"post_mcp_call",label:"post_mcp_call (After MCP Tool Call)"},{value:"during_mcp_call",label:"during_mcp_call (During MCP Tool Call)"}],tG=({visible:e,onClose:t,onSuccess:a,accessToken:r,editData:i})=>{let o=!!i,[d,c]=(0,m.useState)(""),[g,x]=(0,m.useState)(["pre_call"]),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)("empty"),[_,b]=(0,m.useState)(tE.empty.code),[v,w]=(0,m.useState)(!1),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(!1),I={texts:["Hello, my SSN is 123-45-6789"],images:[],tools:[{type:"function",function:{name:"get_weather",description:"Get the current weather in a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"}},required:["location"]}}}],tool_calls:[],structured_messages:[{role:"system",content:"You are a helpful assistant."},{role:"user",content:"Hello, my SSN is 123-45-6789"}],model:"gpt-4"},A={texts:["The weather in San Francisco is 72°F and sunny."],images:[],tools:[],tool_calls:[{id:"call_abc123",type:"function",function:{name:"get_weather",arguments:'{"location": "San Francisco"}'}}],structured_messages:[],model:"gpt-4"},O={texts:['Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'],images:[],tools:[{type:"function",function:{name:"read_wiki_structure",description:"Read the structure of a GitHub repository (MCP tool passed as OpenAI tool)",parameters:{type:"object",properties:{repoName:{type:"string",description:"Repository name, e.g. BerriAI/litellm"}},required:["repoName"]}}}],tool_calls:[{id:"call_mcp_001",type:"function",function:{name:"read_wiki_structure",arguments:'{"repoName": "BerriAI/litellm"}'}}],structured_messages:[{role:"user",content:'Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'}],model:"mcp-tool-call"},[T,P]=(0,m.useState)(JSON.stringify(I,null,2)),[L,B]=(0,m.useState)(null),[F,E]=(0,m.useState)(null),M=(0,m.useRef)(null),R=e=>null==e?["pre_call"]:Array.isArray(e)?e.length?e:["pre_call"]:[e];(0,m.useEffect)(()=>{e&&(i?(c(i.guardrail_name||""),x(R(i.litellm_params?.mode)),f(i.litellm_params?.default_on||!1),b(i.litellm_params?.custom_code||tE.empty.code),j("")):(c(""),x(["pre_call"]),f(!1),j("empty"),b(tE.empty.code)),B(null),k(!1))},[e,i]);let G=async e=>{try{await navigator.clipboard.writeText(e),E(e),setTimeout(()=>E(null),2e3)}catch(e){console.error("Failed to copy:",e)}},z=async()=>{if(!d.trim())return void u.default.fromBackend("Please enter a guardrail name");if(!_.trim())return void u.default.fromBackend("Please enter custom code");if(!r)return void u.default.fromBackend("No access token available");w(!0);try{if(o&&i){let e={litellm_params:{custom_code:_}};d!==i.guardrail_name&&(e.guardrail_name=d);let t=R(i.litellm_params?.mode);(g.length!==t.length||g.some((e,a)=>e!==t[a]))&&(e.litellm_params.mode=g),h!==i.litellm_params?.default_on&&(e.litellm_params.default_on=h),await (0,p.updateGuardrailCall)(r,i.guardrail_id,e),u.default.success("Custom code guardrail updated successfully")}else await (0,p.createGuardrailCall)(r,{guardrail_name:d,litellm_params:{guardrail:"custom_code",mode:g,default_on:h,custom_code:_},guardrail_info:{}}),u.default.success("Custom code guardrail created successfully");a(),t()}catch(e){console.error("Failed to save guardrail:",e),u.default.fromBackend(`Failed to ${o?"update":"create"} guardrail: `+(e instanceof Error?e.message:String(e)))}finally{w(!1)}},K=async()=>{if(!r)return void B({error:"No access token available"});C(!0),B(null);try{let e;try{e=JSON.parse(T)}catch(e){B({error:"Invalid test input JSON"}),C(!1);return}e.texts||(e.texts=[]);let t=["pre_call","pre_mcp_call"],a=["post_call","post_mcp_call"],l=g.some(e=>t.includes(e))?"request":g.some(e=>a.includes(e))?"response":"request",i=await (0,p.testCustomCodeGuardrail)(r,{custom_code:_,test_input:e,input_type:l,request_data:{model:"test-model",metadata:{}}});i.success&&i.result?B(i.result):i.error?B({error:i.error,error_type:i.error_type}):B({error:"Unknown error occurred"})}catch(e){console.error("Failed to test custom code:",e),B({error:e instanceof Error?e.message:"Failed to test custom code"})}finally{C(!1)}},H=_.split("\n").length;return(0,l.jsxs)(s.Modal,{open:e,onCancel:t,footer:null,width:1400,className:"custom-code-modal",closable:!0,destroyOnClose:!0,children:[(0,l.jsxs)("div",{className:"flex flex-col h-[80vh]",children:[(0,l.jsxs)("div",{className:"pb-4 border-b border-gray-200",children:[(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:o?"Edit Custom Guardrail":"Create Custom Guardrail"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Define custom logic using Python-like syntax"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4 py-4 border-b border-gray-100",children:[(0,l.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Guardrail Name"}),(0,l.jsx)(tt.TextInput,{value:d,onValueChange:c,placeholder:"e.g., block-pii-custom"})]}),(0,l.jsxs)("div",{className:"w-[280px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Mode (can select multiple)"}),(0,l.jsx)(n.Select,{mode:"multiple",value:g,onChange:x,options:tR,className:"w-full",size:"middle",placeholder:"Select modes"})]}),(0,l.jsxs)("div",{className:"w-[180px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Template"}),(0,l.jsx)(n.Select,{value:y,onChange:e=>{j(e),b(tE[e].code)},className:"w-full",size:"middle",dropdownRender:e=>(0,l.jsxs)(l.Fragment,{children:[e,(0,l.jsx)(eG.Divider,{style:{margin:"8px 0"}}),(0,l.jsxs)("div",{style:{padding:"8px 12px",cursor:"pointer",color:"#1890ff",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},onClick:e=>{e.preventDefault(),window.open("https://models.litellm.ai/guardrails","_blank")},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f0f0f0"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,l.jsx)(tL,{}),(0,l.jsx)("span",{children:"Browse Community templates"}),(0,l.jsx)(tB.ExportOutlined,{style:{fontSize:"10px"}})]})]}),children:(0,l.jsx)(n.Select.OptGroup,{label:"STANDARD",children:Object.entries(tE).map(([e,t])=>(0,l.jsx)(n.Select.Option,{value:e,children:t.name},e))})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pt-5",children:[(0,l.jsx)("span",{className:"text-sm text-gray-600",children:"Default On"}),(0,l.jsx)(D.Switch,{checked:h,onChange:f})]})]}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-hidden mt-4 gap-6",children:[(0,l.jsxs)("div",{className:"flex-[2] flex flex-col min-w-0 overflow-y-auto",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2 flex-shrink-0",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Python Logic"}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Restricted environment (no imports)"})]}),(0,l.jsxs)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e] flex-shrink-0",style:{minHeight:"300px",maxHeight:"400px"},children:[(0,l.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-12 bg-[#1e1e1e] border-r border-gray-700 text-right pr-3 pt-3 select-none overflow-hidden",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6"},children:Array.from({length:Math.max(H,20)},(e,t)=>(0,l.jsx)("div",{className:"text-gray-500 h-[22.4px]",children:t+1},t+1))}),(0,l.jsx)("textarea",{ref:M,value:_,onChange:e=>b(e.target.value),onKeyDown:e=>{if("Tab"===e.key){e.preventDefault();let t=e.currentTarget,a=t.selectionStart,l=t.selectionEnd;b(_.substring(0,a)+" "+_.substring(l)),setTimeout(()=>{t.selectionStart=t.selectionEnd=a+4},0)}},spellCheck:!1,className:"w-full h-full pl-14 pr-4 pt-3 pb-3 resize-none focus:outline-none bg-transparent text-gray-200",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6",tabSize:4}})]}),(0,l.jsx)($.Collapse,{activeKey:S?["test"]:[],onChange:e=>k(e.includes("test")),className:"mt-3 bg-white border border-gray-200 rounded-lg flex-shrink-0",expandIcon:({isActive:e})=>(0,l.jsx)(tO,{rotate:90*!!e}),children:(0,l.jsx)(tF,{header:(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,l.jsx)(tS.PlayCircleOutlined,{className:"text-blue-500"}),"Test Your Guardrail"]}),children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600",children:"Test Input (JSON)"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs text-gray-500",children:"Load example:"}),(0,l.jsx)("button",{type:"button",onClick:()=>P(JSON.stringify(I,null,2)),className:"px-2 py-1 text-xs rounded border border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 transition-colors",children:"Pre-call"}),(0,l.jsx)("button",{type:"button",onClick:()=>P(JSON.stringify(O,null,2)),className:"px-2 py-1 text-xs rounded border border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 transition-colors",children:"Pre MCP"}),(0,l.jsx)("button",{type:"button",onClick:()=>P(JSON.stringify(A,null,2)),className:"px-2 py-1 text-xs rounded border border-green-200 bg-green-50 text-green-700 hover:bg-green-100 transition-colors",children:"Post-call"})]})]}),(0,l.jsx)("div",{className:"mb-2 p-2 bg-gray-50 rounded text-xs text-gray-600 border border-gray-200",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"texts"}),": Message content (always)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"images"}),": Base64 images (vision)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tools"}),": Tool definitions ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"}),", MCP as OpenAI tool ",(0,l.jsx)("span",{className:"text-purple-600",children:"(pre_mcp_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tool_calls"}),": LLM tool calls ",(0,l.jsx)("span",{className:"text-green-600",children:"(post_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"structured_messages"}),": Full messages ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"model"}),": Model name (always)"]})]})}),(0,l.jsx)(t$,{value:T,onChange:e=>P(e.target.value),rows:8,className:"font-mono text-xs",placeholder:'{"texts": ["test message"], ...}'})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{size:"xs",onClick:K,disabled:N,icon:tS.PlayCircleOutlined,children:N?"Running...":"Run Test"}),L&&(0,l.jsx)("div",{className:`flex items-center gap-2 text-sm ${L.error?"text-red-600":"allow"===L.action?"text-green-600":"block"===L.action?"text-orange-600":"text-blue-600"}`,children:L.error?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{}),(0,l.jsxs)("span",{children:[L.error_type&&(0,l.jsxs)("span",{className:"font-medium",children:["[",L.error_type,"] "]}),L.error]})]}):"allow"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Allowed"]}):"block"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{})," Blocked: ",L.reason]}):"modify"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Modified",L.texts&&L.texts.length>0&&(0,l.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:["→ ",L.texts[0].substring(0,50),L.texts[0].length>50?"...":""]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," ",L.action||"Unknown"]})})]})]})},"test")}),(0,l.jsxs)("div",{className:"mt-3 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-lg flex items-center justify-between flex-shrink-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"bg-blue-100 rounded-full p-2",children:(0,l.jsx)(tL,{className:"text-blue-600 text-lg"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Built a useful guardrail?"}),(0,l.jsx)("div",{className:"text-xs text-gray-600",children:"Share it with the community and help others build faster"})]})]}),(0,l.jsx)(e4.Button,{size:"xs",onClick:()=>window.open("https://github.com/BerriAI/litellm-guardrails","_blank"),icon:tB.ExportOutlined,className:"bg-blue-600 hover:bg-blue-700 text-white border-0",children:"Contribute Template"})]})]}),(0,l.jsxs)("div",{className:"w-[300px] flex-shrink-0 overflow-auto border-l border-gray-200 pl-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)("span",{className:"font-semibold text-gray-700",children:"Available Primitives"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Click to copy functions to clipboard"}),(0,l.jsx)($.Collapse,{defaultActiveKey:["Return Values"],className:"primitives-collapse bg-transparent border-0",expandIconPosition:"end",children:Object.entries(tM).map(([e,t])=>(0,l.jsx)(tF,{header:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e}),className:"bg-white mb-2 rounded-lg border border-gray-200",children:(0,l.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,l.jsx)("button",{onClick:()=>G(e.name),className:`w-full text-left px-2 py-2 rounded transition-colors ${F===e.name?"bg-green-100":"bg-gray-50 hover:bg-blue-50"}`,children:F===e.name?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-mono text-green-700",children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Copied!"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-xs font-mono text-gray-800",children:e.name}),(0,l.jsx)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:e.desc})]})},e.name))})},e))})]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-gray-200",children:[(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Changes are auto-saved to local draft"}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:z,loading:v,disabled:v||!d.trim(),icon:tT.SaveOutlined,children:o?"Update Guardrail":"Save Guardrail"})]})]})]}),(0,l.jsx)("style",{children:`
- .custom-code-modal .ant-modal-content {
- padding: 24px;
- }
- .custom-code-modal .ant-modal-close {
- top: 20px;
- right: 20px;
- }
- .primitives-collapse .ant-collapse-item {
- border: none !important;
- }
- .primitives-collapse .ant-collapse-header {
- padding: 8px 12px !important;
- }
- .primitives-collapse .ant-collapse-content-box {
- padding: 8px 12px !important;
- }
- `})]})};e.s(["default",0,({guardrailId:e,onClose:t,accessToken:a,isAdmin:s})=>{let o,[d,g]=(0,m.useState)(null),[x,h]=(0,m.useState)(null),[f,y]=(0,m.useState)(!0),[j,_]=(0,m.useState)(!1),[b]=r.Form.useForm(),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(null),[I,A]=(0,m.useState)({}),[O,T]=(0,m.useState)(!1),P={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[L,B]=(0,m.useState)(P),[F,$]=(0,m.useState)(!1),[E,M]=(0,m.useState)(!1),R=m.default.useRef({patterns:[],blockedWords:[],categories:[]}),G=(0,m.useCallback)((e,t,a,l,r)=>{R.current={patterns:e,blockedWords:t,categories:a||[],competitorIntentEnabled:l,competitorIntentConfig:r}},[]),z=async()=>{try{if(y(!0),!a)return;let t=await (0,p.getGuardrailInfo)(a,e);if(g(t),t.litellm_params?.pii_entities_config){let e=t.litellm_params.pii_entities_config;if(w([]),C({}),Object.keys(e).length>0){let t=[],a={};Object.entries(e).forEach(([e,l])=>{t.push(e),a[e]="string"==typeof l?l:"MASK"}),w(t),C(a)}}else w([]),C({})}catch(e){u.default.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{y(!1)}},D=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailProviderSpecificParams)(a);h(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},K=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);k(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,m.useEffect)(()=>{D()},[a]),(0,m.useEffect)(()=>{z(),K()},[e,a]),(0,m.useEffect)(()=>{if(d&&b){let e={...d.litellm_params||{}};delete e.skip_system_message_in_guardrail,b.setFieldsValue({guardrail_name:d.guardrail_name,...e,skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}})}},[d,x,b]);let H=(0,m.useCallback)(()=>{d?.litellm_params?.guardrail==="tool_permission"?B({rules:d.litellm_params?.rules||[],default_action:(d.litellm_params?.default_action||"deny").toLowerCase(),on_disallowed_action:(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),violation_message_template:d.litellm_params?.violation_message_template||""}):B(P),$(!1)},[d]);(0,m.useEffect)(()=>{H()},[H]);let q=async t=>{try{if(!a)return;let o={litellm_params:{}};t.guardrail_name!==d.guardrail_name&&(o.guardrail_name=t.guardrail_name),t.default_on!==d.litellm_params?.default_on&&(o.litellm_params.default_on=t.default_on);let c=ec(d.litellm_params?.skip_system_message_in_guardrail),m=t.skip_system_message_choice;void 0!==m&&m!==c&&("inherit"===m?o.litellm_params.skip_system_message_in_guardrail=null:"yes"===m?o.litellm_params.skip_system_message_in_guardrail=!0:o.litellm_params.skip_system_message_in_guardrail=!1);let g=d.guardrail_info,h=t.guardrail_info?JSON.parse(t.guardrail_info):void 0;JSON.stringify(g)!==JSON.stringify(h)&&(o.guardrail_info=h);let f=d.litellm_params?.pii_entities_config||{},y={};if(v.forEach(e=>{y[e]=N[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(y)&&(o.litellm_params.pii_entities_config=y),d.litellm_params?.guardrail==="litellm_content_filter"&&O){var l,r,i,s,n;let e,t=(l=R.current.patterns||[],r=R.current.blockedWords||[],i=R.current.categories||[],s=R.current.competitorIntentEnabled,n=R.current.competitorIntentConfig,e={patterns:l.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action})),blocked_words:r.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))},void 0!==i&&(e.categories=i.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),s&&n&&n.brand_self.length>0&&(e.competitor_intent_config={competitor_intent_type:n.competitor_intent_type,brand_self:n.brand_self,locations:n.locations?.length?n.locations:void 0,competitors:"generic"===n.competitor_intent_type&&n.competitors?.length?n.competitors:void 0,policy:n.policy,threshold_high:n.threshold_high,threshold_medium:n.threshold_medium,threshold_low:n.threshold_low}),e);o.litellm_params.patterns=t.patterns,o.litellm_params.blocked_words=t.blocked_words,o.litellm_params.categories=t.categories,o.litellm_params.competitor_intent_config=t.competitor_intent_config??null}if(d.litellm_params?.guardrail==="tool_permission"){let e=d.litellm_params?.rules||[],t=L.rules||[],a=JSON.stringify(e)!==JSON.stringify(t),l=(d.litellm_params?.default_action||"deny").toLowerCase(),r=(L.default_action||"deny").toLowerCase(),i=l!==r,s=(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),n=(L.on_disallowed_action||"block").toLowerCase(),c=s!==n,m=d.litellm_params?.violation_message_template||"",u=L.violation_message_template||"",p=m!==u;(F||a||i||c||p)&&(o.litellm_params.rules=t,o.litellm_params.default_action=r,o.litellm_params.on_disallowed_action=n,o.litellm_params.violation_message_template=u||null)}let j=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);console.log("values: ",JSON.stringify(t)),console.log("currentProvider: ",j);let b=d.litellm_params?.guardrail==="tool_permission";if(x&&j&&!b){let e=x[ea[j]?.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(e)),Object.keys(e).forEach(e=>{"optional_params"!==e&&a.add(e)}),e.optional_params&&e.optional_params.fields&&Object.keys(e.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{if("patterns"===e||"blocked_words"===e||"categories"===e)return;let a=t[e];(null==a||""===a)&&(a=t.optional_params?.[e]);let l=d.litellm_params?.[e];JSON.stringify(a)!==JSON.stringify(l)&&(null!=a&&""!==a?o.litellm_params[e]=a:null!=l&&""!==l&&(o.litellm_params[e]=null))})}if(0===Object.keys(o.litellm_params).length&&delete o.litellm_params,0===Object.keys(o).length){u.default.info("No changes detected"),_(!1);return}await (0,p.updateGuardrailCall)(a,e,o),u.default.success("Guardrail updated successfully"),T(!1),z(),_(!1)}catch(e){console.error("Error updating guardrail:",e),u.default.fromBackend("Failed to update guardrail")}};if(f)return(0,l.jsx)("div",{className:"p-4",children:"Loading..."});if(!d)return(0,l.jsx)("div",{className:"p-4",children:"Guardrail not found"});let J=e=>e?new Date(e).toLocaleString():"-",{logo:U,displayName:W}=ed(d.litellm_params?.guardrail||""),V=async(e,t)=>{await (0,tn.copyToClipboard)(e)&&(A(e=>({...e,[t]:!0})),setTimeout(()=>{A(e=>({...e,[t]:!1}))},2e3))},Y="config"===d.guardrail_definition_location;return(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Button,{type:"text",icon:(0,l.jsx)(td.ArrowLeftIcon,{className:"w-4 h-4"}),onClick:t,className:"mb-4",children:"Back to Guardrails"}),(0,l.jsx)(th.Title,{children:d.guardrail_name||"Unnamed Guardrail"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(eR.Text,{className:"text-gray-500 font-mono",children:d.guardrail_id}),(0,l.jsx)(c.Button,{type:"text",size:"small",icon:I["guardrail-id"]?(0,l.jsx)(tf.CheckIcon,{size:12}):(0,l.jsx)(ty.CopyIcon,{size:12}),onClick:()=>V(d.guardrail_id,"guardrail-id"),className:`left-2 z-10 transition-all duration-200 ${I["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,l.jsxs)(tu.TabGroup,{children:[(0,l.jsxs)(tp.TabList,{className:"mb-4",children:[(0,l.jsx)(tm.Tab,{children:"Overview"},"overview"),s?(0,l.jsx)(tm.Tab,{children:"Settings"},"settings"):(0,l.jsx)(l.Fragment,{})]}),(0,l.jsxs)(tx.TabPanels,{children:[(0,l.jsxs)(tg.TabPanel,{children:[(0,l.jsxs)(tc.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Provider"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[U&&(0,l.jsx)("img",{src:U,alt:`${W} logo`,className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)(th.Title,{children:W})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Mode"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:d.litellm_params?.mode||"-"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Default On":"Default Off"})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Created At"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:J(d.created_at)}),(0,l.jsxs)(eR.Text,{children:["Last Updated: ",J(d.updated_at)]})]})]})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsx)(eR.Text,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(d.litellm_params?.pii_entities_config).map(([e,t])=>(0,l.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-medium text-gray-900",children:e}),(0,l.jsx)(eR.Text,{className:"flex-1",children:(0,l.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${"MASK"===t?"text-blue-600":"text-red-600"}`,children:["MASK"===t?(0,l.jsx)(eN.default,{}):(0,l.jsx)(eC.StopOutlined,{}),String(t)]})})]},e))})]})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsx)(eH,{value:L,disabled:!0})}),d.litellm_params?.guardrail==="custom_code"&&d.litellm_params?.custom_code&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)(eR.Text,{className:"font-medium text-lg",children:"Custom Code"})]}),s&&!Y&&(0,l.jsx)(c.Button,{size:"small",icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"})]}),(0,l.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e]",children:(0,l.jsx)("pre",{className:"p-4 text-sm text-gray-200 overflow-x-auto",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace"},children:(0,l.jsx)("code",{children:d.litellm_params.custom_code})})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!1,accessToken:a})]}),s&&(0,l.jsx)(tg.TabPanel,{children:(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(th.Title,{children:"Guardrail Settings"}),Y&&(0,l.jsx)(ej.Tooltip,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})}),!j&&!Y&&(d.litellm_params?.guardrail==="custom_code"?(0,l.jsx)(c.Button,{icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"}):(0,l.jsx)(c.Button,{onClick:()=>_(!0),children:"Edit Settings"}))]}),j?(0,l.jsxs)(r.Form,{form:b,onFinish:q,initialValues:{guardrail_name:d.guardrail_name,...(o={...d.litellm_params||{}},delete o.skip_system_message_in_guardrail,o),skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}},layout:"vertical",children:[(0,l.jsx)(r.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter guardrail name"})}),(0,l.jsx)(r.Form.Item,{label:"Default On",name:"default_on",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{label:"Skip system messages in guardrail",name:"skip_system_message_choice",tooltip:"Unified guardrails: omit role: system from guardrail input (LLM still gets full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),d.litellm_params?.guardrail==="presidio"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"PII Protection"}),(0,l.jsx)("div",{className:"mb-6",children:S&&(0,l.jsx)(eE,{entities:S.supported_entities,actions:S.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onActionSelect:(e,t)=>{C(a=>({...a,[e]:t}))},entityCategories:S.pii_entity_categories})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!0,accessToken:a,onDataChange:G,onUnsavedChanges:T}),(d.litellm_params?.guardrail==="tool_permission"||x)&&(0,l.jsx)(eG.Divider,{orientation:"left",children:"Provider Settings"}),d.litellm_params?.guardrail==="tool_permission"?(0,l.jsx)(eH,{value:L,onChange:B}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey,{selectedProvider:Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail)||null,accessToken:a,providerParams:x,value:d.litellm_params}),x&&(()=>{let e=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);if(!e)return null;let t=x[ea[e]?.toLowerCase()];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:d.litellm_params}):null})()]}),(0,l.jsx)(eG.Divider,{orientation:"left",children:"Advanced Settings"}),(0,l.jsx)(r.Form.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,l.jsx)(i.Input.TextArea,{rows:5})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,l.jsx)(c.Button,{onClick:()=>{_(!1),T(!1),H()},children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail ID"}),(0,l.jsx)("div",{className:"font-mono",children:d.guardrail_id})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail Name"}),(0,l.jsx)("div",{children:d.guardrail_name||"Unnamed Guardrail"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Provider"}),(0,l.jsx)("div",{children:W})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Mode"}),(0,l.jsx)("div",{children:d.litellm_params?.mode||"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Default On"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Yes":"No"})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Created At"}),(0,l.jsx)("div",{children:J(d.created_at)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Last Updated"}),(0,l.jsx)("div",{children:J(d.updated_at)})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eH,{value:L,disabled:!0})]})]})})]})]}),(0,l.jsx)(tG,{visible:E,onClose:()=>M(!1),onSuccess:()=>{M(!1),z()},accessToken:a,editData:d?{guardrail_id:d.guardrail_id,guardrail_name:d.guardrail_name,litellm_params:d.litellm_params}:null})]})}],969641);var tz=e.i(573421),tD=e.i(19732),tK=e.i(928685),tH=e.i(166406),tq=e.i(637235),tJ=e.i(755151),tU=e.i(240647);let{Text:tW}=d.Typography,tV=function({results:e,errors:t}){let[a,r]=(0,m.useState)(new Set),i=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),r(t)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return e||t?(0,l.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),e&&e.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-green-50 border-green-200",children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>i(e.guardrailName),children:[t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"}),(0,l.jsx)(tk.CheckCircleOutlined,{className:"text-green-600 text-lg"}),(0,l.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tq.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!t&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tH.CopyOutlined,onClick:async()=>{await s(e.response_text)?u.default.success("Result copied to clipboard"):u.default.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,l.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,l.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,l.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,l.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),t&&t.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-red-50 border-red-200",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>i(e.guardrailName),children:t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"})}),(0,l.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,l.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>i(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tq.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!t&&(0,l.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null},{TextArea:tY}=i.Input,{Text:tQ}=d.Typography,tZ=function({guardrailNames:e,onSubmit:t,isLoading:a,results:r,errors:i,onClose:s}){let[n,o]=(0,m.useState)(""),d=()=>{n.trim()?t(n):u.default.fromBackend("Please enter text to test")},c=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},p=async()=>{await c(n)?u.default.success("Input copied to clipboard"):u.default.fromBackend("Failed to copy input")};return(0,l.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,l.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,l.jsx)("div",{className:"flex items-center space-x-3",children:(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,l.jsx)("div",{className:"inline-flex items-center space-x-1 bg-blue-50 px-3 py-1 rounded-md border border-blue-200",children:(0,l.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",e.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,l.jsx)(ej.Tooltip,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,l.jsx)(eD.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),n&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tH.CopyOutlined,onClick:p,children:"Copy Input"})]}),(0,l.jsx)(tY,{value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),d())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,l.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Press ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Shift+Enter"})," for new line"]}),(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Characters: ",n.length]})]})]}),(0,l.jsx)("div",{className:"pt-2",children:(0,l.jsx)(e4.Button,{onClick:d,loading:a,disabled:!n.trim(),className:"w-full",children:a?`Testing ${e.length} guardrail${e.length>1?"s":""}...`:`Test ${e.length} guardrail${e.length>1?"s":""}`})})]}),(0,l.jsx)(tV,{results:r,errors:i})]})]})};e.s(["default",0,({guardrailsList:e,isLoading:t,accessToken:a,onClose:r})=>{let[s,n]=(0,m.useState)(new Set),[o,c]=(0,m.useState)(""),[g,x]=(0,m.useState)([]),[f,y]=(0,m.useState)([]),[j,_]=(0,m.useState)(!1),b=e.filter(e=>e.guardrail_name?.toLowerCase().includes(o.toLowerCase())),v=async e=>{if(0===s.size||!a)return;_(!0),x([]),y([]);let t=[],l=[];await Promise.all(Array.from(s).map(async r=>{let i=Date.now();try{let l=await (0,p.applyGuardrail)(a,r,e,null,null),s=Date.now()-i;t.push({guardrailName:r,response_text:l.response_text,latency:s})}catch(t){let e=Date.now()-i;console.error(`Error testing guardrail ${r}:`,t),l.push({guardrailName:r,error:t,latency:e})}})),x(t),y(l),_(!1),t.length>0&&u.default.success(`${t.length} guardrail${t.length>1?"s":""} applied successfully`),l.length>0&&u.default.fromBackend(`${l.length} guardrail${l.length>1?"s":""} failed`)};return(0,l.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,l.jsx)(h.Card,{className:"h-full",styles:{body:{padding:0,height:"100%"}},children:(0,l.jsxs)("div",{className:"flex h-full",children:[(0,l.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,l.jsx)(i.Input,{prefix:(0,l.jsx)(tK.SearchOutlined,{}),placeholder:"Search guardrails...",value:o,onChange:e=>c(e.target.value)})]})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto",children:t?(0,l.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,l.jsx)(eh.Spin,{})}):0===b.length?(0,l.jsx)("div",{className:"p-4",children:(0,l.jsx)(ez.Empty,{description:o?"No guardrails match your search":"No guardrails available"})}):(0,l.jsx)(tz.List,{dataSource:b,renderItem:e=>(0,l.jsx)(tz.List.Item,{onClick:()=>{var t;let a;e.guardrail_name&&(t=e.guardrail_name,(a=new Set(s)).has(t)?a.delete(t):a.add(t),n(a))},style:{paddingLeft:24,paddingRight:16},className:`cursor-pointer hover:bg-gray-50 transition-colors ${s.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"}`,children:(0,l.jsx)(tz.List.Item.Meta,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(tD.ExperimentOutlined,{className:"text-gray-400"}),(0,l.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,l.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Type: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,l.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,l.jsxs)(d.Typography.Text,{className:"text-xs text-gray-600",children:[s.size," of ",b.length," selected"]})})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(d.Typography.Title,{level:2,className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===s.size?(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(tD.ExperimentOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-center text-gray-500 max-w-md",children:"Choose one or more guardrails from the left sidebar to start testing and comparing results."})]}):(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(tZ,{guardrailNames:Array.from(s),onSubmit:v,results:g.length>0?g:null,errors:f.length>0?f:null,isLoading:j,onClose:()=>n(new Set)})})})]})]})})})}],476993),e.s([],824296),e.s(["CustomCodeModal",0,tG],64352);let tX="../ui/assets/logos/",t0=[{id:"cf_denied_financial",name:"Denied Financial Advice",description:"Detects requests for personalized financial advice, investment recommendations, or financial planning.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:207,latency:"<0.1ms"}},{id:"cf_denied_insults",name:"Insults & Personal Attacks",description:"Detects insults, name-calling, and personal attacks directed at the chatbot, staff, or other people.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:299,latency:"<0.1ms"}},{id:"cf_denied_legal",name:"Denied Legal Advice",description:"Detects requests for unauthorized legal advice, case analysis, or legal recommendations.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_denied_medical",name:"Denied Medical Advice",description:"Detects requests for medical diagnosis, treatment recommendations, or health advice.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_harmful_violence",name:"Harmful Violence",description:"Detects content related to violence, criminal planning, attacks, and violent threats.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_self_harm",name:"Harmful Self-Harm",description:"Detects content related to self-harm, suicide, and dangerous self-destructive behavior.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_child_safety",name:"Harmful Child Safety",description:"Detects content that could endanger child safety or exploit minors.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_illegal_weapons",name:"Harmful Illegal Weapons",description:"Detects content related to illegal weapons manufacturing, distribution, or acquisition.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_bias_gender",name:"Bias: Gender",description:"Detects gender-based discrimination, stereotypes, and biased language.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_racial",name:"Bias: Racial",description:"Detects racial discrimination, stereotypes, and racially biased content.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_religious",name:"Bias: Religious",description:"Detects religious discrimination, intolerance, and religiously biased content.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_sexual_orientation",name:"Bias: Sexual Orientation",description:"Detects discrimination based on sexual orientation and related biased content.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_prompt_injection_jailbreak",name:"Prompt Injection: Jailbreak",description:"Detects jailbreak attempts designed to bypass AI safety guidelines and restrictions.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_data_exfil",name:"Prompt Injection: Data Exfiltration",description:"Detects attempts to extract sensitive data through prompt manipulation.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_sql",name:"Prompt Injection: SQL",description:"Detects SQL injection attempts embedded in prompts.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_malicious_code",name:"Prompt Injection: Malicious Code",description:"Detects attempts to inject malicious code through prompts.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_system_prompt",name:"Prompt Injection: System Prompt",description:"Detects attempts to extract or override system prompts.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_toxic_abuse",name:"Toxic & Abusive Language",description:"Detects toxic, abusive, and hateful language across multiple languages (EN, AU, DE, ES, FR).",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Toxicity"]},{id:"cf_patterns",name:"Pattern Matching",description:"Detect and block sensitive data patterns like SSNs, credit card numbers, API keys, and custom regex patterns.",category:"litellm",subcategory:"Patterns",logo:`${tX}litellm_logo.jpg`,tags:["PII","Regex","Data Protection"]},{id:"cf_keywords",name:"Keyword Blocking",description:"Block or mask content containing specific keywords or phrases. Upload custom word lists or add individual terms.",category:"litellm",subcategory:"Keywords",logo:`${tX}litellm_logo.jpg`,tags:["Keywords","Blocklist"]},{id:"block_code_execution",name:"Block Code Execution",description:"Detects markdown fenced code blocks in requests and responses. Block or mask executable code (e.g. Python, JavaScript, Bash) by language with configurable confidence.",category:"litellm",subcategory:"Code Safety",logo:`${tX}litellm_logo.jpg`,tags:["Code","Safety","Prompt Injection"]},{id:"cf_competitor_intent",name:"Competitor Name Blocking",description:"Block or reframe competitor comparison and ranking intent. Detect when users ask to compare or recommend competitors (airline or generic competitor lists).",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Competitor","Topic Blocker"]},{id:"presidio",name:"Presidio PII",description:"Microsoft Presidio for PII detection and anonymization. Supports 30+ entity types with configurable actions.",category:"partner",logo:`${tX}microsoft_azure.svg`,tags:["PII","Microsoft"],providerKey:"PresidioPII"},{id:"bedrock",name:"Bedrock Guardrail",description:"AWS Bedrock Guardrails for content filtering, topic avoidance, and sensitive information detection.",category:"partner",logo:`${tX}bedrock.svg`,tags:["AWS","Content Safety"],providerKey:"Bedrock"},{id:"lakera",name:"Lakera",description:"AI security platform protecting against prompt injections, data leakage, and harmful content.",category:"partner",logo:`${tX}lakeraai.jpeg`,tags:["Security","Prompt Injection"],providerKey:"Lakera"},{id:"openai_moderation",name:"OpenAI Moderation",description:"OpenAI's content moderation API for detecting harmful content across multiple categories.",category:"partner",logo:`${tX}openai_small.svg`,tags:["Content Moderation","OpenAI"]},{id:"google_model_armor",name:"Google Cloud Model Armor",description:"Google Cloud's model protection service for safe and responsible AI deployments.",category:"partner",logo:`${tX}google.svg`,tags:["Google Cloud","Safety"]},{id:"guardrails_ai",name:"Guardrails AI",description:"Open-source framework for adding structural, type, and quality guarantees to LLM outputs.",category:"partner",logo:`${tX}guardrails_ai.jpeg`,tags:["Open Source","Validation"]},{id:"zscaler",name:"Zscaler AI Guard",description:"Enterprise AI security from Zscaler for monitoring and protecting AI/ML workloads.",category:"partner",logo:`${tX}zscaler.svg`,tags:["Enterprise","Security"]},{id:"panw",name:"PANW Prisma AIRS",description:"Palo Alto Networks Prisma AI Runtime Security for securing AI applications in production.",category:"partner",logo:`${tX}palo_alto_networks.jpeg`,tags:["Enterprise","Security"]},{id:"noma",name:"Noma Security",description:"AI security platform for detecting and preventing AI-specific threats and vulnerabilities.",category:"partner",logo:`${tX}noma_security.png`,tags:["Security","Threat Detection"]},{id:"aporia",name:"Aporia AI",description:"Real-time AI guardrails for hallucination detection, topic control, and policy enforcement.",category:"partner",logo:`${tX}aporia.png`,tags:["Hallucination","Policy"]},{id:"aim",name:"AIM Guardrail",description:"AIM Security guardrails for comprehensive AI threat detection and mitigation.",category:"partner",logo:`${tX}aim_security.jpeg`,tags:["Security","Threat Detection"]},{id:"prompt_security",name:"Prompt Security",description:"Protect against prompt injection attacks, data leakage, and other LLM security threats.",category:"partner",logo:`${tX}prompt_security.png`,tags:["Prompt Injection","Security"]},{id:"lasso",name:"Lasso Guardrail",description:"Content moderation and safety guardrails for responsible AI deployments.",category:"partner",logo:`${tX}lasso.png`,tags:["Content Moderation"]},{id:"pangea",name:"Pangea Guardrail",description:"Pangea's AI guardrails for secure, compliant, and trustworthy AI applications.",category:"partner",logo:`${tX}pangea.png`,tags:["Compliance","Security"]},{id:"enkryptai",name:"EnkryptAI",description:"AI security and governance platform for enterprise AI safety and compliance.",category:"partner",logo:`${tX}enkrypt_ai.avif`,tags:["Enterprise","Governance"]},{id:"javelin",name:"Javelin Guardrails",description:"AI gateway with built-in guardrails for secure and compliant AI operations.",category:"partner",logo:`${tX}javelin.png`,tags:["Gateway","Security"]},{id:"pillar",name:"Pillar Guardrail",description:"AI safety platform for monitoring, testing, and securing AI systems.",category:"partner",logo:`${tX}pillar.jpeg`,tags:["Monitoring","Safety"]},{id:"akto",name:"Akto Guardrail",description:"AI security platform from Akto.io with automatic monitoring and guardrails for AI/ML applications.",category:"partner",logo:`${tX}akto.svg`,tags:["Security","Safety","Monitoring"]},{id:"promptguard",name:"PromptGuard",description:"AI security gateway with prompt injection detection, PII redaction, topic filtering, entity blocklists, and hallucination detection. Self-hostable with drop-in proxy integration.",category:"partner",logo:`${tX}promptguard.svg`,tags:["Security","Prompt Injection","PII"],providerKey:"Promptguard",eval:{f1:94.9,precision:100,recall:90.4,testCases:5384,latency:"~150ms"}}];e.s(["ALL_CARDS",0,t0],230312)},826910,e=>{"use strict";var t=e.i(201072);e.s(["CheckCircleFilled",()=>t.default])},487304,168118,e=>{"use strict";var t=e.i(843476),a=e.i(271645),l=e.i(464571),r=e.i(326373),i=e.i(653496),s=e.i(755151),n=e.i(646563),o=e.i(245094),d=e.i(764205),c=e.i(185357),m=e.i(782719),u=e.i(708347),p=e.i(969641),g=e.i(476993),x=e.i(727749),h=e.i(127952),f=e.i(180766);e.i(824296);var y=e.i(64352),j=e.i(311451),_=e.i(928685),b=e.i(266537),v=e.i(230312),w=e.i(826910);let N=({src:e,name:l})=>{let[r,i]=(0,a.useState)(!1);return r||!e?(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:6,backgroundColor:"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:600,color:"#6b7280",flexShrink:0},children:l?.charAt(0)||"?"}):(0,t.jsx)("img",{src:e,alt:"",style:{width:28,height:28,borderRadius:6,objectFit:"contain",flexShrink:0},onError:()=>i(!0)})},C=({card:e,onClick:l})=>{let[r,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{onClick:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,border:r?"1px solid #93c5fd":"1px solid #e5e7eb",backgroundColor:"#ffffff",padding:"20px 20px 16px 20px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",display:"flex",flexDirection:"column",minHeight:170,boxShadow:r?"0 1px 6px rgba(59,130,246,0.08)":"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[(0,t.jsx)(N,{src:e.logo,name:e.name}),(0,t.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"#111827",lineHeight:1.3},children:e.name})]}),(0,t.jsx)("p",{className:"line-clamp-3",style:{fontSize:12,color:"#6b7280",lineHeight:1.6,margin:0,flex:1},children:e.description}),e.eval&&(0,t.jsxs)("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)(w.CheckCircleFilled,{style:{color:"#16a34a",fontSize:12}}),(0,t.jsxs)("span",{style:{fontSize:11,color:"#16a34a",fontWeight:500},children:["F1: ",e.eval.f1,"% · ",e.eval.testCases," test cases"]})]})]})};var S=e.i(447566);let k={cf_denied_financial:{provider:"LitellmContentFilter",categoryName:"denied_financial_advice",guardrailNameSuggestion:"Denied Financial Advice",mode:"pre_call",defaultOn:!1},cf_denied_legal:{provider:"LitellmContentFilter",categoryName:"denied_legal_advice",guardrailNameSuggestion:"Denied Legal Advice",mode:"pre_call",defaultOn:!1},cf_denied_medical:{provider:"LitellmContentFilter",categoryName:"denied_medical_advice",guardrailNameSuggestion:"Denied Medical Advice",mode:"pre_call",defaultOn:!1},cf_denied_insults:{provider:"LitellmContentFilter",categoryName:"denied_insults",guardrailNameSuggestion:"Insults & Personal Attacks",mode:"pre_call",defaultOn:!1},cf_harmful_violence:{provider:"LitellmContentFilter",categoryName:"harmful_violence",guardrailNameSuggestion:"Harmful Violence",mode:"pre_call",defaultOn:!1},cf_harmful_self_harm:{provider:"LitellmContentFilter",categoryName:"harmful_self_harm",guardrailNameSuggestion:"Harmful Self-Harm",mode:"pre_call",defaultOn:!1},cf_harmful_child_safety:{provider:"LitellmContentFilter",categoryName:"harmful_child_safety",guardrailNameSuggestion:"Harmful Child Safety",mode:"pre_call",defaultOn:!1},cf_harmful_illegal_weapons:{provider:"LitellmContentFilter",categoryName:"harmful_illegal_weapons",guardrailNameSuggestion:"Harmful Illegal Weapons",mode:"pre_call",defaultOn:!1},cf_bias_gender:{provider:"LitellmContentFilter",categoryName:"bias_gender",guardrailNameSuggestion:"Bias: Gender",mode:"pre_call",defaultOn:!1},cf_bias_racial:{provider:"LitellmContentFilter",categoryName:"bias_racial",guardrailNameSuggestion:"Bias: Racial",mode:"pre_call",defaultOn:!1},cf_bias_religious:{provider:"LitellmContentFilter",categoryName:"bias_religious",guardrailNameSuggestion:"Bias: Religious",mode:"pre_call",defaultOn:!1},cf_bias_sexual_orientation:{provider:"LitellmContentFilter",categoryName:"bias_sexual_orientation",guardrailNameSuggestion:"Bias: Sexual Orientation",mode:"pre_call",defaultOn:!1},cf_prompt_injection_jailbreak:{provider:"LitellmContentFilter",categoryName:"prompt_injection_jailbreak",guardrailNameSuggestion:"Prompt Injection: Jailbreak",mode:"pre_call",defaultOn:!1},cf_prompt_injection_data_exfil:{provider:"LitellmContentFilter",categoryName:"prompt_injection_data_exfiltration",guardrailNameSuggestion:"Prompt Injection: Data Exfiltration",mode:"pre_call",defaultOn:!1},cf_prompt_injection_sql:{provider:"LitellmContentFilter",categoryName:"prompt_injection_sql",guardrailNameSuggestion:"Prompt Injection: SQL",mode:"pre_call",defaultOn:!1},cf_prompt_injection_malicious_code:{provider:"LitellmContentFilter",categoryName:"prompt_injection_malicious_code",guardrailNameSuggestion:"Prompt Injection: Malicious Code",mode:"pre_call",defaultOn:!1},cf_prompt_injection_system_prompt:{provider:"LitellmContentFilter",categoryName:"prompt_injection_system_prompt",guardrailNameSuggestion:"Prompt Injection: System Prompt",mode:"pre_call",defaultOn:!1},cf_toxic_abuse:{provider:"LitellmContentFilter",categoryName:"harm_toxic_abuse",guardrailNameSuggestion:"Toxic & Abusive Language",mode:"pre_call",defaultOn:!1},cf_patterns:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Pattern Matching",mode:"pre_call",defaultOn:!1},cf_keywords:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Keyword Blocking",mode:"pre_call",defaultOn:!1},block_code_execution:{provider:"BlockCodeExecution",guardrailNameSuggestion:"Block Code Execution",mode:"pre_call",defaultOn:!1},cf_competitor_intent:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Competitor Name Blocking",mode:"pre_call",defaultOn:!1},presidio:{provider:"PresidioPII",guardrailNameSuggestion:"Presidio PII",mode:"pre_call",defaultOn:!1},bedrock:{provider:"Bedrock",guardrailNameSuggestion:"Bedrock Guardrail",mode:"pre_call",defaultOn:!1},lakera:{provider:"Lakera",guardrailNameSuggestion:"Lakera",mode:"pre_call",defaultOn:!1},openai_moderation:{provider:"OpenaiModeration",guardrailNameSuggestion:"OpenAI Moderation",mode:"pre_call",defaultOn:!1},google_model_armor:{provider:"ModelArmor",guardrailNameSuggestion:"Google Cloud Model Armor",mode:"pre_call",defaultOn:!1},guardrails_ai:{provider:"GuardrailsAi",guardrailNameSuggestion:"Guardrails AI",mode:"pre_call",defaultOn:!1},zscaler:{provider:"ZscalerAiGuard",guardrailNameSuggestion:"Zscaler AI Guard",mode:"pre_call",defaultOn:!1},panw:{provider:"PanwPrismaAirs",guardrailNameSuggestion:"PANW Prisma AIRS",mode:"pre_call",defaultOn:!1},noma:{provider:"Noma",guardrailNameSuggestion:"Noma Security",mode:"pre_call",defaultOn:!1},aporia:{provider:"AporiaAi",guardrailNameSuggestion:"Aporia AI",mode:"pre_call",defaultOn:!1},aim:{provider:"Aim",guardrailNameSuggestion:"AIM Guardrail",mode:"pre_call",defaultOn:!1},prompt_security:{provider:"PromptSecurity",guardrailNameSuggestion:"Prompt Security",mode:"pre_call",defaultOn:!1},lasso:{provider:"Lasso",guardrailNameSuggestion:"Lasso Guardrail",mode:"pre_call",defaultOn:!1},pangea:{provider:"Pangea",guardrailNameSuggestion:"Pangea Guardrail",mode:"pre_call",defaultOn:!1},enkryptai:{provider:"Enkryptai",guardrailNameSuggestion:"EnkryptAI",mode:"pre_call",defaultOn:!1},javelin:{provider:"Javelin",guardrailNameSuggestion:"Javelin Guardrails",mode:"pre_call",defaultOn:!1},pillar:{provider:"Pillar",guardrailNameSuggestion:"Pillar Guardrail",mode:"pre_call",defaultOn:!1},akto:{provider:"Akto",guardrailNameSuggestion:"Akto Guardrail",mode:"pre_call",defaultOn:!1},promptguard:{provider:"Promptguard",guardrailNameSuggestion:"PromptGuard",mode:"pre_call",defaultOn:!1}},I=({card:e,onBack:r,accessToken:i,onGuardrailCreated:s})=>{let[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)("overview"),u=[{property:"Provider",value:"litellm"===e.category?"LiteLLM Content Filter":"Partner Guardrail"},...e.subcategory?[{property:"Subcategory",value:e.subcategory}]:[],..."litellm"===e.category?[{property:"Cost",value:"$0 / request"}]:[],..."litellm"===e.category?[{property:"External Dependencies",value:"None"}]:[],..."litellm"===e.category?[{property:"Latency",value:e.eval?.latency||"<1ms"}]:[]],p=e.eval?[{metric:"Precision",value:`${e.eval.precision}%`},{metric:"Recall",value:`${e.eval.recall}%`},{metric:"F1 Score",value:`${e.eval.f1}%`},{metric:"Test Cases",value:String(e.eval.testCases)},{metric:"False Positives",value:"0"},{metric:"False Negatives",value:"0"},{metric:"Latency (p50)",value:e.eval.latency}]:[],g=[{key:"overview",label:"Overview"},...e.eval?[{key:"eval",label:"Eval Results"}]:[]];return(0,t.jsxs)("div",{style:{maxWidth:960,margin:"0 auto"},children:[(0,t.jsxs)("div",{onClick:r,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(S.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:e.name})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:8},children:[(0,t.jsx)("img",{src:e.logo,alt:"",style:{width:40,height:40,borderRadius:8,objectFit:"contain"},onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name})]}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 20px 0",lineHeight:1.6},children:e.description}),(0,t.jsx)("div",{style:{display:"flex",gap:10,marginBottom:32},children:(0,t.jsx)(l.Button,{onClick:()=>o(!0),style:{borderRadius:20,padding:"4px 20px",height:36,borderColor:"#dadce0",color:"#1a73e8",fontWeight:500,fontSize:14},children:"Create Guardrail"})}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:g.map(e=>(0,t.jsx)("div",{onClick:()=>m(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 12px 0"},children:"Overview"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#3c4043",lineHeight:1.7,margin:"0 0 32px 0"},children:e.description}),(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Guardrail Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Details are as follows"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:200},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:u.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},a))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Guardrail ID"}),(0,t.jsxs)("div",{style:{fontSize:13,color:"#202124",wordBreak:"break-all"},children:["litellm/",e.id]})]}),(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Type"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#202124"},children:"litellm"===e.category?"Content Filter":"Partner"})]}),e.tags.length>0&&(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.tags.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]})]})]}),"eval"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 16px 0"},children:"Eval Results"}),(0,t.jsxs)("table",{style:{width:"100%",maxWidth:560,borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Metric"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Value"})]})}),(0,t.jsx)("tbody",{children:p.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#3c4043"},children:e.metric}),(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#202124",fontWeight:500},children:e.value})]},a))})]})]}),(0,t.jsx)(c.default,{visible:n,onClose:()=>o(!1),accessToken:i,onSuccess:()=>{o(!1),s()},preset:k[e.id]})]})},A=({accessToken:e,onGuardrailCreated:l})=>{let[r,i]=(0,a.useState)(""),[s,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),c=v.ALL_CARDS.filter(e=>{if(!r)return!0;let t=r.toLowerCase();return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))}),m=c.filter(e=>"litellm"===e.category),u=c.filter(e=>"partner"===e.category);return s?(0,t.jsx)(I,{card:s,onBack:()=>n(null),accessToken:e,onGuardrailCreated:l}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{marginBottom:24},children:(0,t.jsx)(j.Input,{size:"large",placeholder:"Search guardrails",prefix:(0,t.jsx)(_.SearchOutlined,{style:{color:"#9ca3af"}}),value:r,onChange:e=>i(e.target.value),style:{borderRadius:8}})}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:0},children:"LiteLLM Content Filter"}),(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:14,color:"#1a73e8",cursor:"pointer"},onClick:()=>d(!o),children:o?(0,t.jsx)(t.Fragment,{children:"Show less"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.ArrowRightOutlined,{style:{fontSize:12}}),`Show all (${m.length})`]})})]}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Built-in guardrails powered by LiteLLM. Zero latency, no external dependencies, no additional cost."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:(o?m:m.slice(0,10)).map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:"0 0 4px 0"},children:"Partner Guardrails"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Third-party guardrail integrations from leading AI security providers."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:u.map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]})]})};var O=e.i(988846),T=e.i(837007),P=e.i(409797),L=e.i(54131),B=e.i(995926),F=e.i(678784),$=e.i(634831),E=e.i(438100),M=e.i(302202),R=e.i(328196),G=e.i(879664);e.s(["InfoIcon",()=>G.default],168118);var G=G,z=e.i(212931),D=e.i(808613),K=e.i(199133),H=e.i(663435),q=e.i(954616),J=e.i(912598),U=e.i(135214),W=e.i(243652);let V=async(e,t)=>{let a=(0,d.getProxyBaseUrl)(),l=`${a}/guardrails/register`,r=await fetch(l,{method:"POST",headers:{[(0,d.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.json().catch(()=>({})),t=(0,d.deriveErrorMessage)(e);throw(0,d.handleError)(t),Error(t)}return r.json()},Y=(0,W.createQueryKeys)("guardrails");function Q(e){var t;let a=e.litellm_params??{},l=e.guardrail_info??{},r=a.headers,i=Array.isArray(r)?r.map(e=>({key:(e.key??e.name??"").toString(),value:String(e.value??"")})):"object"==typeof r&&null!==r?Object.entries(r).map(([e,t])=>({key:e,value:String(t??"")})):[],s=a.api_base??a.url??"",n=l.model??a.model??"—",o=a.forward_api_key??!0,d=Array.isArray(a.extra_headers)?a.extra_headers.filter(e=>"string"==typeof e):[];return{id:e.guardrail_id,team:e.team_id??"—",name:e.guardrail_name,endpoint:s,status:"pending_review"===(t=e.status)?"pending":"active"===t||"rejected"===t?t:"active",model:n,forwardKey:o,description:l.description??"",method:a.method??"POST",customHeaders:i,extraHeaders:d,submittedAt:function(e){if(!e)return"—";try{let t=new Date(e);return isNaN(t.getTime())?e:t.toISOString().slice(0,10)}catch{return e}}(e.submitted_at),submittedBy:e.submitted_by_email??e.submitted_by_user_id??"—",mode:a.mode,unreachable_fallback:a.unreachable_fallback,additionalProviderParams:a.additional_provider_specific_params,guardrailType:a.guardrail}}let Z={active:{label:"Active",bg:"bg-green-50",text:"text-green-700",dot:"bg-green-500"},pending:{label:"Pending Review",bg:"bg-yellow-50",text:"text-yellow-700",dot:"bg-yellow-500"},rejected:{label:"Rejected",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"}},X={"ML Platform":"bg-purple-100 text-purple-700","Data Science":"bg-blue-100 text-blue-700",Security:"bg-red-100 text-red-700","Customer Success":"bg-orange-100 text-orange-700",Legal:"bg-gray-100 text-gray-700",Finance:"bg-green-100 text-green-700"};function ee({label:e,value:a,color:l}){return(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg px-4 py-3",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${l}`,children:a}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e})]})}function et({enabled:e,onToggle:a}){return(0,t.jsx)("button",{type:"button",onClick:a,role:"switch","aria-checked":e,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${e?"bg-blue-500":"bg-gray-200"}`,children:(0,t.jsx)("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ${e?"translate-x-4":"translate-x-0.5"}`})})}function ea({guardrail:e,isSelected:a,isHeadersExpanded:l,onSelect:r,onToggleForwardKey:i,onToggleHeaders:s,onApprove:n,onReject:o}){let d=Z[e.status],c=X[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsxs)("div",{className:`bg-white border rounded-lg p-4 transition-all ${a?"border-blue-400 ring-1 ring-blue-200":"border-gray-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${c}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${d.bg} ${d.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${d.dot}`}),d.label]})]}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-2 line-clamp-1",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(M.ServerIcon,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-gray-500 font-mono truncate",children:e.endpoint})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-gray-500",children:[(0,t.jsxs)("span",{children:["Model: ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.model})]}),(0,t.jsxs)("span",{children:["Submitted:"," ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.submittedAt})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:"Forward API Key"}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:i})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs border border-gray-300 text-gray-600 hover:bg-gray-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:a?"Close":"Review"}),"pending"===e.status&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:n,className:"text-xs bg-green-500 hover:bg-green-600 text-white px-3 py-1.5 rounded-md transition-colors font-medium",children:"Approve"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"text-xs border border-red-300 text-red-600 hover:bg-red-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:"Reject"})]})]})]})]}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[(0,t.jsxs)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-700 transition-colors",children:[l?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5"}):(0,t.jsx)(P.ChevronDownIcon,{className:"h-3.5 w-3.5"}),"Static headers",e.customHeaders.length>0&&(0,t.jsx)("span",{className:"ml-1 bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),l&&(0,t.jsx)("div",{className:"mt-2",children:0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic",children:"No static headers configured."}):(0,t.jsx)("div",{className:"space-y-1",children:e.customHeaders.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-mono",children:[(0,t.jsx)("span",{className:"text-gray-500 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.key}),(0,t.jsx)("span",{className:"text-gray-400",children:":"}),(0,t.jsx)("span",{className:"text-gray-700 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.value})]},`${e.key}-${a}`))})})]})]})}function el({label:e,children:a}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),(0,t.jsx)("div",{children:a})]})}function er({guardrail:e,onClose:l,onApprove:r,onReject:i,onToggleForwardKey:s,onUpdateCustomHeaders:n,onUpdateExtraHeaders:o}){let[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[p,g]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),f=Z[e.status],y=X[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsx)("div",{className:"w-96 flex-shrink-0 bg-white overflow-auto",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${y}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${f.bg} ${f.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${f.dot}`}),f.label]})]}),(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["Submitted by ",e.submittedBy," on ",e.submittedAt]})]}),(0,t.jsx)("button",{type:"button",onClick:l,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close detail panel",children:(0,t.jsx)(B.XIcon,{className:"h-4 w-4"})})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-5",children:e.description}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(el,{label:"Endpoint",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"text-xs font-mono text-gray-700 break-all",children:e.endpoint}),(0,t.jsx)("a",{href:e.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-blue-500 flex-shrink-0",children:(0,t.jsx)($.ExternalLinkIcon,{className:"h-3.5 w-3.5"})})]})}),(0,t.jsx)(el,{label:"Method",children:(0,t.jsx)("span",{className:"text-xs font-mono font-medium text-gray-700 bg-gray-100 px-2 py-0.5 rounded",children:e.method})}),(0,t.jsxs)("div",{className:"border border-blue-100 bg-blue-50 rounded-lg p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(E.KeyIcon,{className:"h-3.5 w-3.5 text-blue-500"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-blue-800",children:"Forward LiteLLM API Key"})]}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:s})]}),(0,t.jsxs)("p",{className:"text-xs text-blue-700 leading-relaxed",children:["When enabled, the caller's LiteLLM API key is forwarded as an"," ",(0,t.jsx)("code",{className:"font-mono bg-blue-100 px-1 rounded",children:"Authorization"})," ","header to your guardrail endpoint. This allows your guardrail to authenticate model calls using the original caller's credentials."]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Static headers"}),e.customHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Sent with every request to the guardrail."}),0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No static headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.customHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsxs)("span",{className:"text-gray-700 truncate",children:[a.key,": ",a.value]}),(0,t.jsx)("button",{type:"button",onClick:()=>n(e.customHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a.key}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a.key}-${l}`))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:"Header name (e.g. X-API-Key)",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"Value",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=p.trim(),a=x.trim();t&&!e.customHeaders.some(e=>e.key.toLowerCase()===t.toLowerCase())&&(n([...e.customHeaders,{key:t,value:a}]),g(""),h(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors flex-shrink-0",children:"Add"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Forward client headers"}),e.extraHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.extraHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Allowed header names to forward from the client request to the guardrail (e.g. x-request-id)."}),0===e.extraHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No forward client headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.extraHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-gray-700 truncate",children:a}),(0,t.jsx)("button",{type:"button",onClick:()=>o(e.extraHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a}-${l}`))}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"e.g. x-request-id",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=m.trim().toLowerCase();a&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(a)&&(o([...e.extraHeaders,a]),u(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=m.trim().toLowerCase();t&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(t)&&(o([...e.extraHeaders,t]),u(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors",children:"Add"})]})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(!d),className:"w-full flex items-center justify-between px-3 py-2 text-left text-xs font-semibold text-gray-700 bg-gray-50 hover:bg-gray-100 transition-colors",children:[(0,t.jsx)("span",{children:"Equivalent config"}),d?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5 text-gray-500"}):(0,t.jsx)(P.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-500"})]}),d&&(0,t.jsx)("pre",{className:"p-3 text-xs font-mono text-gray-700 bg-white border-t border-gray-200 overflow-x-auto whitespace-pre-wrap break-all",children:function(e){let t=["litellm_settings:"," guardrails:",` - guardrail_name: "${e.name.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`," litellm_params:",` guardrail: ${e.guardrailType??"generic_guardrail_api"}`,` mode: ${e.mode??"pre_call"} # or post_call, during_call`,` api_base: ${e.endpoint||"https://your-guardrail-api.com"}`," api_key: os.environ/YOUR_GUARDRAIL_API_KEY # optional",` unreachable_fallback: ${e.unreachable_fallback??"fail_closed"} # default: fail_closed. Set to fail_open to proceed if the guardrail endpoint is unreachable.`,` forward_api_key: ${e.forwardKey}`];if(e.model&&"—"!==e.model&&t.push(` model: "${e.model}" # LLM model name sent to the guardrail for context`),e.customHeaders.length>0)for(let a of(t.push(" headers: # static headers (sent with every request)"),e.customHeaders))t.push(` ${a.key}: "${String(a.value).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`);if(e.extraHeaders.length>0)for(let a of(t.push(" extra_headers: # forward these client request headers to the guardrail"),e.extraHeaders))t.push(` - ${a}`);if(e.additionalProviderParams&&Object.keys(e.additionalProviderParams).length>0)for(let[a,l]of(t.push(" additional_provider_specific_params:"),Object.entries(e.additionalProviderParams))){let e="string"==typeof l?`"${l}"`:String(l);t.push(` ${a}: ${e}`)}return t.join("\n")}(e)})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,t.jsx)(G.default,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 mt-0.5"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 leading-relaxed",children:["This guardrail runs on a separate instance. It receives the user request and forwards the result to the next step in the pipeline. See"," ",(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/adding_provider/generic_guardrail_api",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:"LiteLLM Generic Guardrail API docs"})," ","for configuration details."]})]})]}),(0,t.jsxs)("div",{className:"mt-5 pt-4 border-t border-gray-100 space-y-2",children:[(0,t.jsxs)("button",{type:"button",className:"w-full flex items-center justify-center gap-2 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)($.ExternalLinkIcon,{className:"h-4 w-4"}),"Test Endpoint"]}),"pending"===e.status&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:r,className:"flex-1 flex items-center justify-center gap-1.5 bg-green-500 hover:bg-green-600 text-white text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(F.CheckIcon,{className:"h-4 w-4"}),"Approve"]}),(0,t.jsxs)("button",{type:"button",onClick:i,className:"flex-1 flex items-center justify-center gap-1.5 border border-red-300 text-red-600 hover:bg-red-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(B.XIcon,{className:"h-4 w-4"}),"Reject"]})]})]})]})})}function ei({action:e,guardrailName:a,onConfirm:l,onCancel:r}){let i="approve"===e;return(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-50",children:(0,t.jsxs)("div",{className:"bg-white rounded-xl shadow-xl p-6 max-w-sm w-full mx-4",children:[(0,t.jsx)("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mb-4 ${i?"bg-green-100":"bg-red-100"}`,children:i?(0,t.jsx)(F.CheckIcon,{className:"h-5 w-5 text-green-600"}):(0,t.jsx)(R.AlertCircleIcon,{className:"h-5 w-5 text-red-600"})}),(0,t.jsx)("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:i?"Approve Guardrail":"Reject Guardrail"}),(0,t.jsxs)("p",{className:"text-sm text-gray-500 mb-5",children:["Are you sure you want to ",e," ",(0,t.jsxs)("span",{className:"font-medium text-gray-700",children:['"',a,'"']}),"?"," ",i?"This will make it active and available for use.":"This will mark it as rejected and notify the team."]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"flex-1 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:l,className:`flex-1 text-white text-sm font-medium py-2 rounded-md transition-colors ${i?"bg-green-500 hover:bg-green-600":"bg-red-500 hover:bg-red-600"}`,children:i?"Approve":"Reject"})]})]})})}function es({accessToken:e}){let[l,r]=(0,a.useState)([]),[i,s]=(0,a.useState)({total:0,pending_review:0,active:0,rejected:0}),[n,o]=(0,a.useState)(""),[c,m]=(0,a.useState)("all"),[u,p]=(0,a.useState)(null),[g,h]=(0,a.useState)(new Set),[f,y]=(0,a.useState)(null),[_,b]=(0,a.useState)(!0),[v,w]=(0,a.useState)(null),[N,C]=(0,a.useState)(""),[S,k]=(0,a.useState)(!1),[I]=D.Form.useForm(),A=(()=>{let{accessToken:e}=(0,U.default)(),t=(0,J.useQueryClient)();return(0,q.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return V(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Y.all})}})})();(0,a.useEffect)(()=>{let e=setTimeout(()=>C(n),300);return()=>clearTimeout(e)},[n]);let P=(0,a.useCallback)(async()=>{if(!e)return void b(!1);b(!0),w(null);try{let t="all"===c?void 0:"pending"===c?"pending_review":c,a=await (0,d.listGuardrailSubmissions)(e,{status:t,search:N.trim()||void 0});r(a.submissions.map(Q)),s(a.summary)}catch(e){w(e instanceof Error?e.message:"Failed to load submissions"),r([])}finally{b(!1)}},[e,c,N]);(0,a.useEffect)(()=>{P()},[P]);let L=l.find(e=>e.id===u)??null,B=i.total,F=i.pending_review,$=i.active,E=i.rejected;async function M(t){if(!e)return;let a=l.find(e=>e.id===t);if(!a)return;let i=!a.forwardKey;try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{forward_api_key:i}}),r(e=>e.map(e=>e.id===t?{...e,forwardKey:i}:e)),x.default.success(i?"Forward API key enabled":"Forward API key disabled")}catch{x.default.fromBackend("Failed to update forward API key")}}async function R(t,a){if(!e)return;let l={};for(let{key:e,value:t}of a)e.trim()&&(l[e.trim()]=t);try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{headers:l}}),r(e=>e.map(e=>e.id===t?{...e,customHeaders:a.filter(e=>e.key.trim())}:e)),x.default.success("Static headers updated")}catch{x.default.fromBackend("Failed to update static headers")}}async function G(t,a){if(e)try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{extra_headers:a}}),r(e=>e.map(e=>e.id===t?{...e,extraHeaders:a}:e)),x.default.success("Forward client headers updated")}catch{x.default.fromBackend("Failed to update forward client headers")}}async function W(t){if(e)try{await (0,d.approveGuardrailSubmission)(e,t),y(null),u===t&&p(null),await P(),x.default.success("Guardrail approved")}catch{x.default.fromBackend("Failed to approve guardrail")}}async function Z(t){if(e)try{await (0,d.rejectGuardrailSubmission)(e,t),y(null),u===t&&p(null),await P(),x.default.success("Guardrail rejected")}catch{x.default.fromBackend("Failed to reject guardrail")}}return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:`flex-1 min-w-0 p-6 overflow-auto ${L?"border-r border-gray-200":""}`,children:[(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[(0,t.jsx)(ee,{label:"Total Submitted",value:B,color:"text-gray-900"}),(0,t.jsx)(ee,{label:"Pending Review",value:F,color:"text-yellow-600"}),(0,t.jsx)(ee,{label:"Active",value:$,color:"text-green-600"}),(0,t.jsx)(ee,{label:"Rejected",value:E,color:"text-red-600"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(O.SearchIcon,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,t.jsx)("input",{type:"text",placeholder:"Search guardrails...",value:n,onChange:e=>o(e.target.value),className:"w-full pl-9 pr-4 py-2 border border-gray-200 rounded-md text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"})]}),(0,t.jsxs)("select",{value:c,onChange:e=>m(e.target.value),className:"border border-gray-200 rounded-md px-3 py-2 text-sm text-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 bg-white",children:[(0,t.jsx)("option",{value:"all",children:"All Status"}),(0,t.jsx)("option",{value:"pending",children:"Pending Review"}),(0,t.jsx)("option",{value:"active",children:"Active"}),(0,t.jsx)("option",{value:"rejected",children:"Rejected"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>k(!0),className:"ml-auto flex items-center gap-2 bg-blue-500 hover:bg-blue-600 text-white text-sm font-medium px-4 py-2 rounded-md transition-colors",children:[(0,t.jsx)(T.PlusIcon,{className:"h-4 w-4"}),"Add Guardrail"]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[_&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-500 text-sm",children:"Loading submissions…"}),v&&(0,t.jsx)("div",{className:"text-center py-12 text-red-600 text-sm",children:v}),!_&&!v&&0===l.length&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-400 text-sm",children:"No guardrails match your filters."}),!_&&!v&&l.map(e=>(0,t.jsx)(ea,{guardrail:e,isSelected:u===e.id,isHeadersExpanded:g.has(e.id),onSelect:()=>p(u===e.id?null:e.id),onToggleForwardKey:()=>M(e.id),onToggleHeaders:()=>{var t;return t=e.id,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},onApprove:()=>y({id:e.id,action:"approve"}),onReject:()=>y({id:e.id,action:"reject"})},e.id))]})]}),L&&(0,t.jsx)(er,{guardrail:L,onClose:()=>p(null),onApprove:()=>y({id:L.id,action:"approve"}),onReject:()=>y({id:L.id,action:"reject"}),onToggleForwardKey:()=>M(L.id),onUpdateCustomHeaders:e=>R(L.id,e),onUpdateExtraHeaders:e=>G(L.id,e)}),f&&(0,t.jsx)(ei,{action:f.action,guardrailName:l.find(e=>e.id===f.id)?.name??"",onConfirm:()=>"approve"===f.action?W(f.id):Z(f.id),onCancel:()=>y(null)}),(0,t.jsxs)(z.Modal,{title:"Submit Guardrail for Review",open:S,onCancel:()=>{k(!1),I.resetFields()},onOk:()=>I.submit(),okText:"Submit for Review",children:[(0,t.jsx)("div",{className:"rounded-md bg-blue-50 border border-blue-200 px-4 py-3 text-sm text-blue-800 mb-4",children:"Your guardrail will be sent for admin review before it becomes active."}),(0,t.jsxs)(D.Form,{form:I,layout:"vertical",initialValues:{mode:"pre_call"},onFinish:async e=>{let t={...e.extra_litellm_params?JSON.parse(e.extra_litellm_params):{},guardrail:"generic_guardrail_api",mode:e.mode,api_base:e.api_base};try{await A.mutateAsync({team_id:e.team_id,guardrail_name:e.guardrail_name,litellm_params:t,guardrail_info:e.guardrail_info?JSON.parse(e.guardrail_info):void 0}),x.default.success("Guardrail submitted for review"),k(!1),I.resetFields(),P()}catch{}},children:[(0,t.jsx)(D.Form.Item,{label:"Team",name:"team_id",rules:[{required:!0,message:"Select a team"}],children:(0,t.jsx)(H.default,{})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Enter a guardrail name"}],children:(0,t.jsx)(j.Input,{placeholder:"e.g. pii-detection"})}),(0,t.jsx)(D.Form.Item,{label:"Mode",name:"mode",rules:[{required:!0,message:"Select a mode"}],children:(0,t.jsxs)(K.Select,{children:[(0,t.jsx)(K.Select.Option,{value:"pre_call",children:"Pre Call"}),(0,t.jsx)(K.Select.Option,{value:"post_call",children:"Post Call"}),(0,t.jsx)(K.Select.Option,{value:"during_call",children:"During Call"})]})}),(0,t.jsx)(D.Form.Item,{label:"API Base URL",name:"api_base",rules:[{required:!0,message:"Enter the API base URL"},{type:"url",message:"Must be a valid URL"}],children:(0,t.jsx)(j.Input,{placeholder:"https://your-guardrail-api.com/v1/check",className:"font-mono"})}),(0,t.jsx)(D.Form.Item,{label:"Additional litellm_params (optional)",name:"extra_litellm_params",tooltip:"JSON object merged into litellm_params. e.g. forward_api_key, headers, model, unreachable_fallback",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{let e=JSON.parse(t);if("object"!=typeof e||Array.isArray(e))return Promise.reject("Must be a JSON object");return Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"forward_api_key": true, "headers": {"X-Custom": "value"}}'})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Info (optional)",name:"guardrail_info",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"description": "Detects PII in requests"}'})})]})]})]})}e.s(["default",0,({accessToken:e,userRole:j})=>{let[_,b]=(0,a.useState)([]),[v,w]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),[S,k]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[T,P]=(0,a.useState)(null),[L,B]=(0,a.useState)(!1),[F,$]=(0,a.useState)(null),E=!!j&&(0,u.isAdminRole)(j),M=async()=>{if(e){k(!0);try{let t=await (0,d.getGuardrailsList)(e);console.log(`guardrails: ${JSON.stringify(t)}`),b(t.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{k(!1)}}};(0,a.useEffect)(()=>{M()},[e]);let R=()=>{M()},G=async()=>{if(T&&e){O(!0);try{await (0,d.deleteGuardrailCall)(e,T.guardrail_id),x.default.success(`Guardrail "${T.guardrail_name}" deleted successfully`),await M()}catch(e){console.error("Error deleting guardrail:",e),x.default.fromBackend("Failed to delete guardrail")}finally{O(!1),B(!1),P(null)}}},z=T&&T.litellm_params?(0,f.getGuardrailLogoAndName)(T.litellm_params.guardrail).displayName:void 0;return(0,t.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,t.jsx)(i.Tabs,{defaultActiveKey:"submitted",items:[...E?[{key:"garden",label:"Guardrail Garden",children:(0,t.jsx)(A,{accessToken:e,onGuardrailCreated:R})},{key:"guardrails",label:"Guardrails",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)(r.Dropdown,{menu:{items:[{key:"provider",icon:(0,t.jsx)(n.PlusOutlined,{}),label:"Add Provider Guardrail",onClick:()=>{F&&$(null),w(!0)}},{key:"custom_code",icon:(0,t.jsx)(o.CodeOutlined,{}),label:"Create Custom Code Guardrail",onClick:()=>{F&&$(null),C(!0)}}]},trigger:["click"],disabled:!e,children:(0,t.jsxs)(l.Button,{disabled:!e,children:["+ Add New Guardrail ",(0,t.jsx)(s.DownOutlined,{className:"ml-2"})]})})}),F?(0,t.jsx)(p.default,{guardrailId:F,onClose:()=>$(null),accessToken:e,isAdmin:E}):(0,t.jsx)(m.default,{guardrailsList:_,isLoading:S,onDeleteClick:(e,t)=>{P(_.find(t=>t.guardrail_id===e)||null),B(!0)},accessToken:e,onGuardrailUpdated:M,isAdmin:E,onGuardrailClick:e=>$(e)}),(0,t.jsx)(c.default,{visible:v,onClose:()=>{w(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(y.CustomCodeModal,{visible:N,onClose:()=>{C(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(h.default,{isOpen:L,title:"Delete Guardrail",message:`Are you sure you want to delete guardrail: ${T?.guardrail_name}? This action cannot be undone.`,resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:T?.guardrail_name},{label:"ID",value:T?.guardrail_id,code:!0},{label:"Provider",value:z},{label:"Mode",value:T?.litellm_params.mode},{label:"Default On",value:T?.litellm_params.default_on?"Yes":"No"}],onCancel:()=>{B(!1),P(null)},onOk:G,confirmLoading:I})]})},{key:"playground",label:"Test Playground",disabled:!e,children:(0,t.jsx)(g.default,{guardrailsList:_,isLoading:S,accessToken:e,onClose:()=>{}})}]:[],{key:"submitted",label:"Submitted Guardrails",children:(0,t.jsx)(es,{accessToken:e})}]})})}],487304)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/03c715f5e0f1425c.js b/litellm/proxy/_experimental/out/_next/static/chunks/03c715f5e0f1425c.js
new file mode 100644
index 0000000000..963ac87c93
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/03c715f5e0f1425c.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56567,838932,471145,e=>{"use strict";var t=e.i(843476),l=e.i(135214),a=e.i(109799),s=e.i(912598),i=e.i(907308),r=e.i(764205),n=e.i(266027);let o=(0,e.i(243652).createQueryKeys)("guardrails"),d=()=>{let{accessToken:e,userId:t,userRole:a}=(0,l.default)();return(0,n.useQuery)({queryKey:o.list({}),queryFn:async()=>(0,r.getGuardrailsList)(e),enabled:!!(e&&t&&a),select:e=>{let t=e?.guardrails??[],l=new Set,a=new Set;for(let e of t)e.litellm_params?.default_on?l.add(e.guardrail_name):a.add(e.guardrail_name);return{guardrails:t,globalGuardrailNames:l,optionalGuardrailNames:a}}})};e.s(["useGuardrails",0,d],838932);var m=e.i(500330),c=e.i(11751),u=e.i(708347),g=e.i(751904),h=e.i(160818),p=e.i(827252),x=e.i(564897),_=e.i(646563),b=e.i(987432),y=e.i(530212),j=e.i(677667),f=e.i(130643),v=e.i(898667),T=e.i(389083),S=e.i(304967),w=e.i(350967),N=e.i(599724),C=e.i(779241),k=e.i(629569),I=e.i(464571),M=e.i(808613),z=e.i(311451),A=e.i(28651),F=e.i(199133),O=e.i(770914),P=e.i(790848),D=e.i(653496),L=e.i(262218),R=e.i(592968),B=e.i(888259),V=e.i(678784),U=e.i(118366),E=e.i(271645),$=e.i(9314),K=e.i(552130),G=e.i(127952);function W({className:e,value:l,onChange:a}){return(0,t.jsxs)(F.Select,{className:e,value:l,onChange:a,children:[(0,t.jsx)(F.Select.Option,{value:"24h",children:"Daily"}),(0,t.jsx)(F.Select.Option,{value:"7d",children:"Weekly"}),(0,t.jsx)(F.Select.Option,{value:"30d",children:"Monthly"})]})}var q=e.i(844565),H=e.i(355619);let J=function({globalGuardrailNames:e,teamGuardrails:l=[],optedOutGlobalGuardrails:a=[],killSwitchOn:s=!1,variant:i="card",className:r=""}){let n=new Set(a),o=Array.from(e).filter(e=>!n.has(e)),d=l.filter(t=>!e.has(t)),m=s||0!==o.length||0!==d.length?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:[(0,t.jsx)(h.GlobalOutlined,{style:{marginInlineEnd:4},"aria-label":"Global guardrail"}),"Global"]}),s?(0,t.jsx)(L.Tag,{color:"gold",children:"Bypassed for this team"}):o.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,t.jsx)(L.Tag,{color:"blue",children:e},e))}):(0,t.jsx)("span",{className:"block text-sm text-gray-500",children:"None configured"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Team-specific"}),d.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:d.map(e=>(0,t.jsx)(L.Tag,{color:"blue",children:e},e))}):(0,t.jsx)("span",{className:"block text-sm text-gray-500",children:"None configured"})]})]}):(0,t.jsx)("span",{className:"block text-gray-500",children:"No guardrails configured"});return"card"===i?(0,t.jsxs)("div",{className:`bg-white border border-gray-200 rounded-lg p-6 ${r}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block font-semibold text-gray-900",children:"Guardrails Settings"}),(0,t.jsx)("span",{className:"block text-xs text-gray-500",children:"Global and team-specific guardrails applied to this team"})]})}),m]}):(0,t.jsxs)("div",{className:`${r}`,children:[(0,t.jsx)("span",{className:"block font-medium text-gray-900 mb-3",children:"Guardrails Settings"}),m]})};var Q=e.i(643449),Y=e.i(75921),X=e.i(390605),Z=e.i(162386),ee=e.i(727749),et=e.i(384767),el=e.i(435451),ea=e.i(916940);let es=({onChange:e,value:l,className:a,accessToken:s,placeholder:i="Select search tools (optional)",disabled:n=!1})=>{let[o,d]=(0,E.useState)([]),[m,c]=(0,E.useState)(!1);return(0,E.useEffect)(()=>{(async()=>{if(s){c(!0);try{let e=await (0,r.fetchSearchTools)(s),t=Array.isArray(e?.search_tools)?e.search_tools:Array.isArray(e?.data)?e.data:[];d(t.map(e=>e?.search_tool_name).filter(e=>"string"==typeof e&&e.length>0).map(e=>({label:e,value:e})))}catch(e){console.error("Failed to load search tools:",e)}finally{c(!1)}}})()},[s]),(0,t.jsx)(F.Select,{mode:"multiple",allowClear:!0,showSearch:!0,optionFilterProp:"label",placeholder:i,onChange:e,value:l,loading:m,className:a,options:o,style:{width:"100%"},disabled:n})};e.s(["default",0,es],471145);var ei=e.i(183588),er=e.i(460285),en=e.i(276173),eo=e.i(91979),ed=e.i(269200),em=e.i(942232),ec=e.i(977572),eu=e.i(427612),eg=e.i(64848),eh=e.i(496020),ep=e.i(536916),ex=e.i(21548);let e_={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team","/team/daily/activity":"Member can view all team usage data (not just their own)","/spend/logs":"Member can view spend logs for the entire team (not just their own)"},eb=({teamId:e,accessToken:l,canEditTeam:a})=>{let[s,i]=(0,E.useState)([]),[n,o]=(0,E.useState)([]),[d,m]=(0,E.useState)(!0),[c,u]=(0,E.useState)(!1),[g,h]=(0,E.useState)(!1),p=async()=>{try{if(m(!0),!l)return;let t=await (0,r.getTeamPermissionsCall)(l,e),a=t.all_available_permissions||[];i(a);let s=t.team_member_permissions||[];o(s),h(!1)}catch(e){ee.default.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{m(!1)}};(0,E.useEffect)(()=>{p()},[e,l]);let x=async()=>{try{if(!l)return;u(!0),await (0,r.teamPermissionsUpdateCall)(l,e,n),ee.default.success("Permissions updated successfully"),h(!1)}catch(e){ee.default.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{u(!1)}};if(d)return(0,t.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let _=s.length>0;return(0,t.jsxs)(S.Card,{className:"bg-white shadow-md rounded-md p-6",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,t.jsx)(k.Title,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),a&&g&&(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(I.Button,{icon:(0,t.jsx)(eo.ReloadOutlined,{}),onClick:()=>{p()},children:"Reset"}),(0,t.jsx)(I.Button,{onClick:x,loading:c,type:"primary",icon:(0,t.jsx)(b.SaveOutlined,{}),children:"Save Changes"})]})]}),(0,t.jsx)(N.Text,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),_?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(ed.Table,{className:" min-w-full",children:[(0,t.jsx)(eu.TableHead,{children:(0,t.jsxs)(eh.TableRow,{children:[(0,t.jsx)(eg.TableHeaderCell,{children:"Method"}),(0,t.jsx)(eg.TableHeaderCell,{children:"Endpoint"}),(0,t.jsx)(eg.TableHeaderCell,{children:"Description"}),(0,t.jsx)(eg.TableHeaderCell,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,t.jsx)(em.TableBody,{children:s.map(e=>{let l=(e=>{let t=e.includes("/info")||e.includes("/list")||e.includes("/activity")||"/spend/logs"===e?"GET":"POST",l=e_[e];if(!l){for(let[t,a]of Object.entries(e_))if(e.includes(t)){l=a;break}}return l||(l=`Access ${e}`),{method:t,endpoint:e,description:l,route:e}})(e);return(0,t.jsxs)(eh.TableRow,{className:"hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(ec.TableCell,{children:(0,t.jsx)("span",{className:`px-2 py-1 rounded text-xs font-medium ${"GET"===l.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:l.method})}),(0,t.jsx)(ec.TableCell,{children:(0,t.jsx)("span",{className:"font-mono text-sm text-gray-800",children:l.endpoint})}),(0,t.jsx)(ec.TableCell,{className:"text-gray-700",children:l.description}),(0,t.jsx)(ec.TableCell,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,t.jsx)(ep.Checkbox,{checked:n.includes(e),onChange:t=>{o(t.target.checked?[...n,e]:n.filter(t=>t!==e)),h(!0)},disabled:!a})})]},e)})})]})}):(0,t.jsx)("div",{className:"py-12",children:(0,t.jsx)(ex.Empty,{description:"No permissions available"})})]})};var ey=e.i(822315);function ej(e){if(!e)return null;let t=(0,ey.default)(e);return t.isValid()?t.format("MMM D, YYYY"):null}var ef=e.i(175712),ev=e.i(178654),eT=e.i(621192),eS=e.i(898586);let ew=async(e,t)=>{let l=(0,r.getProxyBaseUrl)(),a=l?`${l}/team/${encodeURIComponent(t)}/members/me`:`/team/${encodeURIComponent(t)}/members/me`,s=await fetch(a,{method:"GET",headers:{[(0,r.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(404===s.status)return null;if(!s.ok){let e=await s.json().catch(()=>({}));throw Error((0,r.deriveErrorMessage)(e))}return await s.json()},eN=(e,l)=>(0,t.jsxs)(O.Space,{size:4,children:[(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:e}),(0,t.jsx)(R.Tooltip,{title:l,children:(0,t.jsx)(p.InfoCircleOutlined,{style:{color:"#8c8c8c"}})})]}),eC=(e,t=4)=>null==e?"0":(0,m.formatNumberWithCommas)(e,t),ek=e=>null==e?"Unlimited":(0,m.formatNumberWithCommas)(e,0);function eI({teamId:e}){let{data:a,isLoading:s,error:i}=(e=>{let{accessToken:t}=(0,l.default)();return(0,n.useQuery)({queryKey:["team",e,"members","me"],queryFn:()=>ew(t,e),enabled:!!(t&&e)})})(e);if(s)return(0,t.jsx)(ef.Card,{children:(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:"Loading your membership info…"})});if(i)return(0,t.jsx)(ef.Card,{children:(0,t.jsx)(eS.Typography.Text,{type:"danger",children:i instanceof Error?i.message:"Failed to load your membership info for this team."})});if(!a)return(0,t.jsx)(ef.Card,{children:(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:"No membership info available for the current user in this team."})});let r=a.litellm_budget_table??null,o=r?.max_budget??null,d=a.spend??0,m=a.total_spend??0,c=r?.tpm_limit??null,u=r?.rpm_limit??null,g=ej(r?.budget_reset_at),h=r?.allowed_models??null;return(0,t.jsxs)(O.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,t.jsx)(ef.Card,{children:(0,t.jsxs)(eT.Row,{gutter:[24,16],children:[(0,t.jsxs)(ev.Col,{xs:24,sm:12,md:8,children:[(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:"User"}),(0,t.jsx)("div",{style:{marginTop:4},children:(0,t.jsx)(eS.Typography.Text,{strong:!0,children:a.user_email||a.user_id})}),(0,t.jsx)(eS.Typography.Text,{type:"secondary",style:{fontSize:12,fontFamily:"monospace"},children:a.user_id})]}),(0,t.jsxs)(ev.Col,{xs:24,sm:12,md:8,children:[(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:"Team Role"}),(0,t.jsx)("div",{style:{marginTop:4},children:(0,t.jsx)(L.Tag,{color:"admin"===a.role?"blue":"default",children:a.role||"user"})})]})]})}),(0,t.jsxs)(eT.Row,{gutter:[16,16],children:[(0,t.jsx)(ev.Col,{xs:24,md:12,children:(0,t.jsxs)(ef.Card,{children:[eN("Current Cycle Spend (USD)","Spend for the current budget cycle. Resets to $0 when the budget window rolls over."),(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsxs)(eS.Typography.Title,{level:3,style:{margin:0},children:["$",eC(d,4)]}),(0,t.jsxs)(eS.Typography.Text,{type:"secondary",children:["of ",null===o?"Unlimited":`$${eC(o,4)}`]})]}),g&&(0,t.jsx)("div",{style:{marginTop:4},children:(0,t.jsxs)(eS.Typography.Text,{type:"secondary",children:["Resets ",g]})})]})}),(0,t.jsx)(ev.Col,{xs:24,md:12,children:(0,t.jsxs)(ef.Card,{children:[eN("Rate Limits","Your per-member rate limits within this team."),(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsxs)(eS.Typography.Text,{children:["TPM: ",ek(c)]}),(0,t.jsx)("br",{}),(0,t.jsxs)(eS.Typography.Text,{children:["RPM: ",ek(u)]})]})]})}),(0,t.jsx)(ev.Col,{xs:24,md:12,children:(0,t.jsxs)(ef.Card,{children:[eN("Total Spend (USD)","Cumulative spend across all budget cycles within this team."),(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsxs)(eS.Typography.Title,{level:4,style:{margin:0},children:["$",eC(m,4)]})})]})}),(0,t.jsx)(ev.Col,{xs:24,md:12,children:(0,t.jsxs)(ef.Card,{children:[eN("Model Scope","Models you can access within this team."),(0,t.jsx)("div",{style:{marginTop:8},children:h&&h.length>0?(0,t.jsx)(O.Space,{wrap:!0,children:h.map(e=>(0,t.jsx)(L.Tag,{children:e},e))}):(0,t.jsx)(eS.Typography.Text,{children:"All Team Models"})})]})})]})]})}let eM="overview",ez="my-user",eA="virtual-keys",eF="members",eO="member-permissions",eP="settings",eD={[eM]:"Overview",[ez]:"My User",[eA]:"Virtual Keys",[eF]:"Members",[eO]:"Member Permissions",[eP]:"Settings"};var eL=e.i(292639),eR=e.i(294612);function eB({teamData:e,canEditTeam:a,handleMemberDelete:s,setSelectedEditMember:i,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:n}){let o=e=>{if(null==e)return"0";if("number"==typeof e){let t=Number(e);return t===Math.floor(t)?t.toString():(0,m.formatNumberWithCommas)(t,8).replace(/\.?0+$/,"")}return"0"},{data:d}=(0,eL.useUISettings)(),{userId:c,userRole:g}=(0,l.default)(),h=!!d?.values?.disable_team_admin_delete_team_user,x=(0,u.isUserTeamAdminForSingleTeam)(e.team_info.members_with_roles,c||""),_=(0,u.isProxyAdminRole)(g||""),b=[{title:(0,t.jsxs)(O.Space,{direction:"horizontal",children:["Model Scope",(0,t.jsx)(R.Tooltip,{title:"Models this member can access. Empty means they inherit all team models.",children:(0,t.jsx)(p.InfoCircleOutlined,{})})]}),key:"model_scope",render:(l,a)=>{let s=(t=>{if(!t)return null;let l=e.team_memberships.find(e=>e.user_id===t),a=l?.litellm_budget_table?.allowed_models;return a&&a.length>0?a:null})(a.user_id);if(!s)return(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:"(all team models)"});let i=s.slice(0,2),r=s.length-i.length;return(0,t.jsxs)(O.Space,{wrap:!0,children:[i.map(e=>(0,t.jsx)(eS.Typography.Text,{code:!0,style:{fontSize:"12px"},children:e},e)),r>0&&(0,t.jsx)(R.Tooltip,{title:s.slice(2).join(", "),children:(0,t.jsxs)(eS.Typography.Text,{type:"secondary",children:["+",r," more"]})})]})}},{title:(0,t.jsxs)(O.Space,{direction:"horizontal",children:["Current Cycle Spend (USD)",(0,t.jsx)(R.Tooltip,{title:"Spend for the current budget cycle. Resets to $0 when the member's budget window rolls over. This is the value checked against the member's budget.",children:(0,t.jsx)(p.InfoCircleOutlined,{})})]}),key:"spend",render:(l,a)=>(0,t.jsxs)(eS.Typography.Text,{children:["$",(0,m.formatNumberWithCommas)((t=>{if(!t)return 0;let l=e.team_memberships.find(e=>e.user_id===t);return l?.spend??0})(a.user_id),4)]})},{title:(0,t.jsxs)(O.Space,{direction:"horizontal",children:["Total Spend (USD)",(0,t.jsx)(R.Tooltip,{title:"Cumulative spend by this member within this team, across all budget cycles. Tracking began 2026-04-21; spend from before that date is not included.",children:(0,t.jsx)(p.InfoCircleOutlined,{})})]}),key:"total_spend",render:(l,a)=>(0,t.jsxs)(eS.Typography.Text,{children:["$",(0,m.formatNumberWithCommas)((t=>{if(!t)return 0;let l=e.team_memberships.find(e=>e.user_id===t);return l?.total_spend??0})(a.user_id),4)]})},{title:"Team Member Budget (USD)",key:"budget",render:(l,a)=>{let s=(t=>{if(!t)return null;let l=e.team_memberships.find(e=>e.user_id===t),a=l?.litellm_budget_table?.max_budget;return null==a?null:o(a)})(a.user_id);return(0,t.jsx)(eS.Typography.Text,{children:s?`$${(0,m.formatNumberWithCommas)(Number(s),4)}`:"No Limit"})}},{title:"Budget Reset",key:"budget_reset",render:(l,a)=>{let s=(t=>{if(!t)return null;let l=e.team_memberships.find(e=>e.user_id===t);return ej(l?.litellm_budget_table?.budget_reset_at)})(a.user_id);return s?(0,t.jsx)(eS.Typography.Text,{children:s}):(0,t.jsx)(eS.Typography.Text,{type:"secondary",children:"—"})}},{title:(0,t.jsxs)(O.Space,{direction:"horizontal",children:["Team Member Rate Limits",(0,t.jsx)(R.Tooltip,{title:"Rate limits for this member's usage within this team.",children:(0,t.jsx)(p.InfoCircleOutlined,{})})]}),key:"rate_limits",render:(l,a)=>(0,t.jsx)(eS.Typography.Text,{children:(t=>{if(!t)return"No Limits";let l=e.team_memberships.find(e=>e.user_id===t),a=l?.litellm_budget_table?.rpm_limit,s=l?.litellm_budget_table?.tpm_limit,i=[a?`${o(a)} RPM`:null,s?`${o(s)} TPM`:null].filter(Boolean);return i.length>0?i.join(" / "):"No Limits"})(a.user_id)})}];return(0,t.jsx)(eR.default,{members:e.team_info.members_with_roles,canEdit:a,onEdit:t=>{let l=e.team_memberships.find(e=>e.user_id===t.user_id);i({...t,max_budget_in_team:l?.litellm_budget_table?.max_budget||null,tpm_limit:l?.litellm_budget_table?.tpm_limit||null,rpm_limit:l?.litellm_budget_table?.rpm_limit||null,allowed_models:l?.litellm_budget_table?.allowed_models||[]}),r(!0)},onDelete:s,onAddMember:()=>n(!0),roleColumnTitle:"Team Role",roleTooltip:"This role applies only to this team and is independent from the user's proxy-level role.",extraColumns:b,showDeleteForMember:()=>_||a&&!x||x&&!h})}var eV=e.i(207082),eU=e.i(871943),eE=e.i(502547),e$=e.i(360820),eK=e.i(94629),eG=e.i(152990),eW=e.i(682830),eq=e.i(994388),eH=e.i(752978),eJ=e.i(282786),eQ=e.i(981339),eY=e.i(969550),eX=e.i(20147),eZ=e.i(633627);function e0({teamId:e,teamAlias:a,organization:s}){let{accessToken:i}=(0,l.default)(),[r,o]=(0,E.useState)(null),[d,c]=(0,E.useState)([{id:"created_at",desc:!0}]),[u,g]=(0,E.useState)({pageIndex:0,pageSize:50}),[h,x]=(0,E.useState)({"Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"}),_=d.length>0?d[0].id:"created_at",b=d.length>0?d[0].desc?"desc":"asc":"desc",y=u.pageIndex,j=u.pageSize,{data:f,isPending:v,isFetching:S,refetch:w}=(0,eV.useKeys)(y+1,j,{teamID:e,organizationID:h["Organization ID"]?.trim()||void 0,selectedKeyAlias:h["Key Alias"]?.trim()||void 0,userID:h["User ID"]?.trim()||void 0,sortBy:_||void 0,sortOrder:b||void 0,expand:"user"}),C=(0,E.useMemo)(()=>{let e=f?.keys||[],t=s?.organization_id;return t?e.map(e=>({...e,organization_id:(e.organization_id??e.org_id)||t})):e},[f?.keys,s?.organization_id]),k=f?.total_pages??0,[I,M]=(0,E.useState)({}),z=(0,E.useMemo)(()=>({team_id:e,team_alias:a||e,models:[],max_budget:null,budget_duration:null,tpm_limit:null,rpm_limit:null,organization_id:s?.organization_id||"",created_at:"",keys:[],members_with_roles:[],spend:0}),[e,a,s]),A=(0,n.useQuery)({queryKey:["teamFilterOptions",e,i],queryFn:async()=>(0,eZ.fetchTeamFilterOptions)(i,e),enabled:!!i&&!!e,staleTime:3e4}).data||{keyAliases:[],organizationIds:[],userIds:[]},F=(0,E.useCallback)(()=>{w?.()},[w]);(0,E.useEffect)(()=>(window.addEventListener("storage",F),()=>window.removeEventListener("storage",F)),[F]);let O=(0,E.useCallback)((e,t=!1)=>{x(t=>({...t,"Organization ID":e["Organization ID"]??t["Organization ID"],"Key Alias":e["Key Alias"]??t["Key Alias"],"User ID":e["User ID"]??t["User ID"],"Sort By":e["Sort By"]??t["Sort By"]??"created_at","Sort Order":e["Sort Order"]??t["Sort Order"]??"desc"})),t||g(e=>({...e,pageIndex:0}))},[]),P=(0,E.useCallback)(()=>{x({"Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"}),g(e=>({...e,pageIndex:0}))},[]),D=(0,E.useMemo)(()=>[{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>{let{organizationIds:t}=A;if(!t.length)return[];let l=e.toLowerCase();return(l?t.filter(e=>e.toLowerCase().includes(l)):t).map(e=>({label:e,value:e}))}},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>{let{keyAliases:t}=A,l=e.toLowerCase();return(l?t.filter(e=>e.toLowerCase().includes(l)):t).map(e=>({label:e,value:e}))}},{name:"User ID",label:"User ID",isSearchable:!0,searchFn:async e=>{let{userIds:t}=A,l=e.toLowerCase();return(l?t.filter(e=>e.id.toLowerCase().includes(l)||e.email.toLowerCase().includes(l)):t).map(e=>({label:e.email?`${e.id} (${e.email})`:e.id,value:e.id}))}}],[A]),L=(0,E.useMemo)(()=>[{id:"token",accessorKey:"token",header:"Key ID",size:100,enableSorting:!0,cell:e=>{let l=e.getValue(),a=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:l,children:(0,t.jsx)(eq.Button,{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 overflow-hidden truncate block",style:{maxWidth:a,overflow:"hidden"},onClick:()=>o(e.row.original),children:l??"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,enableSorting:!0,cell:e=>{let l=e.getValue(),a=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:l,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:a,overflow:"hidden"},children:l??"-"})})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",size:120,enableSorting:!1,cell:e=>(0,t.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",size:140,enableSorting:!1,cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user",header:"User Email",size:160,enableSorting:!1,cell:e=>{let l=e.getValue(),a=l?.user_email,s=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:a,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:s,overflow:"hidden"},children:a??"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:70,enableSorting:!1,cell:e=>{let l=e.getValue(),a="default_user_id"===l?"Default Proxy Admin":l,s=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:a,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:s,overflow:"hidden"},children:a??"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,enableSorting:!0,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:70,enableSorting:!1,cell:e=>{let l=e.getValue(),a="default_user_id"===l?"Default Proxy Admin":l,s=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:a,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:s,overflow:"hidden"},children:a??"-"})})}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",size:120,enableSorting:!0,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"last_active",accessorKey:"last_active",header:()=>(0,t.jsxs)("span",{className:"flex items-center gap-1",children:["Last Active",(0,t.jsx)(eJ.Popover,{content:"This is a new field and is not backfilled. Only new key usage will update this value.",trigger:"hover",children:(0,t.jsx)(p.InfoCircleOutlined,{className:"text-gray-400 text-xs cursor-help"})})]}),size:130,enableSorting:!1,cell:e=>{let l=e.getValue();if(!l)return"Unknown";let a=new Date(l);return(0,t.jsx)(R.Tooltip,{title:a.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"long"}),children:(0,t.jsx)("span",{children:a.toLocaleDateString()})})}},{id:"expires",accessorKey:"expires",header:"Expires",size:120,enableSorting:!1,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,enableSorting:!0,cell:e=>(0,m.formatNumberWithCommas)(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,enableSorting:!0,cell:e=>{let t=e.getValue();return null===t?"Unlimited":`$${(0,m.formatNumberWithCommas)(t)}`}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",size:130,enableSorting:!1,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",size:200,enableSorting:!1,cell:e=>{let l=e.getValue();return(0,t.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(l)?(0,t.jsx)("div",{className:"flex flex-col",children:0===l.length?(0,t.jsx)(T.Badge,{size:"xs",className:"mb-1",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})}):(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"flex items-start",children:[l.length>3&&(0,t.jsx)("div",{children:(0,t.jsx)(eH.Icon,{icon:I[e.row.id]?eU.ChevronDownIcon:eE.ChevronRightIcon,className:"cursor-pointer",size:"xs",onClick:()=>M(t=>({...t,[e.row.id]:!t[e.row.id]}))})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,3).map((e,l)=>"all-proxy-models"===e?(0,t.jsx)(T.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})},l):(0,t.jsx)(T.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(N.Text,{children:e.length>30?`${(0,H.getModelDisplayName)(e).slice(0,30)}...`:(0,H.getModelDisplayName)(e)})},l)),l.length>3&&!I[e.row.id]&&(0,t.jsx)(T.Badge,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,t.jsxs)(N.Text,{children:["+",l.length-3," ",l.length-3==1?"more model":"more models"]})}),I[e.row.id]&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:l.slice(3).map((e,l)=>"all-proxy-models"===e?(0,t.jsx)(T.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})},l+3):(0,t.jsx)(T.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(N.Text,{children:e.length>30?`${(0,H.getModelDisplayName)(e).slice(0,30)}...`:(0,H.getModelDisplayName)(e)})},l+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",size:140,enableSorting:!1,cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:["TPM: ",null!==l.tpm_limit?l.tpm_limit:"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",null!==l.rpm_limit?l.rpm_limit:"Unlimited"]})]})}}],[I]),B=(0,E.useCallback)(e=>{let t="function"==typeof e?e(d):e;if(c(t),t?.length>0){let e=t[0];O({"Sort By":e.id,"Sort Order":e.desc?"desc":"asc"},!0)}},[d,O]),V=(0,eG.useReactTable)({data:C,columns:L,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:d,pagination:u},onSortingChange:B,onPaginationChange:g,getCoreRowModel:(0,eW.getCoreRowModel)(),enableSorting:!0,manualSorting:!0,manualPagination:!0,pageCount:k});return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:r?(0,t.jsx)(eX.default,{keyId:r.token,onClose:()=>o(null),keyData:r,teams:[z],onDelete:w}):(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"w-full mb-6",children:(0,t.jsx)(eY.default,{options:D,onApplyFilters:O,initialValues:h,onResetFilters:P})}),(0,t.jsx)("div",{className:"flex items-center justify-end w-full mb-4",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[v||S?(0,t.jsx)(eQ.Skeleton.Node,{active:!0,style:{width:74,height:20}}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",y+1," of ",V.getPageCount()]}),v||S?(0,t.jsx)(eQ.Skeleton.Button,{active:!0,size:"small",style:{width:84,height:30}}):(0,t.jsx)("button",{onClick:()=>V.previousPage(),disabled:v||S||!V.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),v||S?(0,t.jsx)(eQ.Skeleton.Button,{active:!0,size:"small",style:{width:58,height:30}}):(0,t.jsx)("button",{onClick:()=>V.nextPage(),disabled:v||S||!V.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(ed.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:V.getCenterTotalSize()},children:[(0,t.jsx)(eu.TableHead,{children:V.getHeaderGroups().map(e=>(0,t.jsx)(eh.TableRow,{children:e.headers.map(e=>(0,t.jsx)(eg.TableHeaderCell,{"data-header-id":e.id,className:`py-1 h-8 relative hover:bg-gray-50 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,style:{width:e.getSize(),position:"relative",cursor:e.column.getCanSort()?"pointer":"default"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,eG.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(e$.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(eU.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(eK.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${V.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(em.TableBody,{children:v||S?(0,t.jsx)(eh.TableRow,{children:(0,t.jsx)(ec.TableCell,{colSpan:L.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"Loading keys..."})})})}):C.length>0?V.getRowModel().rows.map(e=>(0,t.jsx)(eh.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(ec.TableCell,{style:{width:e.column.getSize(),maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"models"===e.column.id&&Array.isArray(e.getValue())&&e.getValue().length>3?"px-0":""}`,children:(0,eG.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(eh.TableRow,{children:(0,t.jsx)(ec.TableCell,{colSpan:L.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}e.s(["default",0,({teamId:e,onClose:n,accessToken:o,is_team_admin:eo,is_proxy_admin:ed,is_org_admin:em=!1,userModels:ec,editTeam:eu,premiumUser:eg=!1,onUpdate:eh})=>{let ep,ex,e_,ey,ej,ef,[ev,eT]=(0,E.useState)(null),[eS,ew]=(0,E.useState)(!0),[eN,eC]=(0,E.useState)(!1),[ek]=M.Form.useForm(),[eL,eR]=(0,E.useState)(!1),[eV,eU]=(0,E.useState)(null),[eE,e$]=(0,E.useState)(!1),[eK,eG]=(0,E.useState)([]),[eW,eq]=(0,E.useState)(!1),[eH,eJ]=(0,E.useState)({}),{data:eQ,isLoading:eY}=d(),eX=eQ?.globalGuardrailNames??new Set,[eZ,e1]=(0,E.useState)([]),[e4,e2]=(0,E.useState)({}),[e5,e3]=(0,E.useState)(!1),[e6,e8]=(0,E.useState)(null),[e7,e9]=(0,E.useState)(!1),[te,tt]=(0,E.useState)(!1),[tl,ta]=(0,E.useState)(!1),ts=E.default.useRef(null),[ti,tr]=(0,E.useState)(null),{userRole:tn,userId:to}=(0,l.default)(),{data:td=[]}=(0,a.useOrganizations)(),tm=(0,s.useQueryClient)(),tc=(0,E.useMemo)(()=>{let e=ev?.team_info?.organization_id;if(!e||!to)return!1;let t=td.find(t=>t.organization_id===e);return t?.members?.some(e=>e.user_id===to&&"org_admin"===e.user_role)??!1},[ev,td,to]),tu=M.Form.useWatch("models",ek),tg=M.Form.useWatch("disable_global_guardrails",ek),th=(0,E.useMemo)(()=>{let e=tu??ev?.team_info?.models??[];return e.includes("all-proxy-models")||e.includes("all-team-models")?ec:(0,H.unfurlWildcardModelsInList)(e,ec)},[tu,ev,ec]),tp=eo||ed||em||tc,tx=(0,E.useMemo)(()=>{let e;return e=[eM,ez,eA],tp?[...e,eF,eO,eP]:e},[tp]),t_=(0,E.useMemo)(()=>eu&&tp?eP:eM,[eu,tp]),tb=async()=>{try{if(ew(!0),!o)return;let t=await (0,r.teamInfoCall)(o,e);eT(t)}catch(e){ee.default.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ew(!1)}};(0,E.useEffect)(()=>{tb()},[e,o]),(0,E.useEffect)(()=>{(async()=>{if(!o||!ev?.team_info?.organization_id)return tr(null);try{let e=await (0,r.organizationInfoCall)(o,ev.team_info.organization_id);tr(e)}catch(e){console.error("Error fetching organization info:",e),tr(null)}})()},[o,ev?.team_info?.organization_id]),(0,E.useMemo)(()=>{let e;return e=[],e=ti?ti.models.includes("all-proxy-models")?ec:ti.models.length>0?ti.models:ec:ec,(0,H.unfurlWildcardModelsInList)(e,ec)},[ti,ec]),(0,E.useEffect)(()=>{(async()=>{try{if(!o)return;let e=(await (0,r.getPoliciesList)(o)).policies.map(e=>e.policy_name);e1(e)}catch(e){console.error("Failed to fetch policies:",e)}})()},[o]),(0,E.useEffect)(()=>{(async()=>{if(!o||!ev?.team_info?.policies||0===ev.team_info.policies.length)return;e3(!0);let e={};try{await Promise.all(ev.team_info.policies.map(async t=>{try{let l=await (0,r.getPolicyInfoWithGuardrails)(o,t);e[t]=l.resolved_guardrails||[]}catch(l){console.error(`Failed to fetch guardrails for policy ${t}:`,l),e[t]=[]}})),e2(e)}catch(e){console.error("Failed to fetch policy guardrails:",e)}finally{e3(!1)}})()},[o,ev?.team_info?.policies]);let ty=async t=>{try{if(null==o)return;let l={user_email:t.user_email,user_id:t.user_id,role:t.role};await (0,r.teamMemberAddCall)(o,e,l),ee.default.success("Team member added successfully"),eC(!1),ek.resetFields();let a=await (0,r.teamInfoCall)(o,e);eT(a),eh(a)}catch(t){let e="Failed to add team member";t?.raw?.detail?.error?.includes("Assigning team admins is a premium feature")?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":t?.message&&(e=t.message),ee.default.fromBackend(e),console.error("Error adding team member:",t)}},tj=async t=>{try{if(null==o)return;let l={user_email:t.user_email,user_id:t.user_id,role:t.role,max_budget_in_team:t.max_budget_in_team,tpm_limit:t.tpm_limit,rpm_limit:t.rpm_limit,allowed_models:t.allowed_models};B.default.destroy(),await (0,r.teamMemberUpdateCall)(o,e,l),ee.default.success("Team member updated successfully"),eR(!1);let a=await (0,r.teamInfoCall)(o,e);eT(a),eh(a)}catch(t){let e="Failed to update team member";t?.raw?.detail?.includes("Assigning team admins is a premium feature")?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":t?.message&&(e=t.message),eR(!1),B.default.destroy(),ee.default.fromBackend(e),console.error("Error updating team member:",t)}},tf=async()=>{if(e6&&o){tt(!0);try{await (0,r.teamMemberDeleteCall)(o,e,e6),ee.default.success("Team member removed successfully");let t=await (0,r.teamInfoCall)(o,e);eT(t),eh(t)}catch(e){ee.default.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{tt(!1),e9(!1),e8(null)}}},tv=async t=>{try{let l;if(!o)return;ta(!0);let s={};try{let{soft_budget_alerting_emails:e,...l}=t.metadata?JSON.parse(t.metadata):{};s=l}catch(e){ee.default.fromBackend("Invalid JSON in metadata field");return}if("string"==typeof t.secret_manager_settings&&t.secret_manager_settings.trim().length>0)try{l=JSON.parse(t.secret_manager_settings)}catch(e){ee.default.fromBackend("Invalid JSON in secret manager settings");return}let i=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,n={},d={};for(let e of t.modelLimits??[])e?.model&&(null!=e.tpm&&(n[e.model]=e.tpm),null!=e.rpm&&(d[e.model]=e.rpm));let m=!0===t.disable_global_guardrails,u=m?Array.from(eX):Array.from(eX).filter(e=>!(t.guardrails||[]).includes(e)),g={team_id:e,team_alias:t.team_alias,models:t.models,tpm_limit:i(t.tpm_limit),rpm_limit:i(t.rpm_limit),model_tpm_limit:n,model_rpm_limit:d,max_budget:t.max_budget,soft_budget:i(t.soft_budget),budget_duration:t.budget_duration,metadata:{...s,guardrails:(t.guardrails||[]).filter(e=>!eX.has(e)),opted_out_global_guardrails:u,...t.logging_settings?.length>0?{logging:t.logging_settings}:{},disable_global_guardrails:m,soft_budget_alerting_emails:"string"==typeof t.soft_budget_alerting_emails?t.soft_budget_alerting_emails.split(",").map(e=>e.trim()).filter(e=>e.length>0):t.soft_budget_alerting_emails||[],...void 0!==l?{secret_manager_settings:l}:{}},...t.policies?.length>0?{policies:t.policies}:{},...t.organization_id!==tT.organization_id?{organization_id:t.organization_id??null}:{}};g.max_budget=(0,c.mapEmptyStringToNull)(g.max_budget),g.team_member_budget_duration=t.team_member_budget_duration,void 0!==t.team_member_budget&&(g.team_member_budget=Number(t.team_member_budget)),void 0!==t.team_member_key_duration&&(g.team_member_key_duration=t.team_member_key_duration),(void 0!==t.team_member_tpm_limit||void 0!==t.team_member_rpm_limit)&&(g.team_member_tpm_limit=i(t.team_member_tpm_limit),g.team_member_rpm_limit=i(t.team_member_rpm_limit));let{servers:h,accessGroups:p,toolsets:x}=t.mcp_servers_and_groups||{servers:[],accessGroups:[],toolsets:[]},_=new Set(h||[]),b=Object.fromEntries(Object.entries(t.mcp_tool_permissions||{}).filter(([e])=>_.has(e)));g.object_permission={},h&&(g.object_permission.mcp_servers=h),p&&(g.object_permission.mcp_access_groups=p),b&&(g.object_permission.mcp_tool_permissions=b),x&&(g.object_permission.mcp_toolsets=x),delete t.mcp_servers_and_groups,delete t.mcp_tool_permissions;let{agents:y,accessGroups:j}=t.agents_and_groups||{agents:[],accessGroups:[]};y&&y.length>0&&(g.object_permission.agents=y),j&&j.length>0&&(g.object_permission.agent_access_groups=j),delete t.agents_and_groups,t.vector_stores&&t.vector_stores.length>0&&(g.object_permission.vector_stores=t.vector_stores),Array.isArray(t.object_permission_search_tools)&&(g.object_permission.search_tools=t.object_permission_search_tools),void 0!==t.access_group_ids&&(g.access_group_ids=t.access_group_ids),void 0!==t.default_team_member_models&&(g.default_team_member_models=t.default_team_member_models);let f=ts.current?.getValue();if(f?.router_settings){let e=e=>null!=e&&""!==e&&!1!==e&&!(Array.isArray(e)&&0===e.length),t=Object.values(f.router_settings).some(e),l=tT.router_settings&&Object.values(tT.router_settings).some(e);(t||l)&&(g.router_settings=f.router_settings)}await (0,r.teamUpdateCall)(o,g),tm.invalidateQueries({queryKey:a.organizationKeys.all}),ee.default.success("Team settings updated successfully"),e$(!1),tb()}catch(e){console.error("Error updating team:",e)}finally{ta(!1)}};if(eS)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!ev?.team_info)return(0,t.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:tT}=ev,tS=tT.metadata?.disable_global_guardrails===!0,tw=new Set(Array.isArray(tT.metadata?.opted_out_global_guardrails)?tT.metadata.opted_out_global_guardrails:[]),tN=(Array.isArray(tT.metadata?.guardrails)?tT.metadata.guardrails:[]).filter(e=>!eX.has(e)),tC=tS?tN:[...Array.from(eX).filter(e=>!tw.has(e)),...tN],tk=e=>{e.preventDefault(),e.stopPropagation()},tI=async(e,t)=>{await (0,m.copyToClipboard)(e)&&(eJ(e=>({...e,[t]:!0})),setTimeout(()=>{eJ(e=>({...e,[t]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(I.Button,{type:"text",icon:(0,t.jsx)(y.ArrowLeftIcon,{className:"h-4 w-4"}),onClick:n,className:"mb-4",children:"Back to Teams"}),(0,t.jsx)(k.Title,{children:tT.team_alias}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(N.Text,{className:"text-gray-500 font-mono",children:tT.team_id}),(0,t.jsx)(I.Button,{type:"text",size:"small",icon:eH["team-id"]?(0,t.jsx)(V.CheckIcon,{size:12}):(0,t.jsx)(U.CopyIcon,{size:12}),onClick:()=>tI(tT.team_id,"team-id"),className:`left-2 z-10 transition-all duration-200 ${eH["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]})}),(0,t.jsx)(D.Tabs,{defaultActiveKey:t_,className:"mb-4",items:[{key:eM,label:eD[eM],children:(0,t.jsxs)(w.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{children:"Budget Status"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(k.Title,{children:["$",(0,m.formatNumberWithCommas)(tT.spend,4)]}),(0,t.jsxs)(N.Text,{children:["of ",null===tT.max_budget?"Unlimited":`$${(0,m.formatNumberWithCommas)(tT.max_budget,4)}`]}),tT.budget_duration&&(0,t.jsxs)(N.Text,{className:"text-gray-500",children:["Reset: ",tT.budget_duration]}),(0,t.jsx)("br",{}),tT.team_member_budget_table&&(0,t.jsxs)(N.Text,{className:"text-gray-500",children:["Team Member Budget: $",(0,m.formatNumberWithCommas)(tT.team_member_budget_table.max_budget,4)]})]})]}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(N.Text,{children:["TPM: ",tT.tpm_limit||"Unlimited"]}),(0,t.jsxs)(N.Text,{children:["RPM: ",tT.rpm_limit||"Unlimited"]}),tT.max_parallel_requests&&(0,t.jsxs)(N.Text,{children:["Max Parallel Requests: ",tT.max_parallel_requests]}),(ep=tT.metadata?.model_tpm_limit??{},ex=tT.metadata?.model_rpm_limit??{},0===(e_=Array.from(new Set([...Object.keys(ep),...Object.keys(ex)]))).length?null:(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)(N.Text,{className:"text-gray-500",children:"Per-model limits:"}),e_.map(e=>(0,t.jsxs)(N.Text,{className:"text-xs",children:[e,": TPM ",ep[e]??"—",", RPM ",ex[e]??"—"]},e))]}))]})]}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===tT.models.length||tT.models.includes("all-proxy-models")?(0,t.jsx)(T.Badge,{color:"red",children:"All proxy models"}):(0,t.jsxs)(t.Fragment,{children:[tT.models.map((e,l)=>(0,t.jsx)(T.Badge,{color:"blue",children:e},`direct-${l}`)),(tT.access_group_models||[]).map((e,l)=>(0,t.jsx)(T.Badge,{color:"green",title:"From access group",children:e},`ag-${l}`))]})})]}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(N.Text,{children:["User Keys: ",ev.keys.filter(e=>e.user_id).length]}),(0,t.jsxs)(N.Text,{children:["Service Account Keys: ",ev.keys.filter(e=>!e.user_id).length]}),(0,t.jsxs)(N.Text,{className:"text-gray-500",children:["Total: ",ev.keys.length]})]})]}),(0,t.jsx)(et.default,{objectPermission:tT.object_permission,variant:"card",accessToken:o}),(0,t.jsx)(S.Card,{children:(0,t.jsx)(J,{globalGuardrailNames:eX,teamGuardrails:Array.isArray(tT.metadata?.guardrails)?tT.metadata.guardrails:[],optedOutGlobalGuardrails:Array.isArray(tT.metadata?.opted_out_global_guardrails)?tT.metadata.opted_out_global_guardrails:[],killSwitchOn:tS,variant:"inline"})}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{className:"font-semibold text-gray-900 mb-3",children:"Policies"}),tT.policies&&tT.policies.length>0?(0,t.jsx)("div",{className:"space-y-4",children:tT.policies.map((e,l)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T.Badge,{color:"purple",children:e}),e5&&(0,t.jsx)(N.Text,{className:"text-xs text-gray-400",children:"Loading guardrails..."})]}),!e5&&e4[e]&&e4[e].length>0&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-gray-200",children:[(0,t.jsx)(N.Text,{className:"text-xs text-gray-500 mb-1",children:"Resolved Guardrails:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e4[e].map((e,l)=>(0,t.jsx)(T.Badge,{color:"blue",size:"xs",children:e},l))})]})]},l))}):(0,t.jsx)(N.Text,{className:"text-gray-500",children:"No policies configured"})]}),(0,t.jsx)(Q.default,{loggingConfigs:tT.metadata?.logging||[],disabledCallbacks:[],variant:"card"})]})},{key:ez,label:eD[ez],children:(0,t.jsx)(eI,{teamId:e})},{key:eA,label:eD[eA],children:(0,t.jsx)(e0,{teamId:e,teamAlias:tT.team_alias,organization:ti})},{key:eF,label:eD[eF],children:(0,t.jsx)(eB,{teamData:ev,canEditTeam:tp,handleMemberDelete:e=>{e8(e),e9(!0)},setSelectedEditMember:eU,setIsEditMemberModalVisible:eR,setIsAddMemberModalVisible:eC})},{key:eO,label:eD[eO],children:(0,t.jsx)(eb,{teamId:e,accessToken:o,canEditTeam:tp})},{key:eP,label:eD[eP],children:(0,t.jsxs)(S.Card,{className:"overflow-y-auto max-h-[65vh]",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(k.Title,{children:"Team Settings"}),tp&&!eE&&(0,t.jsx)(I.Button,{icon:(0,t.jsx)(g.EditOutlined,{className:"h-4 w-4"}),onClick:()=>e$(!0),children:"Edit Settings"})]}),eE&&eY?(0,t.jsx)("div",{className:"p-4",children:"Loading..."}):eE?(0,t.jsxs)(M.Form,{form:ek,onFinish:tv,onValuesChange:e=>{if("disable_global_guardrails"in e){let t=!0===e.disable_global_guardrails,l=(ek.getFieldValue("guardrails")||[]).filter(e=>!eX.has(e));ek.setFieldValue("guardrails",t?l:[...Array.from(eX),...l])}},initialValues:{...tT,team_alias:tT.team_alias,models:tT.models,tpm_limit:tT.tpm_limit,rpm_limit:tT.rpm_limit,object_permission_search_tools:tT.object_permission?.search_tools||[],modelLimits:Array.from(new Set([...Object.keys(tT.metadata?.model_tpm_limit??{}),...Object.keys(tT.metadata?.model_rpm_limit??{})])).map(e=>({model:e,tpm:tT.metadata?.model_tpm_limit?.[e],rpm:tT.metadata?.model_rpm_limit?.[e]})),max_budget:tT.max_budget,soft_budget:tT.soft_budget,budget_duration:tT.budget_duration,team_member_tpm_limit:tT.team_member_budget_table?.tpm_limit,team_member_rpm_limit:tT.team_member_budget_table?.rpm_limit,team_member_budget:tT.team_member_budget_table?.max_budget,team_member_budget_duration:tT.team_member_budget_table?.budget_duration,guardrails:tC,policies:tT.policies||[],disable_global_guardrails:tT.metadata?.disable_global_guardrails||!1,soft_budget_alerting_emails:Array.isArray(tT.metadata?.soft_budget_alerting_emails)?tT.metadata.soft_budget_alerting_emails.join(", "):"",metadata:tT.metadata?JSON.stringify((({logging:e,secret_manager_settings:t,soft_budget_alerting_emails:l,model_tpm_limit:a,model_rpm_limit:s,...i})=>i)(tT.metadata),null,2):"",logging_settings:tT.metadata?.logging||[],secret_manager_settings:tT.metadata?.secret_manager_settings?JSON.stringify(tT.metadata.secret_manager_settings,null,2):"",organization_id:tT.organization_id,vector_stores:tT.object_permission?.vector_stores||[],mcp_servers:tT.object_permission?.mcp_servers||[],mcp_access_groups:tT.object_permission?.mcp_access_groups||[],mcp_servers_and_groups:{servers:tT.object_permission?.mcp_servers||[],accessGroups:tT.object_permission?.mcp_access_groups||[],toolsets:tT.object_permission?.mcp_toolsets||[]},mcp_tool_permissions:tT.object_permission?.mcp_tool_permissions||{},agents_and_groups:{agents:tT.object_permission?.agents||[],accessGroups:tT.object_permission?.agent_access_groups||[]},access_group_ids:tT.access_group_ids||[],default_team_member_models:tT.default_team_member_models||[]},layout:"vertical",children:[(0,t.jsx)(M.Form.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,t.jsx)(z.Input,{type:""})}),(0,t.jsx)(M.Form.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,t.jsx)(Z.ModelSelect,{value:ek.getFieldValue("models")||[],onChange:e=>ek.setFieldValue("models",e),teamID:e,organizationID:ev?.team_info?.organization_id||void 0,options:{includeSpecialOptions:!0,includeUserModels:!ev?.team_info?.organization_id,showAllProxyModelsOverride:(0,u.isProxyAdminRole)(tn)&&!ev?.team_info?.organization_id},context:"team",dataTestId:"models-select"})}),(0,t.jsx)(M.Form.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(el.default,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Soft Budget (USD)",name:"soft_budget",children:(0,t.jsx)(el.default,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Soft Budget Alerting Emails",name:"soft_budget_alerting_emails",tooltip:"Comma-separated email addresses to receive alerts when the soft budget is reached",children:(0,t.jsx)(z.Input,{placeholder:"example1@test.com, example2@test.com"})}),(0,t.jsxs)(j.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(v.AccordionHeader,{children:(0,t.jsx)("b",{children:"Team Member Settings"})}),(0,t.jsxs)(f.AccordionBody,{children:[(0,t.jsx)(N.Text,{className:"text-xs text-gray-500 mb-4",children:"Optional defaults applied when members join this team. All fields can be overridden per member."}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Default Model Access"," ",(0,t.jsx)(R.Tooltip,{title:"Optional. If set, new members can only access these models by default. Must be a subset of the team's models above. Leave empty to give all members access to all team models.",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"default_team_member_models",children:(0,t.jsx)(M.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.models!==t.models,children:({getFieldValue:e})=>{let l=e("models")||tT.models||[];return(0,t.jsx)(F.Select,{mode:"multiple",placeholder:"Leave empty — all team models accessible to every member",value:ek.getFieldValue("default_team_member_models")||[],onChange:e=>ek.setFieldValue("default_team_member_models",e),options:l.map(e=>({label:e,value:e}))})}})}),(0,t.jsx)(M.Form.Item,{label:"Default Budget (USD)",name:"team_member_budget",tooltip:"Default spend budget for each member in this team.",children:(0,t.jsx)(el.default,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Default Budget Duration",name:"team_member_budget_duration",children:(0,t.jsx)(W,{onChange:e=>ek.setFieldValue("team_member_budget_duration",e),value:ek.getFieldValue("team_member_budget_duration")})}),(0,t.jsx)(M.Form.Item,{label:"Default Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,t.jsx)(C.TextInput,{placeholder:"e.g., 30d"})}),(0,t.jsx)(M.Form.Item,{label:"Default TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for each member. Can be overridden per member.",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,t.jsx)(M.Form.Item,{label:"Default RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for each member. Can be overridden per member.",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})})]})]}),(0,t.jsx)(M.Form.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(F.Select,{placeholder:"n/a",children:[(0,t.jsx)(F.Select.Option,{value:"24h",children:"daily"}),(0,t.jsx)(F.Select.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(F.Select.Option,{value:"30d",children:"monthly"})]})}),(0,t.jsx)(M.Form.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Model-Specific Rate Limits",tooltip:"Set per-model TPM/RPM limits that apply across the whole team.",children:(0,t.jsx)(M.Form.List,{name:"modelLimits",children:(e,{add:l,remove:a})=>(0,t.jsxs)(t.Fragment,{children:[e.map(({key:e,name:l,...s})=>(0,t.jsxs)(O.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,t.jsx)(M.Form.Item,{...s,name:[l,"model"],rules:[{required:!0,message:"Missing model"},{validator:(e,t)=>t&&(ek.getFieldValue("modelLimits")??[]).filter(e=>e?.model===t).length>1?Promise.reject(Error("Duplicate model")):Promise.resolve()}],style:{minWidth:240},children:(0,t.jsx)(F.Select,{showSearch:!0,placeholder:"Select model",allowClear:!0,options:th.map(e=>({value:e,label:e}))})}),(0,t.jsx)(M.Form.Item,{...s,name:[l,"tpm"],rules:[{validator:async(e,t)=>{let a=(ek.getFieldValue("modelLimits")??[])[l]??{};return a.model&&null==t&&null==a.rpm?Promise.reject(Error("Set at least one of TPM or RPM")):Promise.resolve()}}],children:(0,t.jsx)(A.InputNumber,{placeholder:"TPM Limit",min:0})}),(0,t.jsx)(M.Form.Item,{...s,name:[l,"rpm"],children:(0,t.jsx)(A.InputNumber,{placeholder:"RPM Limit",min:0})}),(0,t.jsx)(x.MinusCircleOutlined,{onClick:()=>a(l),style:{color:"#ef4444"}})]},e)),(0,t.jsx)(M.Form.Item,{children:(0,t.jsx)(I.Button,{type:"dashed",onClick:()=>l(),block:!0,icon:(0,t.jsx)(_.PlusOutlined,{}),children:"Add Model Limit"})})]})})}),(0,t.jsx)(M.Form.Item,{label:"Router Settings",children:(0,t.jsx)(er.default,{ref:ts,accessToken:o||"",value:tT.router_settings?{router_settings:tT.router_settings}:void 0})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(R.Tooltip,{title:"Select which guardrails apply to this team. Global guardrails are enabled by default — uncheck to opt out. Other guardrails are opt-in.",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",children:(0,t.jsxs)(F.Select,{mode:"multiple",placeholder:"Select guardrails",optionLabelProp:"label",tagRender:({label:e,value:l,closable:a,onClose:s})=>{let i=eX.has(l);return(0,t.jsxs)(L.Tag,{color:"blue",closable:a,onClose:s,onMouseDown:tk,style:{marginInlineEnd:4},children:[i&&(0,t.jsx)(h.GlobalOutlined,{style:{marginInlineEnd:4},"aria-label":"Global guardrail"}),e]})},children:[(0,t.jsx)(F.Select.OptGroup,{label:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.GlobalOutlined,{style:{marginInlineEnd:4}}),"Global"]}),children:(eQ?.guardrails??[]).filter(e=>e.litellm_params?.default_on).map(e=>(0,t.jsx)(F.Select.Option,{value:e.guardrail_name,label:e.guardrail_name,disabled:tg,children:e.guardrail_name},e.guardrail_name))}),(0,t.jsx)(F.Select.OptGroup,{label:"Other",children:(eQ?.guardrails??[]).filter(e=>!e.litellm_params?.default_on).map(e=>(0,t.jsx)(F.Select.Option,{value:e.guardrail_name,label:e.guardrail_name,children:e.guardrail_name},e.guardrail_name))})]})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Disable all global guardrails"," ",(0,t.jsx)(R.Tooltip,{title:"Kill switch: bypass every global guardrail for this team, including any added in the future. For per-guardrail opt-out instead, use the Guardrails dropdown above.",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",children:(0,t.jsx)(P.Switch,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Policies"," ",(0,t.jsx)(R.Tooltip,{title:"Apply policies to this team to control guardrails and other settings",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",children:(0,t.jsx)(F.Select,{mode:"tags",placeholder:"Select or enter policies",options:eZ.map(e=>({value:e,label:e}))})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Access Groups"," ",(0,t.jsx)(R.Tooltip,{title:"Assign access groups to this team. Access groups control which models, MCP servers, and agents this team can use",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",children:(0,t.jsx)($.default,{placeholder:"Select access groups (optional)"})}),(0,t.jsx)(M.Form.Item,{label:"Vector Stores",name:"vector_stores","aria-label":"Vector Stores",children:(0,t.jsx)(ea.default,{onChange:e=>ek.setFieldValue("vector_stores",e),value:ek.getFieldValue("vector_stores"),accessToken:o||"",placeholder:"Select vector stores"})}),(0,t.jsx)(M.Form.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(q.default,{onChange:e=>ek.setFieldValue("allowed_passthrough_routes",e),value:ek.getFieldValue("allowed_passthrough_routes"),accessToken:o||"",placeholder:"Select pass through routes"})}),(0,t.jsx)(M.Form.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(Y.default,{onChange:e=>ek.setFieldValue("mcp_servers_and_groups",e),value:ek.getFieldValue("mcp_servers_and_groups"),accessToken:o||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(M.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(z.Input,{type:"hidden"})}),(0,t.jsx)(M.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.mcp_servers_and_groups!==t.mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(X.default,{accessToken:o||"",selectedServers:ek.getFieldValue("mcp_servers_and_groups")?.servers||[],toolPermissions:ek.getFieldValue("mcp_tool_permissions")||{},onChange:e=>ek.setFieldsValue({mcp_tool_permissions:e})})})}),(0,t.jsx)(M.Form.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(K.default,{onChange:e=>ek.setFieldValue("agents_and_groups",e),value:ek.getFieldValue("agents_and_groups"),accessToken:o||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsxs)(j.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(v.AccordionHeader,{children:(0,t.jsx)("b",{children:"Search Tool Settings"})}),(0,t.jsx)(f.AccordionBody,{children:(0,t.jsx)(M.Form.Item,{label:"Allowed Search Tools",name:"object_permission_search_tools",tooltip:"Select which search tools this team can access. Leave empty to allow all search tools.",children:(0,t.jsx)(es,{onChange:e=>ek.setFieldValue("object_permission_search_tools",e),value:ek.getFieldValue("object_permission_search_tools"),accessToken:o||"",placeholder:"Select search tools (optional, empty = all allowed)"})})})]}),(0,t.jsx)(M.Form.Item,{label:"Organization",name:"organization_id",children:(0,t.jsx)(F.Select,{allowClear:!0,placeholder:"Select an organization",showSearch:!0,optionFilterProp:"label",options:td.map(e=>({value:e.organization_id,label:e.organization_alias||e.organization_id}))})}),(0,t.jsx)(M.Form.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(ei.default,{value:ek.getFieldValue("logging_settings"),onChange:e=>ek.setFieldValue("logging_settings",e)})}),(0,t.jsx)(M.Form.Item,{label:"Secret Manager Settings",name:"secret_manager_settings",help:eg?"Enter secret manager configuration as a JSON object.":"Premium feature - Upgrade to manage secret manager settings.",rules:[{validator:async(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,t.jsx)(z.Input.TextArea,{rows:6,placeholder:'{"namespace": "admin", "mount": "secret", "path_prefix": "litellm"}',disabled:!eg})}),(0,t.jsx)(M.Form.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(z.Input.TextArea,{rows:10})}),(0,t.jsx)("div",{className:"sticky z-10 bg-white p-4 pr-0 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,t.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,t.jsx)(I.Button,{onClick:()=>e$(!1),disabled:tl,children:"Cancel"}),(0,t.jsx)(I.Button,{icon:(0,t.jsx)(b.SaveOutlined,{className:"h-4 w-4"}),type:"primary",htmlType:"submit",loading:tl,children:"Save Changes"})]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Team Name"}),(0,t.jsx)("div",{children:tT.team_alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Team ID"}),(0,t.jsx)("div",{className:"font-mono",children:tT.team_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:new Date(tT.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:tT.models.map((e,l)=>(0,t.jsx)(T.Badge,{color:"red",children:e},l))})]}),tT.default_team_member_models&&tT.default_team_member_models.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Default Member Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:tT.default_team_member_models.map((e,l)=>(0,t.jsx)(T.Badge,{color:"blue",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)("div",{children:["TPM: ",tT.tpm_limit||"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",tT.rpm_limit||"Unlimited"]}),(ey=tT.metadata?.model_tpm_limit??{},ej=tT.metadata?.model_rpm_limit??{},0===(ef=Array.from(new Set([...Object.keys(ey),...Object.keys(ej)]))).length?null:(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(N.Text,{className:"text-gray-500",children:"Per-model limits:"}),ef.map(e=>(0,t.jsxs)("div",{className:"text-xs ml-2",children:[e,": TPM ",ey[e]??"—",", RPM ",ej[e]??"—"]},e))]}))]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Team Budget"}),(0,t.jsxs)("div",{children:["Max Budget:"," ",null!==tT.max_budget?`$${(0,m.formatNumberWithCommas)(tT.max_budget,4)}`:"No Limit"]}),(0,t.jsxs)("div",{children:["Soft Budget:"," ",null!==tT.soft_budget&&void 0!==tT.soft_budget?`$${(0,m.formatNumberWithCommas)(tT.soft_budget,4)}`:"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Reset: ",tT.budget_duration||"Never"]}),tT.metadata?.soft_budget_alerting_emails&&Array.isArray(tT.metadata.soft_budget_alerting_emails)&&tT.metadata.soft_budget_alerting_emails.length>0&&(0,t.jsxs)("div",{children:["Soft Budget Alerting Emails: ",tT.metadata.soft_budget_alerting_emails.join(", ")]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(N.Text,{className:"font-medium",children:["Team Member Settings"," ",(0,t.jsx)(R.Tooltip,{title:"These are limits on individual team members",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),(0,t.jsxs)("div",{children:["Max Budget: ",tT.team_member_budget_table?.max_budget||"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Duration: ",tT.team_member_budget_table?.budget_duration||"No Limit"]}),(0,t.jsxs)("div",{children:["Key Duration: ",tT.metadata?.team_member_key_duration||"No Limit"]}),(0,t.jsxs)("div",{children:["TPM Limit: ",tT.team_member_budget_table?.tpm_limit||"No Limit"]}),(0,t.jsxs)("div",{children:["RPM Limit: ",tT.team_member_budget_table?.rpm_limit||"No Limit"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Router Settings"}),tT.router_settings&&Object.values(tT.router_settings).some(e=>null!=e&&""!==e&&!(Array.isArray(e)&&0===e.length))?(0,t.jsxs)("div",{className:"mt-1 space-y-1",children:[tT.router_settings.routing_strategy&&(0,t.jsxs)("div",{children:["Routing Strategy:"," ",(0,t.jsx)(T.Badge,{color:"blue",children:tT.router_settings.routing_strategy})]}),null!=tT.router_settings.num_retries&&(0,t.jsxs)("div",{children:["Number of Retries: ",tT.router_settings.num_retries]}),null!=tT.router_settings.allowed_fails&&(0,t.jsxs)("div",{children:["Allowed Failures: ",tT.router_settings.allowed_fails]}),null!=tT.router_settings.cooldown_time&&(0,t.jsxs)("div",{children:["Cooldown Time: ",tT.router_settings.cooldown_time,"s"]}),null!=tT.router_settings.timeout&&(0,t.jsxs)("div",{children:["Timeout: ",tT.router_settings.timeout,"s"]}),null!=tT.router_settings.retry_after&&(0,t.jsxs)("div",{children:["Retry After: ",tT.router_settings.retry_after,"s"]}),tT.router_settings.fallbacks&&Array.isArray(tT.router_settings.fallbacks)&&tT.router_settings.fallbacks.length>0&&(0,t.jsxs)("div",{children:["Fallbacks: ",tT.router_settings.fallbacks.length," configured"]}),tT.router_settings.enable_tag_filtering&&(0,t.jsx)("div",{children:"Tag Filtering: Enabled"})]}):(0,t.jsx)("div",{className:"text-gray-400",children:"No router settings configured"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Organization ID"}),(0,t.jsx)("div",{children:tT.organization_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Status"}),(0,t.jsx)(T.Badge,{color:tT.blocked?"red":"green",children:tT.blocked?"Blocked":"Active"})]}),(0,t.jsx)(et.default,{objectPermission:tT.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o}),(0,t.jsx)(J,{globalGuardrailNames:eX,teamGuardrails:Array.isArray(tT.metadata?.guardrails)?tT.metadata.guardrails:[],optedOutGlobalGuardrails:Array.isArray(tT.metadata?.opted_out_global_guardrails)?tT.metadata.opted_out_global_guardrails:[],killSwitchOn:tS,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,t.jsx)(Q.default,{loggingConfigs:tT.metadata?.logging||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"}),tT.metadata?.secret_manager_settings&&(0,t.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Secret Manager Settings"}),(0,t.jsx)("pre",{className:"mt-2 bg-gray-50 p-3 rounded text-xs overflow-x-auto",children:JSON.stringify(tT.metadata.secret_manager_settings,null,2)})]})]})]})}].filter(e=>tx.includes(e.key))}),(0,t.jsx)(en.default,{visible:eL,onCancel:()=>eR(!1),onSubmit:tj,initialData:eV,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}],additionalFields:[{name:"max_budget_in_team",label:(0,t.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,t.jsx)(R.Tooltip,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:.01,min:0,placeholder:"Budget limit for this member within this team"},{name:"tpm_limit",label:(0,t.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,t.jsx)(R.Tooltip,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Tokens per minute limit for this member in this team"},{name:"rpm_limit",label:(0,t.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,t.jsx)(R.Tooltip,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"},{name:"allowed_models",label:(0,t.jsxs)("span",{children:["Allowed Models"," ",(0,t.jsx)(R.Tooltip,{title:"Models this member can access within this team. Leave empty to inherit all team models.",children:(0,t.jsx)(p.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"multi-select",options:(tT.models||[]).map(e=>({label:e,value:e})),placeholder:"Leave empty to inherit all team models"}]}}),(0,t.jsx)(i.default,{isVisible:eN,onCancel:()=>eC(!1),onSubmit:ty,accessToken:o,teamId:e}),(0,t.jsx)(G.default,{isOpen:e7,title:"Delete Team Member",alertMessage:"Removing team members will also delete any keys created by or created for this member.",message:"Are you sure you want to remove this member from the team? This action cannot be undone.",resourceInformationTitle:"Team Member Information",resourceInformation:[{label:"User ID",value:e6?.user_id,code:!0},{label:"Email",value:e6?.user_email},{label:"Role",value:e6?.role}],onCancel:()=>{e9(!1),e8(null)},onOk:tf,confirmLoading:te})]})}],56567)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/0493aafc4891dd29.js b/litellm/proxy/_experimental/out/_next/static/chunks/0493aafc4891dd29.js
new file mode 100644
index 0000000000..90c97f4525
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/0493aafc4891dd29.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,312361,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),r=e.i(242064),i=e.i(517455);e.i(296059);var a=e.i(915654),l=e.i(183293),o=e.i(246422),c=e.i(838378);let s=(0,o.genStyleHooks)("Divider",e=>{let t=(0,c.mergeToken)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[(e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:i,textPaddingInline:o,orientationMargin:c,verticalMarginInline:s}=e;return{[t]:Object.assign(Object.assign({},(0,l.resetComponent)(e)),{borderBlockStart:`${(0,a.unit)(i)} solid ${r}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${(0,a.unit)(i)} solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${(0,a.unit)(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${(0,a.unit)(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${(0,a.unit)(i)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-start`]:{"&::before":{width:`calc(${c} * 100%)`},"&::after":{width:`calc(100% - ${c} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{"&::before":{width:`calc(100% - ${c} * 100%)`},"&::after":{width:`calc(${c} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:o},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${(0,a.unit)(i)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:i,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:r,borderStyle:"dotted",borderWidth:`${(0,a.unit)(i)} 0 0`},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:i,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}})(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}});var d=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 i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let u={small:"sm",middle:"md"};e.s(["Divider",0,e=>{let{getPrefixCls:a,direction:l,className:o,style:c}=(0,r.useComponentConfig)("divider"),{prefixCls:g,type:m="horizontal",orientation:p="center",orientationMargin:h,className:f,rootClassName:b,children:$,dashed:y,variant:S="solid",plain:v,style:k,size:C}=e,w=d(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),I=a("divider",g),[x,O,E]=s(I),z=u[(0,i.default)(C)],j=!!$,N=t.useMemo(()=>"left"===p?"rtl"===l?"end":"start":"right"===p?"rtl"===l?"start":"end":p,[l,p]),P="start"===N&&null!=h,T="end"===N&&null!=h,M=(0,n.default)(I,o,O,E,`${I}-${m}`,{[`${I}-with-text`]:j,[`${I}-with-text-${N}`]:j,[`${I}-dashed`]:!!y,[`${I}-${S}`]:"solid"!==S,[`${I}-plain`]:!!v,[`${I}-rtl`]:"rtl"===l,[`${I}-no-default-orientation-margin-start`]:P,[`${I}-no-default-orientation-margin-end`]:T,[`${I}-${z}`]:!!z},f,b),B=t.useMemo(()=>"number"==typeof h?h:/^\d+$/.test(h)?Number(h):h,[h]);return x(t.createElement("div",Object.assign({className:M,style:Object.assign(Object.assign({},c),k)},w,{role:"separator"}),$&&"vertical"!==m&&t.createElement("span",{className:`${I}-inner-text`,style:{marginInlineStart:P?B:void 0,marginInlineEnd:T?B:void 0}},$)))}],312361)},801312,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={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"};var i=e.i(9583),a=n.forwardRef(function(e,a){return n.createElement(i.default,(0,t.default)({},e,{ref:a,icon:r}))});e.s(["default",0,a],801312)},475254,e=>{"use strict";var t=e.i(271645);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},r=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var i={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 a=(0,t.forwardRef)(({color:e="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:o="",children:c,iconNode:s,...d},u)=>(0,t.createElement)("svg",{ref:u,...i,width:n,height:n,stroke:e,strokeWidth:l?24*Number(a)/Number(n):a,className:r("lucide",o),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(d)&&{"aria-hidden":"true"},...d},[...s.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(c)?c:[c]])),l=(e,i)=>{let l=(0,t.forwardRef)(({className:l,...o},c)=>(0,t.createElement)(a,{ref:c,iconNode:i,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,l),...o}));return l.displayName=n(e),l};e.s(["default",()=>l],475254)},262218,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),r=e.i(529681),i=e.i(702779),a=e.i(563113),l=e.i(763731),o=e.i(121872),c=e.i(242064);e.i(296059);var s=e.i(915654);e.i(262370);var d=e.i(135551),u=e.i(183293),g=e.i(246422),m=e.i(838378);let p=e=>{let{lineWidth:t,fontSizeIcon:n,calc:r}=e,i=e.fontSizeSM;return(0,m.mergeToken)(e,{tagFontSize:i,tagLineHeight:(0,s.unit)(r(e.lineHeightSM).mul(i).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},h=e=>({defaultBg:new d.FastColor(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),f=(0,g.genStyleHooks)("Tag",e=>(e=>{let{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:i,calc:a}=e,l=a(r).sub(n).equal(),o=a(t).sub(n).equal();return{[i]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,s.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${i}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${i}-close-icon`]:{marginInlineStart:o,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${i}-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"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:l}}),[`${i}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(p(e)),h);var b=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 i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let $=t.forwardRef((e,r)=>{let{prefixCls:i,style:a,className:l,checked:o,children:s,icon:d,onChange:u,onClick:g}=e,m=b(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:p,tag:h}=t.useContext(c.ConfigContext),$=p("tag",i),[y,S,v]=f($),k=(0,n.default)($,`${$}-checkable`,{[`${$}-checkable-checked`]:o},null==h?void 0:h.className,l,S,v);return y(t.createElement("span",Object.assign({},m,{ref:r,style:Object.assign(Object.assign({},a),null==h?void 0:h.style),className:k,onClick:e=>{null==u||u(!o),null==g||g(e)}}),d,t.createElement("span",null,s)))});var y=e.i(403541);let S=(0,g.genSubStyleComponent)(["Tag","preset"],e=>{let t;return t=p(e),(0,y.genPresetColor)(t,(e,{textColor:n,lightBorderColor:r,lightColor:i,darkColor:a})=>({[`${t.componentCls}${t.componentCls}-${e}`]:{color:n,background:i,borderColor:r,"&-inverse":{color:t.colorTextLightSolid,background:a,borderColor:a},[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}))},h),v=(e,t,n)=>{let r="string"!=typeof n?n:n.charAt(0).toUpperCase()+n.slice(1);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${n}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},k=(0,g.genSubStyleComponent)(["Tag","status"],e=>{let t=p(e);return[v(t,"success","Success"),v(t,"processing","Info"),v(t,"error","Error"),v(t,"warning","Warning")]},h);var C=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 i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let w=t.forwardRef((e,s)=>{let{prefixCls:d,className:u,rootClassName:g,style:m,children:p,icon:h,color:b,onClose:$,bordered:y=!0,visible:v}=e,w=C(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:I,direction:x,tag:O}=t.useContext(c.ConfigContext),[E,z]=t.useState(!0),j=(0,r.default)(w,["closeIcon","closable"]);t.useEffect(()=>{void 0!==v&&z(v)},[v]);let N=(0,i.isPresetColor)(b),P=(0,i.isPresetStatusColor)(b),T=N||P,M=Object.assign(Object.assign({backgroundColor:b&&!T?b:void 0},null==O?void 0:O.style),m),B=I("tag",d),[H,L,R]=f(B),q=(0,n.default)(B,null==O?void 0:O.className,{[`${B}-${b}`]:T,[`${B}-has-color`]:b&&!T,[`${B}-hidden`]:!E,[`${B}-rtl`]:"rtl"===x,[`${B}-borderless`]:!y},u,g,L,R),G=e=>{e.stopPropagation(),null==$||$(e),e.defaultPrevented||z(!1)},[,A]=(0,a.useClosable)((0,a.pickClosable)(e),(0,a.pickClosable)(O),{closable:!1,closeIconRender:e=>{let r=t.createElement("span",{className:`${B}-close-icon`,onClick:G},e);return(0,l.replaceElement)(e,r,e=>({onClick:t=>{var n;null==(n=null==e?void 0:e.onClick)||n.call(e,t),G(t)},className:(0,n.default)(null==e?void 0:e.className,`${B}-close-icon`)}))}}),W="function"==typeof w.onClick||p&&"a"===p.type,D=h||null,X=D?t.createElement(t.Fragment,null,D,p&&t.createElement("span",null,p)):p,F=t.createElement("span",Object.assign({},j,{ref:s,className:q,style:M}),X,A,N&&t.createElement(S,{key:"preset",prefixCls:B}),P&&t.createElement(k,{key:"status",prefixCls:B}));return H(W?t.createElement(o.default,{component:"Tag"},F):F)});w.CheckableTag=$,e.s(["Tag",0,w],262218)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},790848,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(739295),r=e.i(343794),i=e.i(931067),a=e.i(211577),l=e.i(392221),o=e.i(703923),c=e.i(914949),s=e.i(404948),d=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],u=t.forwardRef(function(e,n){var u,g=e.prefixCls,m=void 0===g?"rc-switch":g,p=e.className,h=e.checked,f=e.defaultChecked,b=e.disabled,$=e.loadingIcon,y=e.checkedChildren,S=e.unCheckedChildren,v=e.onClick,k=e.onChange,C=e.onKeyDown,w=(0,o.default)(e,d),I=(0,c.default)(!1,{value:h,defaultValue:f}),x=(0,l.default)(I,2),O=x[0],E=x[1];function z(e,t){var n=O;return b||(E(n=e),null==k||k(n,t)),n}var j=(0,r.default)(m,p,(u={},(0,a.default)(u,"".concat(m,"-checked"),O),(0,a.default)(u,"".concat(m,"-disabled"),b),u));return t.createElement("button",(0,i.default)({},w,{type:"button",role:"switch","aria-checked":O,disabled:b,className:j,ref:n,onKeyDown:function(e){e.which===s.default.LEFT?z(!1,e):e.which===s.default.RIGHT&&z(!0,e),null==C||C(e)},onClick:function(e){var t=z(!O,e);null==v||v(t,e)}}),$,t.createElement("span",{className:"".concat(m,"-inner")},t.createElement("span",{className:"".concat(m,"-inner-checked")},y),t.createElement("span",{className:"".concat(m,"-inner-unchecked")},S)))});u.displayName="Switch";var g=e.i(121872),m=e.i(242064),p=e.i(937328),h=e.i(517455);e.i(296059);var f=e.i(915654);e.i(262370);var b=e.i(135551),$=e.i(183293),y=e.i(246422),S=e.i(838378);let v=(0,y.genStyleHooks)("Switch",e=>{let t=(0,S.mergeToken)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[(e=>{let{componentCls:t,trackHeight:n,trackMinWidth:r}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,$.resetComponent)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:r,height:n,lineHeight:(0,f.unit)(n),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),(0,$.genFocusStyle)(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${t}-rtl`]:{direction:"rtl"}})}})(t),(e=>{let{componentCls:t,trackHeight:n,trackPadding:r,innerMinMargin:i,innerMaxMargin:a,handleSize:l,calc:o}=e,c=`${t}-inner`,s=(0,f.unit)(o(l).add(o(r).mul(2)).equal()),d=(0,f.unit)(o(a).mul(2).equal());return{[t]:{[c]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:i,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${c}-checked, ${c}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:n},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${s} - ${d})`,marginInlineEnd:`calc(100% - ${s} + ${d})`},[`${c}-unchecked`]:{marginTop:o(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${c}`]:{paddingInlineStart:i,paddingInlineEnd:a,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${s} + ${d})`,marginInlineEnd:`calc(-100% + ${s} - ${d})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:o(r).mul(2).equal(),marginInlineEnd:o(r).mul(-1).mul(2).equal()}},[`&${t}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:o(r).mul(-1).mul(2).equal(),marginInlineEnd:o(r).mul(2).equal()}}}}}})(t),(e=>{let{componentCls:t,trackPadding:n,handleBg:r,handleShadow:i,handleSize:a,calc:l}=e,o=`${t}-handle`;return{[t]:{[o]:{position:"absolute",top:n,insetInlineStart:n,width:a,height:a,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:r,borderRadius:l(a).div(2).equal(),boxShadow:i,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${t}-checked ${o}`]:{insetInlineStart:`calc(100% - ${(0,f.unit)(l(a).add(n).equal())})`},[`&:not(${t}-disabled):active`]:{[`${o}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${o}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}})(t),(e=>{let{componentCls:t,handleSize:n,calc:r}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:"relative",top:r(r(n).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}})(t),(e=>{let{componentCls:t,trackHeightSM:n,trackPadding:r,trackMinWidthSM:i,innerMinMarginSM:a,innerMaxMarginSM:l,handleSizeSM:o,calc:c}=e,s=`${t}-inner`,d=(0,f.unit)(c(o).add(c(r).mul(2)).equal()),u=(0,f.unit)(c(l).mul(2).equal());return{[t]:{[`&${t}-small`]:{minWidth:i,height:n,lineHeight:(0,f.unit)(n),[`${t}-inner`]:{paddingInlineStart:l,paddingInlineEnd:a,[`${s}-checked, ${s}-unchecked`]:{minHeight:n},[`${s}-checked`]:{marginInlineStart:`calc(-100% + ${d} - ${u})`,marginInlineEnd:`calc(100% - ${d} + ${u})`},[`${s}-unchecked`]:{marginTop:c(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:o,height:o},[`${t}-loading-icon`]:{top:c(c(o).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:a,paddingInlineEnd:l,[`${s}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${s}-unchecked`]:{marginInlineStart:`calc(100% - ${d} + ${u})`,marginInlineEnd:`calc(-100% + ${d} - ${u})`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${(0,f.unit)(c(o).add(r).equal())})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${s}`]:{[`${s}-unchecked`]:{marginInlineStart:c(e.marginXXS).div(2).equal(),marginInlineEnd:c(e.marginXXS).mul(-1).div(2).equal()}},[`&${t}-checked ${s}`]:{[`${s}-checked`]:{marginInlineStart:c(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:c(e.marginXXS).div(2).equal()}}}}}}})(t)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,colorWhite:i}=e,a=t*n,l=r/2,o=a-4,c=l-4;return{trackHeight:a,trackHeightSM:l,trackMinWidth:2*o+8,trackMinWidthSM:2*c+4,trackPadding:2,handleBg:i,handleSize:o,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new b.FastColor("#00230b").setA(.2).toRgbString()}`,innerMinMargin:o/2,innerMaxMargin:o+2+4,innerMinMarginSM:c/2,innerMaxMarginSM:c+2+4}});var k=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 i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let C=t.forwardRef((e,i)=>{let{prefixCls:a,size:l,disabled:o,loading:s,className:d,rootClassName:f,style:b,checked:$,value:y,defaultChecked:S,defaultValue:C,onChange:w}=e,I=k(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[x,O]=(0,c.default)(!1,{value:null!=$?$:y,defaultValue:null!=S?S:C}),{getPrefixCls:E,direction:z,switch:j}=t.useContext(m.ConfigContext),N=t.useContext(p.default),P=(null!=o?o:N)||s,T=E("switch",a),M=t.createElement("div",{className:`${T}-handle`},s&&t.createElement(n.default,{className:`${T}-loading-icon`})),[B,H,L]=v(T),R=(0,h.default)(l),q=(0,r.default)(null==j?void 0:j.className,{[`${T}-small`]:"small"===R,[`${T}-loading`]:s,[`${T}-rtl`]:"rtl"===z},d,f,H,L),G=Object.assign(Object.assign({},null==j?void 0:j.style),b);return B(t.createElement(g.default,{component:"Switch",disabled:P},t.createElement(u,Object.assign({},I,{checked:x,onChange:(...e)=>{O(e[0]),null==w||w.apply(void 0,e)},prefixCls:T,className:q,style:G,disabled:P,ref:i,loadingIcon:M}))))});C.__ANT_SWITCH=!0,e.s(["Switch",0,C],790848)},38243,908286,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),r=e.i(876556);function i(e){return["small","middle","large"].includes(e)}function a(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}e.s(["isPresetSize",()=>i,"isValidGapNumber",()=>a],908286);var l=e.i(242064),o=e.i(249616),c=e.i(372409),s=e.i(246422);let d=(0,s.genStyleHooks)(["Space","Addon"],e=>[(e=>{let{componentCls:t,borderRadius:n,paddingSM:r,colorBorder:i,paddingXS:a,fontSizeLG:l,fontSizeSM:o,borderRadiusLG:s,borderRadiusSM:d,colorBgContainerDisabled:u,lineWidth:g}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:r,margin:0,background:u,borderWidth:g,borderStyle:"solid",borderColor:i,borderRadius:n,"&-large":{fontSize:l,borderRadius:s},"&-small":{paddingInline:a,borderRadius:d,fontSize:o},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0}},(0,c.genCompactItemStyle)(e,{focus:!1})]}})(e)]);var u=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 i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let g=t.default.forwardRef((e,r)=>{let{className:i,children:a,style:c,prefixCls:s}=e,g=u(e,["className","children","style","prefixCls"]),{getPrefixCls:m,direction:p}=t.default.useContext(l.ConfigContext),h=m("space-addon",s),[f,b,$]=d(h),{compactItemClassnames:y,compactSize:S}=(0,o.useCompactItemContext)(h,p),v=(0,n.default)(h,b,y,$,{[`${h}-${S}`]:S},i);return f(t.default.createElement("div",Object.assign({ref:r,className:v,style:c},g),a))}),m=t.default.createContext({latestIndex:0}),p=m.Provider,h=({className:e,index:n,children:r,split:i,style:a})=>{let{latestIndex:l}=t.useContext(m);return null==r?null:t.createElement(t.Fragment,null,t.createElement("div",{className:e,style:a},r),n{let t=(0,f.mergeToken)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[(e=>{let{componentCls:t,antCls:n}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${t}-item:empty`]:{display:"none"},[`${t}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}})(t)]},()=>({}),{resetStyle:!1});var $=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 i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let y=t.forwardRef((e,o)=>{var c;let{getPrefixCls:s,direction:d,size:u,className:g,style:m,classNames:f,styles:y}=(0,l.useComponentConfig)("space"),{size:S=null!=u?u:"small",align:v,className:k,rootClassName:C,children:w,direction:I="horizontal",prefixCls:x,split:O,style:E,wrap:z=!1,classNames:j,styles:N}=e,P=$(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[T,M]=Array.isArray(S)?S:[S,S],B=i(M),H=i(T),L=a(M),R=a(T),q=(0,r.default)(w,{keepEmpty:!0}),G=void 0===v&&"horizontal"===I?"center":v,A=s("space",x),[W,D,X]=b(A),F=(0,n.default)(A,g,D,`${A}-${I}`,{[`${A}-rtl`]:"rtl"===d,[`${A}-align-${G}`]:G,[`${A}-gap-row-${M}`]:B,[`${A}-gap-col-${T}`]:H},k,C,X),K=(0,n.default)(`${A}-item`,null!=(c=null==j?void 0:j.item)?c:f.item),U=Object.assign(Object.assign({},y.item),null==N?void 0:N.item),V=q.map((e,n)=>{let r=(null==e?void 0:e.key)||`${K}-${n}`;return t.createElement(h,{className:K,key:r,index:n,split:O,style:U},e)}),Q=t.useMemo(()=>({latestIndex:q.reduce((e,t,n)=>null!=t?n:e,0)}),[q]);if(0===q.length)return null;let _={};return z&&(_.flexWrap="wrap"),!H&&R&&(_.columnGap=T),!B&&L&&(_.rowGap=M),W(t.createElement("div",Object.assign({ref:o,className:F,style:Object.assign(Object.assign(Object.assign({},_),m),E)},P),t.createElement(p,{value:Q},V)))});y.Compact=o.default,y.Addon=g,e.s(["default",0,y],38243)},770914,e=>{"use strict";var t=e.i(38243);e.s(["Space",()=>t.default])},292639,e=>{"use strict";var t=e.i(764205),n=e.i(266027);let r=(0,e.i(243652).createQueryKeys)("uiSettings");e.s(["useUISettings",0,()=>(0,n.useQuery)({queryKey:r.list({}),queryFn:async()=>await (0,t.getUiSettings)(),staleTime:36e5,gcTime:36e5})])},250980,e=>{"use strict";var t=e.i(271645);let n=t.forwardRef(function(e,n){return t.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:n},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["PlusCircleIcon",0,n],250980)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/052aaa8d01e02cd3.js b/litellm/proxy/_experimental/out/_next/static/chunks/052aaa8d01e02cd3.js
deleted file mode 100644
index b20ca34844..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/052aaa8d01e02cd3.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,519756,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={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"};var s=e.i(9583),n=r.forwardRef(function(e,n){return r.createElement(s.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["UploadOutlined",0,n],519756)},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},500330,e=>{"use strict";var t=e.i(727749);function r(e,t){let r=structuredClone(e);for(let[e,i]of Object.entries(t))e in r&&(r[e]=i);return r}let i=(e,t=0,r=!1,i=!0)=>{if(null==e||!Number.isFinite(e)||0===e&&!i)return"-";let s={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",s);let n=e<0?"-":"",a=Math.abs(e),l=a,o="";return a>=1e6?(l=a/1e6,o="M"):a>=1e3&&(l=a/1e3,o="K"),`${n}${l.toLocaleString("en-US",s)}${o}`},s=async(e,r="Copied to clipboard")=>{if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return n(e,r);try{return await navigator.clipboard.writeText(e),t.default.success(r),!0}catch(t){return console.error("Clipboard API failed: ",t),n(e,r)}},n=(e,r)=>{try{let i=document.createElement("textarea");i.value=e,i.style.position="fixed",i.style.left="-999999px",i.style.top="-999999px",i.setAttribute("readonly",""),document.body.appendChild(i),i.focus(),i.select();let s=document.execCommand("copy");if(document.body.removeChild(i),s)return t.default.success(r),!0;throw Error("execCommand failed")}catch(e){return t.default.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};e.s(["copyToClipboard",0,s,"formatNumberWithCommas",0,i,"getSpendString",0,(e,t=6)=>{if(null==e||!Number.isFinite(e)||0===e)return"-";let r=i(e,t,!1,!1);if(0===Number(r.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return`< $${e}`}return`$${r}`},"updateExistingKeys",()=>r])},663435,152473,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(199133),s=e.i(898586),n=e.i(56456);let a={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class l{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...a,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function o(e,t){let[i,s]=(0,r.useState)(e),n=function(e,t){let[i]=(0,r.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new l(e,t))).filter(e=>"function"==typeof r[e]).reduce((e,t)=>{let i=r[t];return"function"==typeof i&&(e[t]=i.bind(r)),e},{})});return i.setOptions(t),i}(s,t);return[i,n.maybeExecute,n]}e.s(["useDebouncedState",()=>o],152473);var d=e.i(785242);let{Text:c}=s.Typography;e.s(["default",0,({value:e,onChange:s,onTeamSelect:a,disabled:l,organizationId:u,pageSize:h=20})=>{let[m,f]=(0,r.useState)(""),[p,x]=o("",{wait:300}),{data:g,fetchNextPage:y,hasNextPage:_,isFetchingNextPage:b,isLoading:v}=(0,d.useInfiniteTeams)(h,p||void 0,u),j=(0,r.useMemo)(()=>{if(!g?.pages)return[];let e=new Set,t=[];for(let r of g.pages)for(let i of r.teams)e.has(i.team_id)||(e.add(i.team_id),t.push(i));return t},[g]);return(0,t.jsx)(i.Select,{showSearch:!0,placeholder:"Search or select a team",value:e||void 0,onChange:e=>{s?.(e??""),a&&a(e?j.find(t=>t.team_id===e)??null:null)},disabled:l,allowClear:!0,filterOption:!1,onSearch:e=>{f(e),x(e)},searchValue:m,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&_&&!b&&y()},loading:v,notFoundContent:v?(0,t.jsx)(n.LoadingOutlined,{spin:!0}):"No teams found","data-testid":"team-dropdown",popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,b&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(n.LoadingOutlined,{spin:!0})})]}),children:j.map(e=>(0,t.jsxs)(i.Select.Option,{value:e.team_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,t.jsxs)(c,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})}],663435)},743151,(e,t,r)=>{"use strict";function i(e){return(i="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)}Object.defineProperty(r,"__esModule",{value:!0}),r.CopyToClipboard=void 0;var s=l(e.r(271645)),n=l(e.r(844343)),a=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function d(e){for(var t=1;t=0||(s[r]=e[r]);return s}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,a),i=s.default.Children.only(t);return s.default.cloneElement(i,d(d({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r{"use strict";var i=e.r(743151).CopyToClipboard;i.CopyToClipboard=i,t.exports=i},59935,(e,t,r)=>{var i;let s;e.e,i=function e(){var t,r="u">typeof self?self:"u">typeof window?window:void 0!==r?r:{},i=!r.document&&!!r.postMessage,s=r.IS_PAPA_WORKER||!1,n={},a=0,l={};function o(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=_(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new m(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview,s)r.postMessage({results:n,workerId:l.WORKER_ID,finished:i});else if(v(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=n=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!i||!v(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),i||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){v(this._config.error)?this._config.error(e):s&&this._config.error&&r.postMessage({workerId:l.WORKER_ID,error:e,finished:!1})}}function d(e){var t;(e=e||{}).chunkSize||(e.chunkSize=l.RemoteChunkSize),o.call(this,e),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),i||(t.onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var e,r,s=this._config.downloadRequestHeaders;for(r in s)t.setRequestHeader(r,s[r])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}i&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function c(e){(e=e||{}).chunkSize||(e.chunkSize=l.LocalChunkSize),o.call(this,e);var t,r,i="u">typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,i?((t=new FileReader).onload=b(this._chunkLoaded,this),t.onerror=b(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function u(e){var t;o.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,r;if(!this._finished)return t=(e=this._config.chunkSize)?(r=t.substring(0,e),t.substring(e)):(r=t,""),this._finished=!t,this.parseChunk(r)}}function h(e){o.call(this,e=e||{});var t=[],r=!0,i=!1;this.pause=function(){o.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){o.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=b(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=b(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=b(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=b(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function m(e){var t,r,i,s,n=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,o=this,d=0,c=0,u=!1,h=!1,m=[],x={data:[],errors:[],meta:{}};function g(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(x&&i&&(j("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),i=!1),e.skipEmptyLines&&(x.data=x.data.filter(function(e){return!g(e)})),b()){if(x)if(Array.isArray(x.data[0])){for(var t,r=0;b()&&r(e.dynamicTypingFunction&&void 0===e.dynamicTyping[t]&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping))?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&((e=>{if(n.test(e)&&-0x20000000000000<(e=parseFloat(e))&&e<0x20000000000000)return 1})(r)?parseFloat(r):a.test(r)?new Date(r):""===r?null:r):r)(l=e.header?s>=m.length?"__parsed_extra":m[s]:l,o=e.transform?e.transform(o,l):o);"__parsed_extra"===l?(i[l]=i[l]||[],i[l].push(o)):i[l]=o}return e.header&&(s>m.length?j("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+s,c+r):se.preview?r.abort():(x.data=x.data[0],s(x,o))))}),this.parse=function(s,n,a){var o=e.quoteChar||'"',o=(e.newline||(e.newline=this.guessLineEndings(s,o)),i=!1,e.delimiter?v(e.delimiter)&&(e.delimiter=e.delimiter(s),x.meta.delimiter=e.delimiter):((o=((t,r,i,s,n)=>{var a,o,d,c;n=n||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var u=0;u=r.length/2?"\r\n":"\r"}}function f(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(e){var t=(e=e||{}).delimiter,r=e.newline,i=e.comments,s=e.step,n=e.preview,a=e.fastMode,o=null,d=!1,c=null==e.quoteChar?'"':e.quoteChar,u=c;if(void 0!==e.escapeChar&&(u=e.escapeChar),("string"!=typeof t||-1=n)return D(!0);break}C.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:w.length,index:h}),R++}}else if(i&&0===k.length&&l.substring(h,h+b)===i){if(-1===I)return D();h=I+_,I=l.indexOf(r,h),E=l.indexOf(t,h)}else if(-1!==E&&(E=n)return D(!0)}return A();function F(e){w.push(e),S=h}function P(e){return -1!==e&&(e=l.substring(R+1,e))&&""===e.trim()?e.length:0}function A(e){return x||(void 0===e&&(e=l.substring(h)),k.push(e),h=g,F(k),j&&M()),D()}function U(e){h=e,F(k),k=[],I=l.indexOf(r,h)}function D(i){if(e.header&&!p&&w.length&&!d){var s=w[0],n=Object.create(null),a=new Set(s);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||l.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(s=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(r=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(d=t.skipEmptyLines),"string"==typeof t.newline&&(n=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(i=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");c=t.columns}void 0!==t.escapeChar&&(o=t.escapeChar+a),t.escapeFormulae instanceof RegExp?u=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(u=/^[=+\-@\t\r].*$/)}})(),RegExp(f(a),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return m(null,e,d);if("object"==typeof e[0])return m(c||Object.keys(e[0]),e,d)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||c),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),m(e.fields||[],e.data||[],d);throw Error("Unable to serialize unrecognized input");function m(e,t,r){var a="",l=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var r=0;r{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={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"};var s=e.i(9583),n=r.forwardRef(function(e,n){return r.createElement(s.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["WarningOutlined",0,n],285027)},213205,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-add",theme:"outlined"};var s=e.i(9583),n=r.forwardRef(function(e,n){return r.createElement(s.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["UserAddOutlined",0,n],213205)},355619,e=>{"use strict";var t=e.i(764205);let r=async(e,r,i)=>{try{if(null===e||null===r)return;if(null!==i){let s=(await (0,t.modelAvailableCall)(i,e,r,!0,null,!0)).data.map(e=>e.id),n=[],a=[];return s.forEach(e=>{e.endsWith("/*")?n.push(e):a.push(e)}),[...n,...a]}}catch(e){console.error("Error fetching user models:",e)}};e.s(["fetchAvailableModelsForTeamOrKey",0,r,"getModelDisplayName",0,e=>{if("all-proxy-models"===e)return"All Proxy Models";if(e.endsWith("/*")){let t=e.replace("/*","");return`All ${t} models`}return e},"unfurlWildcardModelsInList",0,(e,t)=>{let r=[],i=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let s=e.replace("/*",""),n=t.filter(e=>e.startsWith(s+"/"));i.push(...n),r.push(e)}else i.push(e)}),[...r,...i].filter((e,t,r)=>r.indexOf(e)===t)}])},860585,e=>{"use strict";var t=e.i(843476),r=e.i(199133);let{Option:i}=r.Select;e.s(["default",0,({value:e,onChange:s,className:n="",style:a={}})=>(0,t.jsxs)(r.Select,{style:{width:"100%",...a},value:e||void 0,onChange:s,className:n,placeholder:"n/a",allowClear:!0,children:[(0,t.jsx)(i,{value:"1h",children:"hourly"}),(0,t.jsx)(i,{value:"24h",children:"daily"}),(0,t.jsx)(i,{value:"7d",children:"weekly"}),(0,t.jsx)(i,{value:"30d",children:"monthly"})]}),"getBudgetDurationLabel",0,e=>e?({"1h":"hourly","24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set"])},447082,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(599724),s=e.i(464571),n=e.i(212931),a=e.i(291542),l=e.i(515831),o=e.i(898586),d=e.i(519756),c=e.i(737434),u=e.i(285027),h=e.i(993914),m=e.i(955135);e.i(247167);var f=e.i(931067);let p={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"};var x=e.i(9583),g=r.forwardRef(function(e,t){return r.createElement(x.default,(0,f.default)({},e,{ref:t,icon:p}))}),y=e.i(764205),_=e.i(59935),b=e.i(220508),v=e.i(964306);let j=r.forwardRef(function(e,t){return r.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),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});var w=e.i(237016),C=e.i(727749);e.s(["default",0,({accessToken:e,teams:f,possibleUIRoles:p,onUsersCreated:x})=>{let[k,S]=(0,r.useState)(!1),[N,O]=(0,r.useState)([]),[E,I]=(0,r.useState)(!1),[T,R]=(0,r.useState)(null),[L,F]=(0,r.useState)(null),[P,A]=(0,r.useState)(null),[U,D]=(0,r.useState)(null),[M,z]=(0,r.useState)(null),[B,V]=(0,r.useState)("http://localhost:4000");(0,r.useEffect)(()=>{(async()=>{try{let t=await (0,y.getProxyUISettings)(e);z(t)}catch(e){console.error("Error fetching UI settings:",e)}})(),V(new URL("/",window.location.href).toString())},[e]);let $=async()=>{I(!0);let t=N.map(e=>({...e,status:"pending"}));O(t);let r=!1;for(let i=0;ie.trim()).filter(Boolean),0===t.teams.length&&delete t.teams),s.models&&"string"==typeof s.models&&""!==s.models.trim()&&(t.models=s.models.split(",").map(e=>e.trim()).filter(Boolean),0===t.models.length&&delete t.models),s.max_budget&&""!==s.max_budget.toString().trim()){let e=parseFloat(s.max_budget.toString());!isNaN(e)&&e>0&&(t.max_budget=e)}s.budget_duration&&""!==s.budget_duration.trim()&&(t.budget_duration=s.budget_duration.trim()),s.metadata&&"string"==typeof s.metadata&&""!==s.metadata.trim()&&(t.metadata=s.metadata.trim()),console.log("Sending user data:",t);let n=await (0,y.userCreateCall)(e,null,t);if(console.log("Full response:",n),n&&(n.key||n.user_id)){r=!0,console.log("Success case triggered");let t=n.data?.user_id||n.user_id;try{if(M?.SSO_ENABLED){let e=new URL("/ui",B).toString();O(t=>t.map((t,r)=>r===i?{...t,status:"success",key:n.key||n.user_id,invitation_link:e}:t))}else{let r=await (0,y.invitationCreateCall)(e,t),s=new URL(`/ui?invitation_id=${r.id}`,B).toString();O(e=>e.map((e,t)=>t===i?{...e,status:"success",key:n.key||n.user_id,invitation_link:s}:e))}}catch(e){console.error("Error creating invitation:",e),O(e=>e.map((e,t)=>t===i?{...e,status:"success",key:n.key||n.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=n?.error||"Failed to create user";console.log("Error message:",e),O(t=>t.map((t,r)=>r===i?{...t,status:"failed",error:e}:t))}}catch(t){console.error("Caught error:",t);let e=t?.response?.data?.error||t?.message||String(t);O(t=>t.map((t,r)=>r===i?{...t,status:"failed",error:e}:t))}}I(!1),r&&x&&x()},q=[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,r)=>r.isValid?r.status&&"pending"!==r.status?"success"===r.status?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(b.CheckCircleIcon,{className:"h-5 w-5 text-green-500 mr-2"}),(0,t.jsx)("span",{className:"text-green-500",children:"Success"})]}),r.invitation_link&&(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:r.invitation_link}),(0,t.jsx)(w.CopyToClipboard,{text:r.invitation_link,onCopy:()=>C.default.success("Invitation link copied!"),children:(0,t.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(v.XCircleIcon,{className:"h-5 w-5 text-red-500 mr-2"}),(0,t.jsx)("span",{className:"text-red-500",children:"Failed"})]}),r.error&&(0,t.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(r.error)})]}):(0,t.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(v.XCircleIcon,{className:"h-5 w-5 text-red-500 mr-2"}),(0,t.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),r.error&&(0,t.jsx)("span",{className:"text-sm text-red-500 ml-7",children:r.error})]})}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Button,{type:"primary",className:"mb-0",onClick:()=>S(!0),children:"+ Bulk Invite Users"}),(0,t.jsx)(n.Modal,{title:"Bulk Invite Users",open:k,width:800,onCancel:()=>S(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,t.jsx)("div",{className:"flex flex-col",children:0===N.length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,t.jsxs)("div",{className:"ml-11 mb-6",children:[(0,t.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,t.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,t.jsx)("li",{children:"Download our CSV template"}),(0,t.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,t.jsx)("li",{children:"Save the file and upload it here"}),(0,t.jsx)("li",{children:"After creation, download the results file containing the Virtual Keys for each user"})]}),(0,t.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"user_email"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"user_role"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"teams"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"models"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,t.jsx)(s.Button,{type:"primary",size:"large",className:"w-full md:w-auto",icon:(0,t.jsx)(c.DownloadOutlined,{}),children:"Download CSV Template"})]}),(0,t.jsxs)("div",{className:"flex items-center mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,t.jsxs)("div",{className:"ml-11",children:[U?(0,t.jsxs)("div",{className:`mb-4 p-4 rounded-md border ${P?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[P?(0,t.jsx)(g,{className:"text-red-500 text-xl mr-3"}):(0,t.jsx)(h.FileTextOutlined,{className:"text-blue-500 text-xl mr-3"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Typography.Text,{strong:!0,className:P?"text-red-800":"text-blue-800",children:U.name}),(0,t.jsxs)(o.Typography.Text,{className:`block text-xs ${P?"text-red-600":"text-blue-600"}`,children:[(U.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,t.jsx)(s.Button,{size:"small",onClick:()=>{D(null),O([]),R(null),F(null),A(null)},className:"flex items-center",icon:(0,t.jsx)(m.DeleteOutlined,{}),children:"Remove"})]}),P?(0,t.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,t.jsx)(u.WarningOutlined,{className:"mr-2 mt-0.5"}),(0,t.jsx)("span",{children:P})]}):!L&&(0,t.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,t.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,t.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,t.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,t.jsx)(l.Upload,{beforeUpload:e=>((R(null),F(null),A(null),D(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?A(`File is too large (${(e.size/1048576).toFixed(1)} MB). Please upload a CSV file smaller than 5MB.`):_.default.parse(e,{complete:e=>{if(!e.data||0===e.data.length){F("The CSV file appears to be empty. Please upload a file with data."),O([]);return}if(1===e.data.length){F("The CSV file only contains headers but no user data. Please add user data to your CSV."),O([]);return}let t=e.data[0];if(0===t.length||1===t.length&&""===t[0]){F("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),O([]);return}let r=["user_email","user_role"].filter(e=>!t.includes(e));if(r.length>0){F(`Your CSV is missing these required columns: ${r.join(", ")}. Please add these columns to your CSV file.`),O([]);return}try{let r=e.data.slice(1).map((e,r)=>{if(0===e.length||1===e.length&&""===e[0])return null;if(e.length=parseFloat(i.max_budget.toString())&&s.push("Max budget must be greater than 0")),i.budget_duration&&!i.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&s.push(`Invalid budget duration format "${i.budget_duration}". Use format like "30d", "1mo", "2w", "6h"`),i.teams&&"string"==typeof i.teams&&f&&f.length>0){let e=f.map(e=>e.team_id),t=i.teams.split(",").map(e=>e.trim()).filter(t=>!e.includes(t));t.length>0&&s.push(`Unknown team(s): ${t.join(", ")}`)}return s.length>0&&(i.isValid=!1,i.error=s.join(", ")),i}).filter(Boolean),i=r.filter(e=>e.isValid);O(r),0===r.length?F("No valid data rows found in the CSV file. Please check your file format."):0===i.length?R("No valid users found in the CSV. Please check the errors below and fix your CSV file."):i.length{R(`Failed to parse CSV file: ${e.message}`),O([])},header:!1}):(A(`Invalid file type: ${e.name}. Please upload a CSV file (.csv extension).`),C.default.fromBackend("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,t.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,t.jsx)(d.UploadOutlined,{className:"text-3xl text-gray-400 mb-2"}),(0,t.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,t.jsx)(s.Button,{size:"small",children:"Browse files"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),L&&(0,t.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)(j,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Typography.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,t.jsx)(o.Typography.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:L}),(0,t.jsx)(o.Typography.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:N.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),T&&(0,t.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)(u.WarningOutlined,{className:"text-red-500 mr-2 mt-1"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Text,{className:"text-red-600 font-medium",children:T}),N.some(e=>!e.isValid)&&(0,t.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,t.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,t.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,t.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,t.jsxs)("div",{className:"ml-11",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,t.jsx)("div",{className:"flex items-center",children:N.some(e=>"success"===e.status||"failed"===e.status)?(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(i.Text,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,t.jsxs)(i.Text,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[N.filter(e=>"success"===e.status).length," Successful"]}),N.some(e=>"failed"===e.status)&&(0,t.jsxs)(i.Text,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[N.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(i.Text,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,t.jsxs)(i.Text,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[N.filter(e=>e.isValid).length," of ",N.length," users valid"]})]})}),!N.some(e=>"success"===e.status||"failed"===e.status)&&(0,t.jsxs)("div",{className:"flex space-x-3",children:[(0,t.jsx)(s.Button,{onClick:()=>{O([]),R(null)},children:"Back"}),(0,t.jsx)(s.Button,{type:"primary",onClick:$,disabled:0===N.filter(e=>e.isValid).length||E,children:E?"Creating...":`Create ${N.filter(e=>e.isValid).length} Users`})]})]}),N.some(e=>"success"===e.status)&&(0,t.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"mr-3 mt-1",children:(0,t.jsx)(b.CheckCircleIcon,{className:"h-5 w-5 text-blue-500"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Text,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,t.jsxs)(i.Text,{className:"block text-sm text-blue-700 mt-1",children:[(0,t.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing Virtual Keys and invitation links. Users will need these Virtual Keys to make LLM requests through LiteLLM."]})]})]})}),(0,t.jsx)(a.Table,{dataSource:N,columns:q,size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!N.some(e=>"success"===e.status||"failed"===e.status)&&(0,t.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,t.jsx)(s.Button,{onClick:()=>{O([]),R(null)},className:"mr-3",children:"Back"}),(0,t.jsx)(s.Button,{type:"primary",onClick:$,disabled:0===N.filter(e=>e.isValid).length||E,children:E?"Creating...":`Create ${N.filter(e=>e.isValid).length} Users`})]}),N.some(e=>"success"===e.status||"failed"===e.status)&&(0,t.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,t.jsx)(s.Button,{onClick:()=>{O([]),R(null)},className:"mr-3",children:"Start New Bulk Import"}),(0,t.jsx)(s.Button,{type:"primary",onClick:()=>{let e=N.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),t=new Blob([_.default.unparse(e)],{type:"text/csv"}),r=window.URL.createObjectURL(t),i=document.createElement("a");i.href=r,i.download="bulk_users_results.csv",document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)},icon:(0,t.jsx)(c.DownloadOutlined,{}),children:"Download User Credentials"})]})]})]})})})]})}],447082)},371455,172372,e=>{"use strict";var t=e.i(843476),r=e.i(827252),i=e.i(213205),s=e.i(912598),n=e.i(109799),a=e.i(677667),l=e.i(130643),o=e.i(898667),d=e.i(35983),c=e.i(779241),u=e.i(560445),h=e.i(464571),m=e.i(536916),f=e.i(808613),p=e.i(311451),x=e.i(212931),g=e.i(199133),y=e.i(770914),_=e.i(592968),b=e.i(898586),v=e.i(271645),j=e.i(447082),w=e.i(663435),C=e.i(355619),k=e.i(727749),S=e.i(764205),N=e.i(237016),O=e.i(599724);function E({isInvitationLinkModalVisible:e,setIsInvitationLinkModalVisible:r,baseUrl:i,invitationLinkData:s,modalType:n="invitation"}){let{Title:a,Paragraph:l}=b.Typography,o=()=>{if(!i)return"";let e=new URL(i).pathname,t=e&&"/"!==e?`${e}/ui`:"ui";if(s?.has_user_setup_sso)return new URL(t,i).toString();let r=`${t}?invitation_id=${s?.id}`;return"resetPassword"===n&&(r+="&action=reset_password"),new URL(r,i).toString()};return(0,t.jsxs)(x.Modal,{title:"invitation"===n?"Invitation Link":"Reset Password Link",open:e,width:800,footer:null,onOk:()=>{r(!1)},onCancel:()=>{r(!1)},children:[(0,t.jsx)(l,{children:"invitation"===n?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,t.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,t.jsx)(O.Text,{className:"text-base",children:"User ID"}),(0,t.jsx)(O.Text,{children:s?.user_id})]}),(0,t.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,t.jsx)(O.Text,{children:"invitation"===n?"Invitation Link":"Reset Password Link"}),(0,t.jsx)(O.Text,{children:(0,t.jsx)(O.Text,{children:o()})})]}),(0,t.jsx)("div",{className:"flex justify-end mt-5",children:(0,t.jsx)(N.CopyToClipboard,{text:o(),onCopy:()=>k.default.success("Copied!"),children:(0,t.jsx)(h.Button,{type:"primary",children:"invitation"===n?"Copy invitation link":"Copy password reset link"})})})]})}e.s(["default",()=>E],172372);let{Option:I}=g.Select,{Text:T,Link:R,Title:L}=b.Typography;e.s(["CreateUserButton",0,({userID:e,accessToken:b,teams:N,possibleUIRoles:O,onUserCreated:L,isEmbedded:F=!1})=>{let P=(0,s.useQueryClient)(),[A,U]=(0,v.useState)(null),[D]=f.Form.useForm(),[M,z]=(0,v.useState)(!1),[B,V]=(0,v.useState)(!1),[$,q]=(0,v.useState)([]),[K,W]=(0,v.useState)(!1),[H,Q]=(0,v.useState)(null),[J,G]=(0,v.useState)(null),{data:X=[]}=(0,n.useOrganizations)();(0,v.useMemo)(()=>{let e=X.flatMap(e=>e.teams||[]);return e.length>0?e:N||[]},[X,N]),(0,v.useEffect)(()=>{let t=async()=>{try{let t=await (0,S.modelAvailableCall)(b,e,"any"),r=[];for(let e=0;e{try{k.default.info("Making API Call"),F||z(!0),t.models&&0!==t.models.length||"proxy_admin"===t.user_role||(t.models=["no-default-models"]),t.organization_ids&&(t.organizations=t.organization_ids,delete t.organization_ids);let r=await (0,S.userCreateCall)(b,null,t);await P.invalidateQueries({queryKey:["userList"]}),V(!0);let i=r.data?.user_id||r.user_id;if(L&&F){L(i),D.resetFields();return}if(A?.SSO_ENABLED){let t={id:"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),user_id:i,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:e,updated_at:new Date,updated_by:e,has_user_setup_sso:!0};Q(t),W(!0)}else(0,S.invitationCreateCall)(b,i).then(e=>{e.has_user_setup_sso=!1,Q(e),W(!0)});k.default.success("API user Created"),D.resetFields(),localStorage.removeItem("userData"+e)}catch(t){let e=t.response?.data?.detail||t?.message||"Error creating the user";k.default.fromBackend(e),console.error("Error creating the user:",t)}};return F?(0,t.jsxs)(f.Form,{form:D,onFinish:Y,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{user_role:"internal_user_viewer",send_invite_email:!0},children:[(0,t.jsx)(u.Alert,{message:"Email invitations",description:(0,t.jsxs)(t.Fragment,{children:["New users receive an email invite only when an email integration (SMTP, Resend, or SendGrid) is configured."," ",(0,t.jsx)(R,{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",children:"Learn how to set up email notifications"})]}),type:"info",showIcon:!0,className:"mb-4"}),(0,t.jsx)(f.Form.Item,{label:"User Email",name:"user_email",children:(0,t.jsx)(c.TextInput,{placeholder:""})}),(0,t.jsx)(f.Form.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(g.Select,{children:O&&Object.entries(O).map(([e,{ui_label:r,description:i}])=>(0,t.jsx)(d.SelectItem,{value:e,title:r,children:(0,t.jsxs)("div",{className:"flex",children:[r," ",(0,t.jsx)(T,{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:i})]})},e))})}),(0,t.jsx)(f.Form.Item,{label:"Team",name:"team_id",children:(0,t.jsx)(w.default,{})}),(0,t.jsx)(f.Form.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(p.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(f.Form.Item,{label:"Send invitation email",name:"send_invite_email",valuePropName:"checked",children:(0,t.jsx)(m.Checkbox,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(h.Button,{htmlType:"submit",children:"Create User"})})]}):(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(h.Button,{type:"primary",className:"mb-0",onClick:()=>z(!0),children:"+ Invite User"}),(0,t.jsx)(j.default,{accessToken:b,teams:N,possibleUIRoles:O}),(0,t.jsxs)(x.Modal,{title:"Invite User",open:M,width:800,footer:null,onOk:()=>{z(!1),D.resetFields()},onCancel:()=>{z(!1),V(!1),D.resetFields()},children:[(0,t.jsxs)(y.Space,{direction:"vertical",size:"middle",children:[(0,t.jsx)(T,{className:"mb-1",children:"Create a User who can own keys"}),(0,t.jsx)(u.Alert,{message:"Email invitations",description:(0,t.jsxs)(t.Fragment,{children:["New users receive an email invite only when an email integration (SMTP, Resend, or SendGrid) is configured."," ",(0,t.jsx)(R,{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",children:"Learn how to set up email notifications"})]}),type:"info",showIcon:!0,className:"mb-4"})]}),(0,t.jsxs)(f.Form,{form:D,onFinish:Y,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{user_role:"internal_user_viewer",send_invite_email:!0},children:[(0,t.jsx)(f.Form.Item,{label:"User Email",name:"user_email",children:(0,t.jsx)(p.Input,{})}),(0,t.jsx)(f.Form.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(_.Tooltip,{title:"This role is independent of any team/org specific roles. Configure Team / Organization Admins in the Settings",children:(0,t.jsx)(r.InfoCircleOutlined,{})})]}),name:"user_role",children:(0,t.jsx)(g.Select,{children:O&&Object.entries(O).map(([e,{ui_label:r,description:i}])=>(0,t.jsxs)(d.SelectItem,{value:e,title:r,children:[(0,t.jsx)(T,{children:r}),(0,t.jsxs)(T,{type:"secondary",children:[" - ",i]})]},e))})}),(0,t.jsx)(f.Form.Item,{label:"Team",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,t.jsx)(w.default,{})}),(0,t.jsx)(f.Form.Item,{label:"Organization",name:"organization_ids",help:"The user will be added to the selected organization(s).",children:(0,t.jsx)(g.Select,{mode:"multiple",placeholder:"Select Organization",style:{width:"100%"},children:X.map(e=>(0,t.jsxs)(I,{value:e.organization_id,children:[e.organization_alias," (",e.organization_id,")"]},e.organization_id))})}),(0,t.jsx)(f.Form.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(p.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(f.Form.Item,{label:"Send invitation email",name:"send_invite_email",valuePropName:"checked",children:(0,t.jsx)(m.Checkbox,{})}),(0,t.jsxs)(a.Accordion,{children:[(0,t.jsx)(o.AccordionHeader,{children:(0,t.jsx)(T,{strong:!0,children:"Personal Key Creation"})}),(0,t.jsx)(l.AccordionBody,{children:(0,t.jsx)(f.Form.Item,{className:"gap-2",label:(0,t.jsxs)("span",{children:["Models"," ",(0,t.jsx)(_.Tooltip,{title:"Models user has access to, outside of team scope.",children:(0,t.jsx)(r.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,t.jsxs)(g.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,t.jsx)(g.Select.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(g.Select.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),$.map(e=>(0,t.jsx)(g.Select.Option,{value:e,children:(0,C.getModelDisplayName)(e)},e))]})})})]}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(h.Button,{type:"primary",icon:(0,t.jsx)(i.UserAddOutlined,{}),htmlType:"submit",children:"Invite User"})})]})]}),B&&(0,t.jsx)(E,{isInvitationLinkModalVisible:K,setIsInvitationLinkModalVisible:W,baseUrl:J||"",invitationLinkData:H})]})}],371455)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/05d900c88781d712.js b/litellm/proxy/_experimental/out/_next/static/chunks/05d900c88781d712.js
deleted file mode 100644
index cdf2168b93..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/05d900c88781d712.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},790848,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(739295),n=e.i(343794),a=e.i(931067),i=e.i(211577),l=e.i(392221),o=e.i(703923),c=e.i(914949),d=e.i(404948),s=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],u=t.forwardRef(function(e,r){var u,g=e.prefixCls,m=void 0===g?"rc-switch":g,p=e.className,h=e.checked,f=e.defaultChecked,b=e.disabled,$=e.loadingIcon,v=e.checkedChildren,y=e.unCheckedChildren,C=e.onClick,S=e.onChange,k=e.onKeyDown,w=(0,o.default)(e,s),x=(0,c.default)(!1,{value:h,defaultValue:f}),I=(0,l.default)(x,2),O=I[0],E=I[1];function N(e,t){var r=O;return b||(E(r=e),null==S||S(r,t)),r}var z=(0,n.default)(m,p,(u={},(0,i.default)(u,"".concat(m,"-checked"),O),(0,i.default)(u,"".concat(m,"-disabled"),b),u));return t.createElement("button",(0,a.default)({},w,{type:"button",role:"switch","aria-checked":O,disabled:b,className:z,ref:r,onKeyDown:function(e){e.which===d.default.LEFT?N(!1,e):e.which===d.default.RIGHT&&N(!0,e),null==k||k(e)},onClick:function(e){var t=N(!O,e);null==C||C(t,e)}}),$,t.createElement("span",{className:"".concat(m,"-inner")},t.createElement("span",{className:"".concat(m,"-inner-checked")},v),t.createElement("span",{className:"".concat(m,"-inner-unchecked")},y)))});u.displayName="Switch";var g=e.i(121872),m=e.i(242064),p=e.i(937328),h=e.i(517455);e.i(296059);var f=e.i(915654);e.i(262370);var b=e.i(135551),$=e.i(183293),v=e.i(246422),y=e.i(838378);let C=(0,v.genStyleHooks)("Switch",e=>{let t=(0,y.mergeToken)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[(e=>{let{componentCls:t,trackHeight:r,trackMinWidth:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,$.resetComponent)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:n,height:r,lineHeight:(0,f.unit)(r),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),(0,$.genFocusStyle)(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${t}-rtl`]:{direction:"rtl"}})}})(t),(e=>{let{componentCls:t,trackHeight:r,trackPadding:n,innerMinMargin:a,innerMaxMargin:i,handleSize:l,calc:o}=e,c=`${t}-inner`,d=(0,f.unit)(o(l).add(o(n).mul(2)).equal()),s=(0,f.unit)(o(i).mul(2).equal());return{[t]:{[c]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:i,paddingInlineEnd:a,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${c}-checked, ${c}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:r},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${d} - ${s})`,marginInlineEnd:`calc(100% - ${d} + ${s})`},[`${c}-unchecked`]:{marginTop:o(r).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${c}`]:{paddingInlineStart:a,paddingInlineEnd:i,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${d} + ${s})`,marginInlineEnd:`calc(-100% + ${d} - ${s})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:o(n).mul(2).equal(),marginInlineEnd:o(n).mul(-1).mul(2).equal()}},[`&${t}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:o(n).mul(-1).mul(2).equal(),marginInlineEnd:o(n).mul(2).equal()}}}}}})(t),(e=>{let{componentCls:t,trackPadding:r,handleBg:n,handleShadow:a,handleSize:i,calc:l}=e,o=`${t}-handle`;return{[t]:{[o]:{position:"absolute",top:r,insetInlineStart:r,width:i,height:i,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:n,borderRadius:l(i).div(2).equal(),boxShadow:a,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${t}-checked ${o}`]:{insetInlineStart:`calc(100% - ${(0,f.unit)(l(i).add(r).equal())})`},[`&:not(${t}-disabled):active`]:{[`${o}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${o}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}})(t),(e=>{let{componentCls:t,handleSize:r,calc:n}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:"relative",top:n(n(r).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}})(t),(e=>{let{componentCls:t,trackHeightSM:r,trackPadding:n,trackMinWidthSM:a,innerMinMarginSM:i,innerMaxMarginSM:l,handleSizeSM:o,calc:c}=e,d=`${t}-inner`,s=(0,f.unit)(c(o).add(c(n).mul(2)).equal()),u=(0,f.unit)(c(l).mul(2).equal());return{[t]:{[`&${t}-small`]:{minWidth:a,height:r,lineHeight:(0,f.unit)(r),[`${t}-inner`]:{paddingInlineStart:l,paddingInlineEnd:i,[`${d}-checked, ${d}-unchecked`]:{minHeight:r},[`${d}-checked`]:{marginInlineStart:`calc(-100% + ${s} - ${u})`,marginInlineEnd:`calc(100% - ${s} + ${u})`},[`${d}-unchecked`]:{marginTop:c(r).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:o,height:o},[`${t}-loading-icon`]:{top:c(c(o).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:i,paddingInlineEnd:l,[`${d}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${d}-unchecked`]:{marginInlineStart:`calc(100% - ${s} + ${u})`,marginInlineEnd:`calc(-100% + ${s} - ${u})`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${(0,f.unit)(c(o).add(n).equal())})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${d}`]:{[`${d}-unchecked`]:{marginInlineStart:c(e.marginXXS).div(2).equal(),marginInlineEnd:c(e.marginXXS).mul(-1).div(2).equal()}},[`&${t}-checked ${d}`]:{[`${d}-checked`]:{marginInlineStart:c(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:c(e.marginXXS).div(2).equal()}}}}}}})(t)]},e=>{let{fontSize:t,lineHeight:r,controlHeight:n,colorWhite:a}=e,i=t*r,l=n/2,o=i-4,c=l-4;return{trackHeight:i,trackHeightSM:l,trackMinWidth:2*o+8,trackMinWidthSM:2*c+4,trackPadding:2,handleBg:a,handleSize:o,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new b.FastColor("#00230b").setA(.2).toRgbString()}`,innerMinMargin:o/2,innerMaxMargin:o+2+4,innerMinMarginSM:c/2,innerMaxMarginSM:c+2+4}});var S=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let k=t.forwardRef((e,a)=>{let{prefixCls:i,size:l,disabled:o,loading:d,className:s,rootClassName:f,style:b,checked:$,value:v,defaultChecked:y,defaultValue:k,onChange:w}=e,x=S(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[I,O]=(0,c.default)(!1,{value:null!=$?$:v,defaultValue:null!=y?y:k}),{getPrefixCls:E,direction:N,switch:z}=t.useContext(m.ConfigContext),j=t.useContext(p.default),P=(null!=o?o:j)||d,T=E("switch",i),M=t.createElement("div",{className:`${T}-handle`},d&&t.createElement(r.default,{className:`${T}-loading-icon`})),[B,q,H]=C(T),R=(0,h.default)(l),L=(0,n.default)(null==z?void 0:z.className,{[`${T}-small`]:"small"===R,[`${T}-loading`]:d,[`${T}-rtl`]:"rtl"===N},s,f,q,H),G=Object.assign(Object.assign({},null==z?void 0:z.style),b);return B(t.createElement(g.default,{component:"Switch",disabled:P},t.createElement(u,Object.assign({},x,{checked:I,onChange:(...e)=>{O(e[0]),null==w||w.apply(void 0,e)},prefixCls:T,className:L,style:G,disabled:P,ref:a,loadingIcon:M}))))});k.__ANT_SWITCH=!0,e.s(["Switch",0,k],790848)},475254,e=>{"use strict";var t=e.i(271645);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var a={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 i=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:o="",children:c,iconNode:d,...s},u)=>(0,t.createElement)("svg",{ref:u,...a,width:r,height:r,stroke:e,strokeWidth:l?24*Number(i)/Number(r):i,className:n("lucide",o),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(s)&&{"aria-hidden":"true"},...s},[...d.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(c)?c:[c]])),l=(e,a)=>{let l=(0,t.forwardRef)(({className:l,...o},c)=>(0,t.createElement)(i,{ref:c,iconNode:a,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,l),...o}));return l.displayName=r(e),l};e.s(["default",()=>l],475254)},464571,e=>{"use strict";var t=e.i(920228);e.s(["Button",()=>t.default])},959013,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var a=e.i(9583),i=r.forwardRef(function(e,i){return r.createElement(a.default,(0,t.default)({},e,{ref:i,icon:n}))});e.s(["default",0,i],959013)},599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),n=e.i(673706),a=e.i(271645);let i=a.default.forwardRef((e,i)=>{let{color:l,className:o,children:c}=e;return a.default.createElement("p",{ref:i,className:(0,r.tremorTwMerge)("text-tremor-default",l?(0,n.getColorClassNames)(l,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),o)},c)});i.displayName="Text",e.s(["default",()=>i],936325),e.s(["Text",()=>i],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),n=e.i(480731),a=e.i(95779),i=e.i(444755),l=e.i(673706);let o=(0,l.makeClassName)("Card"),c=r.default.forwardRef((e,c)=>{let{decoration:d="",decorationColor:s,children:u,className:g}=e,m=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:c,className:(0,i.tremorTwMerge)(o("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",s?(0,l.getColorClassNames)(s,a.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case n.HorizontalPositions.Left:return"border-l-4";case n.VerticalPositions.Top:return"border-t-4";case n.HorizontalPositions.Right:return"border-r-4";case n.VerticalPositions.Bottom:return"border-b-4";default:return""}})(d),g)},m),u)});c.displayName="Card",e.s(["Card",()=>c],304967)},262218,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(529681),a=e.i(702779),i=e.i(563113),l=e.i(763731),o=e.i(121872),c=e.i(242064);e.i(296059);var d=e.i(915654);e.i(262370);var s=e.i(135551),u=e.i(183293),g=e.i(246422),m=e.i(838378);let p=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,a=e.fontSizeSM;return(0,m.mergeToken)(e,{tagFontSize:a,tagLineHeight:(0,d.unit)(n(e.lineHeightSM).mul(a).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},h=e=>({defaultBg:new s.FastColor(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),f=(0,g.genStyleHooks)("Tag",e=>(e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:a,calc:i}=e,l=i(n).sub(r).equal(),o=i(t).sub(r).equal();return{[a]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${a}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${a}-close-icon`]:{marginInlineStart:o,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${a}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${a}-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"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:l}}),[`${a}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(p(e)),h);var b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let $=t.forwardRef((e,n)=>{let{prefixCls:a,style:i,className:l,checked:o,children:d,icon:s,onChange:u,onClick:g}=e,m=b(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:p,tag:h}=t.useContext(c.ConfigContext),$=p("tag",a),[v,y,C]=f($),S=(0,r.default)($,`${$}-checkable`,{[`${$}-checkable-checked`]:o},null==h?void 0:h.className,l,y,C);return v(t.createElement("span",Object.assign({},m,{ref:n,style:Object.assign(Object.assign({},i),null==h?void 0:h.style),className:S,onClick:e=>{null==u||u(!o),null==g||g(e)}}),s,t.createElement("span",null,d)))});var v=e.i(403541);let y=(0,g.genSubStyleComponent)(["Tag","preset"],e=>{let t;return t=p(e),(0,v.genPresetColor)(t,(e,{textColor:r,lightBorderColor:n,lightColor:a,darkColor:i})=>({[`${t.componentCls}${t.componentCls}-${e}`]:{color:r,background:a,borderColor:n,"&-inverse":{color:t.colorTextLightSolid,background:i,borderColor:i},[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}))},h),C=(e,t,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${r}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},S=(0,g.genSubStyleComponent)(["Tag","status"],e=>{let t=p(e);return[C(t,"success","Success"),C(t,"processing","Info"),C(t,"error","Error"),C(t,"warning","Warning")]},h);var k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let w=t.forwardRef((e,d)=>{let{prefixCls:s,className:u,rootClassName:g,style:m,children:p,icon:h,color:b,onClose:$,bordered:v=!0,visible:C}=e,w=k(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:x,direction:I,tag:O}=t.useContext(c.ConfigContext),[E,N]=t.useState(!0),z=(0,n.default)(w,["closeIcon","closable"]);t.useEffect(()=>{void 0!==C&&N(C)},[C]);let j=(0,a.isPresetColor)(b),P=(0,a.isPresetStatusColor)(b),T=j||P,M=Object.assign(Object.assign({backgroundColor:b&&!T?b:void 0},null==O?void 0:O.style),m),B=x("tag",s),[q,H,R]=f(B),L=(0,r.default)(B,null==O?void 0:O.className,{[`${B}-${b}`]:T,[`${B}-has-color`]:b&&!T,[`${B}-hidden`]:!E,[`${B}-rtl`]:"rtl"===I,[`${B}-borderless`]:!v},u,g,H,R),G=e=>{e.stopPropagation(),null==$||$(e),e.defaultPrevented||N(!1)},[,A]=(0,i.useClosable)((0,i.pickClosable)(e),(0,i.pickClosable)(O),{closable:!1,closeIconRender:e=>{let n=t.createElement("span",{className:`${B}-close-icon`,onClick:G},e);return(0,l.replaceElement)(e,n,e=>({onClick:t=>{var r;null==(r=null==e?void 0:e.onClick)||r.call(e,t),G(t)},className:(0,r.default)(null==e?void 0:e.className,`${B}-close-icon`)}))}}),W="function"==typeof w.onClick||p&&"a"===p.type,D=h||null,X=D?t.createElement(t.Fragment,null,D,p&&t.createElement("span",null,p)):p,F=t.createElement("span",Object.assign({},z,{ref:d,className:L,style:M}),X,A,j&&t.createElement(y,{key:"preset",prefixCls:B}),P&&t.createElement(S,{key:"status",prefixCls:B}));return q(W?t.createElement(o.default,{component:"Tag"},F):F)});w.CheckableTag=$,e.s(["Tag",0,w],262218)},770914,e=>{"use strict";var t=e.i(38243);e.s(["Space",()=>t.default])},38243,908286,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(876556);function a(e){return["small","middle","large"].includes(e)}function i(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}e.s(["isPresetSize",()=>a,"isValidGapNumber",()=>i],908286);var l=e.i(242064),o=e.i(249616),c=e.i(372409),d=e.i(246422);let s=(0,d.genStyleHooks)(["Space","Addon"],e=>[(e=>{let{componentCls:t,borderRadius:r,paddingSM:n,colorBorder:a,paddingXS:i,fontSizeLG:l,fontSizeSM:o,borderRadiusLG:d,borderRadiusSM:s,colorBgContainerDisabled:u,lineWidth:g}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:n,margin:0,background:u,borderWidth:g,borderStyle:"solid",borderColor:a,borderRadius:r,"&-large":{fontSize:l,borderRadius:d},"&-small":{paddingInline:i,borderRadius:s,fontSize:o},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0}},(0,c.genCompactItemStyle)(e,{focus:!1})]}})(e)]);var u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let g=t.default.forwardRef((e,n)=>{let{className:a,children:i,style:c,prefixCls:d}=e,g=u(e,["className","children","style","prefixCls"]),{getPrefixCls:m,direction:p}=t.default.useContext(l.ConfigContext),h=m("space-addon",d),[f,b,$]=s(h),{compactItemClassnames:v,compactSize:y}=(0,o.useCompactItemContext)(h,p),C=(0,r.default)(h,b,v,$,{[`${h}-${y}`]:y},a);return f(t.default.createElement("div",Object.assign({ref:n,className:C,style:c},g),i))}),m=t.default.createContext({latestIndex:0}),p=m.Provider,h=({className:e,index:r,children:n,split:a,style:i})=>{let{latestIndex:l}=t.useContext(m);return null==n?null:t.createElement(t.Fragment,null,t.createElement("div",{className:e,style:i},n),r{let t=(0,f.mergeToken)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[(e=>{let{componentCls:t,antCls:r}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${t}-item:empty`]:{display:"none"},[`${t}-item > ${r}-badge-not-a-wrapper:only-child`]:{display:"block"}}}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}})(t)]},()=>({}),{resetStyle:!1});var $=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let v=t.forwardRef((e,o)=>{var c;let{getPrefixCls:d,direction:s,size:u,className:g,style:m,classNames:f,styles:v}=(0,l.useComponentConfig)("space"),{size:y=null!=u?u:"small",align:C,className:S,rootClassName:k,children:w,direction:x="horizontal",prefixCls:I,split:O,style:E,wrap:N=!1,classNames:z,styles:j}=e,P=$(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[T,M]=Array.isArray(y)?y:[y,y],B=a(M),q=a(T),H=i(M),R=i(T),L=(0,n.default)(w,{keepEmpty:!0}),G=void 0===C&&"horizontal"===x?"center":C,A=d("space",I),[W,D,X]=b(A),F=(0,r.default)(A,g,D,`${A}-${x}`,{[`${A}-rtl`]:"rtl"===s,[`${A}-align-${G}`]:G,[`${A}-gap-row-${M}`]:B,[`${A}-gap-col-${T}`]:q},S,k,X),V=(0,r.default)(`${A}-item`,null!=(c=null==z?void 0:z.item)?c:f.item),_=Object.assign(Object.assign({},v.item),null==j?void 0:j.item),K=L.map((e,r)=>{let n=(null==e?void 0:e.key)||`${V}-${r}`;return t.createElement(h,{className:V,key:n,index:r,split:O,style:_},e)}),U=t.useMemo(()=>({latestIndex:L.reduce((e,t,r)=>null!=t?r:e,0)}),[L]);if(0===L.length)return null;let Q={};return N&&(Q.flexWrap="wrap"),!q&&R&&(Q.columnGap=T),!B&&H&&(Q.rowGap=M),W(t.createElement("div",Object.assign({ref:o,className:F,style:Object.assign(Object.assign(Object.assign({},Q),m),E)},P),t.createElement(p,{value:U},K)))});v.Compact=o.default,v.Addon=g,e.s(["default",0,v],38243)},312361,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(242064),a=e.i(517455);e.i(296059);var i=e.i(915654),l=e.i(183293),o=e.i(246422),c=e.i(838378);let d=(0,o.genStyleHooks)("Divider",e=>{let t=(0,c.mergeToken)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[(e=>{let{componentCls:t,sizePaddingEdgeHorizontal:r,colorSplit:n,lineWidth:a,textPaddingInline:o,orientationMargin:c,verticalMarginInline:d}=e;return{[t]:Object.assign(Object.assign({},(0,l.resetComponent)(e)),{borderBlockStart:`${(0,i.unit)(a)} solid ${n}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:d,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${(0,i.unit)(a)} solid ${n}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${(0,i.unit)(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${(0,i.unit)(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${n}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${(0,i.unit)(a)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-start`]:{"&::before":{width:`calc(${c} * 100%)`},"&::after":{width:`calc(100% - ${c} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{"&::before":{width:`calc(100% - ${c} * 100%)`},"&::after":{width:`calc(${c} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:o},"&-dashed":{background:"none",borderColor:n,borderStyle:"dashed",borderWidth:`${(0,i.unit)(a)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:a,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:n,borderStyle:"dotted",borderWidth:`${(0,i.unit)(a)} 0 0`},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:a,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:r}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:r}}})}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}})(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}});var s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let u={small:"sm",middle:"md"};e.s(["Divider",0,e=>{let{getPrefixCls:i,direction:l,className:o,style:c}=(0,n.useComponentConfig)("divider"),{prefixCls:g,type:m="horizontal",orientation:p="center",orientationMargin:h,className:f,rootClassName:b,children:$,dashed:v,variant:y="solid",plain:C,style:S,size:k}=e,w=s(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),x=i("divider",g),[I,O,E]=d(x),N=u[(0,a.default)(k)],z=!!$,j=t.useMemo(()=>"left"===p?"rtl"===l?"end":"start":"right"===p?"rtl"===l?"start":"end":p,[l,p]),P="start"===j&&null!=h,T="end"===j&&null!=h,M=(0,r.default)(x,o,O,E,`${x}-${m}`,{[`${x}-with-text`]:z,[`${x}-with-text-${j}`]:z,[`${x}-dashed`]:!!v,[`${x}-${y}`]:"solid"!==y,[`${x}-plain`]:!!C,[`${x}-rtl`]:"rtl"===l,[`${x}-no-default-orientation-margin-start`]:P,[`${x}-no-default-orientation-margin-end`]:T,[`${x}-${N}`]:!!N},f,b),B=t.useMemo(()=>"number"==typeof h?h:/^\d+$/.test(h)?Number(h):h,[h]);return I(t.createElement("div",Object.assign({className:M,style:Object.assign(Object.assign({},c),S)},w,{role:"separator"}),$&&"vertical"!==m&&t.createElement("span",{className:`${x}-inner-text`,style:{marginInlineStart:P?B:void 0,marginInlineEnd:T?B:void 0}},$)))}],312361)},801312,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var a=e.i(9583),i=r.forwardRef(function(e,i){return r.createElement(a.default,(0,t.default)({},e,{ref:i,icon:n}))});e.s(["default",0,i],801312)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/b83ca9892d2d63cf.js b/litellm/proxy/_experimental/out/_next/static/chunks/0606c92ecd600e0c.js
similarity index 53%
rename from litellm/proxy/_experimental/out/_next/static/chunks/b83ca9892d2d63cf.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/0606c92ecd600e0c.js
index fe2c03f466..4d144c04ad 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/b83ca9892d2d63cf.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/0606c92ecd600e0c.js
@@ -1,4 +1,4 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,596239,e=>{"use strict";e.i(247167);var t=e.i(931067),i=e.i(271645);let 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"};var o=e.i(9583),r=i.forwardRef(function(e,r){return i.createElement(o.default,(0,t.default)({},e,{ref:r,icon:a}))});e.s(["LinkOutlined",0,r],596239)},190272,785913,e=>{"use strict";var t,i,a=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),o=((i={}).IMAGE="image",i.VIDEO="video",i.CHAT="chat",i.RESPONSES="responses",i.IMAGE_EDITS="image_edits",i.ANTHROPIC_MESSAGES="anthropic_messages",i.EMBEDDINGS="embeddings",i.SPEECH="speech",i.TRANSCRIPTION="transcription",i.A2A_AGENTS="a2a_agents",i.MCP="mcp",i.REALTIME="realtime",i);let r={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>o,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(a).includes(e)){let t=r[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:i,accessToken:a,apiKey:r,inputMessage:n,chatHistory:s,selectedTags:l,selectedVectorStores:p,selectedGuardrails:d,selectedPolicies:c,selectedMCPServers:g,mcpServers:m,mcpServerToolRestrictions:u,selectedVoice:f,endpointType:_,selectedModel:h,selectedSdk:A,proxySettings:x}=e,b="session"===i?a:r,y=window.location.origin,I=x?.LITELLM_UI_API_DOC_BASE_URL;I&&I.trim()?y=I:x?.PROXY_BASE_URL&&(y=x.PROXY_BASE_URL);let v=n||"Your prompt here",C=v.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),E=s.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),O={};l.length>0&&(O.tags=l),p.length>0&&(O.vector_stores=p),d.length>0&&(O.guardrails=d),c.length>0&&(O.policies=c);let T=h||"your-model-name",S="azure"===A?`import openai
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),i=e.i(271645);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var o=e.i(9583),r=i.forwardRef(function(e,r){return i.createElement(o.default,(0,t.default)({},e,{ref:r,icon:a}))});e.s(["ArrowLeftOutlined",0,r],447566)},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),i=e.i(271645);let 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"};var o=e.i(9583),r=i.forwardRef(function(e,r){return i.createElement(o.default,(0,t.default)({},e,{ref:r,icon:a}))});e.s(["LinkOutlined",0,r],596239)},190272,785913,e=>{"use strict";var t,i,a=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),o=((i={}).IMAGE="image",i.VIDEO="video",i.CHAT="chat",i.RESPONSES="responses",i.IMAGE_EDITS="image_edits",i.ANTHROPIC_MESSAGES="anthropic_messages",i.EMBEDDINGS="embeddings",i.SPEECH="speech",i.TRANSCRIPTION="transcription",i.A2A_AGENTS="a2a_agents",i.MCP="mcp",i.REALTIME="realtime",i);let r={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>o,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(a).includes(e)){let t=r[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:i,accessToken:a,apiKey:r,inputMessage:n,chatHistory:s,selectedTags:l,selectedVectorStores:p,selectedGuardrails:d,selectedPolicies:c,selectedMCPServers:g,mcpServers:m,mcpServerToolRestrictions:u,selectedVoice:f,endpointType:_,selectedModel:h,selectedSdk:A,proxySettings:x}=e,b="session"===i?a:r,y=window.location.origin,I=x?.LITELLM_UI_API_DOC_BASE_URL;I&&I.trim()?y=I:x?.PROXY_BASE_URL&&(y=x.PROXY_BASE_URL);let v=n||"Your prompt here",C=v.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),E=s.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),O={};l.length>0&&(O.tags=l),p.length>0&&(O.vector_stores=p),d.length>0&&(O.guardrails=d),c.length>0&&(O.policies=c);let T=h||"your-model-name",S="azure"===A?`import openai
client = openai.AzureOpenAI(
api_key="${b||"YOUR_LITELLM_API_KEY"}",
@@ -417,4 +417,4 @@ print(f"Audio saved to {output_filename}")
# )
# response.stream_to_file("output_speech.mp3")
`;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${S}
-${t}`}],190272)},652272,209261,e=>{"use strict";var t=e.i(843476),i=e.i(271645),a=e.i(447566),o=e.i(166406),r=e.i(492030),n=e.i(596239);let s=e=>"github"===e.source.source&&e.source.repo?`/plugin marketplace add ${e.source.repo}`:"url"===e.source.source&&e.source.url?`/plugin marketplace add ${e.source.url}`:`/plugin marketplace add ${e.name}`;e.s(["formatInstallCommand",0,s,"getCategoryBadgeColor",0,e=>{if(!e)return"gray";let t=e.toLowerCase();if(t.includes("development")||t.includes("dev"))return"blue";if(t.includes("productivity")||t.includes("workflow"))return"green";if(t.includes("learning")||t.includes("education"))return"purple";if(t.includes("security")||t.includes("safety"))return"red";if(t.includes("data")||t.includes("analytics"))return"orange";else if(t.includes("integration")||t.includes("api"))return"yellow";return"gray"},"isValidEmail",0,e=>!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),"isValidSemanticVersion",0,e=>!e||/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(e),"isValidUrl",0,e=>{if(!e)return!0;try{return new URL(e),!0}catch{return!1}},"parseKeywords",0,e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>""!==e):[],"validatePluginName",0,e=>!!e&&""!==e.trim()&&/^[a-z0-9-]+$/.test(e)],209261),e.s(["default",0,({skill:e,onBack:l})=>{let p,[d,c]=(0,i.useState)("overview"),[g,m]=(0,i.useState)(null),u=(e,t)=>{navigator.clipboard.writeText(e),m(t),setTimeout(()=>m(null),2e3)},f="github"===(p=e.source).source&&p.repo?`https://github.com/${p.repo}`:"git-subdir"===p.source&&p.url?p.path?`${p.url}/tree/main/${p.path}`:p.url:"url"===p.source&&p.url?p.url:null,_=s(e),h=[...e.category?[{property:"Category",value:e.category}]:[],...e.domain?[{property:"Domain",value:e.domain}]:[],...e.namespace?[{property:"Namespace",value:e.namespace}]:[],...e.version?[{property:"Version",value:e.version}]:[],...e.author?.name?[{property:"Author",value:e.author.name}]:[],...e.created_at?[{property:"Added",value:new Date(e.created_at).toLocaleDateString()}]:[]];return(0,t.jsxs)("div",{style:{padding:"24px 32px 24px 0"},children:[(0,t.jsxs)("div",{onClick:l,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(a.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:"Skills"})]}),(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name}),e.description&&(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"8px 0 0 0",lineHeight:1.6},children:e.description})]}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28,marginTop:24},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:[{key:"overview",label:"Overview"},{key:"usage",label:"How to Use"}].map(e=>(0,t.jsx)("div",{onClick:()=>c(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Skill Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Metadata registered with this skill"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:160},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:h.map((e,i)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},i))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Status"}),(0,t.jsx)("span",{style:{fontSize:12,padding:"3px 10px",borderRadius:12,backgroundColor:e.enabled?"#e6f4ea":"#f1f3f4",color:e.enabled?"#137333":"#5f6368",fontWeight:500},children:e.enabled?"Public":"Draft"})]}),f&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Source"}),(0,t.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,color:"#1a73e8",wordBreak:"break-all",display:"flex",alignItems:"center",gap:4},children:[f.replace("https://",""),(0,t.jsx)(n.LinkOutlined,{style:{fontSize:11,flexShrink:0}})]})]}),e.keywords&&e.keywords.length>0&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.keywords.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Skill ID"}),(0,t.jsx)("div",{style:{fontSize:12,fontFamily:"monospace",color:"#3c4043",wordBreak:"break-all"},children:e.id})]})]})]}),"usage"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"Using this skill"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:"Once your proxy is set as a marketplace, enable this skill in Claude Code with one command:"}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden",marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"Run in Claude Code"}),(0,t.jsxs)("button",{onClick:()=>u(_,"install"),style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"install"===g?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["install"===g?(0,t.jsx)(r.CheckOutlined,{}):(0,t.jsx)(o.CopyOutlined,{}),"install"===g?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:14,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:_})]}),(0,t.jsxs)("p",{style:{fontSize:13,color:"#5f6368",lineHeight:1.6,margin:0},children:["Don't have the marketplace configured yet?"," ",(0,t.jsx)("span",{onClick:()=>c("setup"),style:{color:"#1a73e8",cursor:"pointer"},children:"See one-time setup →"})]})]}),"setup"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"One-time marketplace setup"}),(0,t.jsxs)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:["Add this to ",(0,t.jsx)("code",{style:{fontSize:13,backgroundColor:"#f1f3f4",padding:"1px 6px",borderRadius:4},children:"~/.claude/settings.json"})," to point Claude Code at your proxy:"]}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"~/.claude/settings.json"}),(0,t.jsxs)("button",{onClick:()=>{u(JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2),"settings")},style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"settings"===g?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["settings"===g?(0,t.jsx)(r.CheckOutlined,{}):(0,t.jsx)(o.CopyOutlined,{}),"settings"===g?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:13,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2)})]})]})]})}],652272)},94629,e=>{"use strict";var t=e.i(271645);let i=t.forwardRef(function(e,i){return t.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:i},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});e.s(["SwitchVerticalIcon",0,i],94629)},991124,e=>{"use strict";let t=(0,e.i(475254).default)("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"}]]);e.s(["default",()=>t])},879664,e=>{"use strict";let t=(0,e.i(475254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",()=>t])},916925,e=>{"use strict";var t,i=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t);let a={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference"},o="../ui/assets/logos/",r={"A2A Agent":`${o}a2a_agent.png`,Ai21:`${o}ai21.svg`,"Ai21 Chat":`${o}ai21.svg`,"AI/ML API":`${o}aiml_api.svg`,"Aiohttp Openai":`${o}openai_small.svg`,Anthropic:`${o}anthropic.svg`,"Anthropic Text":`${o}anthropic.svg`,AssemblyAI:`${o}assemblyai_small.png`,Azure:`${o}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${o}microsoft_azure.svg`,"Azure Text":`${o}microsoft_azure.svg`,Baseten:`${o}baseten.svg`,"Amazon Bedrock":`${o}bedrock.svg`,"Amazon Bedrock Mantle":`${o}bedrock.svg`,"AWS SageMaker":`${o}bedrock.svg`,Cerebras:`${o}cerebras.svg`,Cloudflare:`${o}cloudflare.svg`,Codestral:`${o}mistral.svg`,Cohere:`${o}cohere.svg`,"Cohere Chat":`${o}cohere.svg`,Cometapi:`${o}cometapi.svg`,Cursor:`${o}cursor.svg`,"Databricks (Qwen API)":`${o}databricks.svg`,Dashscope:`${o}dashscope.svg`,Deepseek:`${o}deepseek.svg`,Deepgram:`${o}deepgram.png`,DeepInfra:`${o}deepinfra.png`,ElevenLabs:`${o}elevenlabs.png`,"Fal AI":`${o}fal_ai.jpg`,"Featherless Ai":`${o}featherless.svg`,"Fireworks AI":`${o}fireworks.svg`,Friendliai:`${o}friendli.svg`,"Github Copilot":`${o}github_copilot.svg`,"Google AI Studio":`${o}google.svg`,GradientAI:`${o}gradientai.svg`,Groq:`${o}groq.svg`,vllm:`${o}vllm.png`,Huggingface:`${o}huggingface.svg`,Hyperbolic:`${o}hyperbolic.svg`,Infinity:`${o}infinity.png`,"Jina AI":`${o}jina.png`,"Lambda Ai":`${o}lambda.svg`,"Lm Studio":`${o}lmstudio.svg`,"Meta Llama":`${o}meta_llama.svg`,MiniMax:`${o}minimax.svg`,"Mistral AI":`${o}mistral.svg`,Moonshot:`${o}moonshot.svg`,Morph:`${o}morph.svg`,Nebius:`${o}nebius.svg`,Novita:`${o}novita.svg`,"Nvidia Nim":`${o}nvidia_nim.svg`,Ollama:`${o}ollama.svg`,"Ollama Chat":`${o}ollama.svg`,Oobabooga:`${o}openai_small.svg`,OpenAI:`${o}openai_small.svg`,"Openai Like":`${o}openai_small.svg`,"OpenAI Text Completion":`${o}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${o}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${o}openai_small.svg`,Openrouter:`${o}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${o}oracle.svg`,Perplexity:`${o}perplexity-ai.svg`,Recraft:`${o}recraft.svg`,Replicate:`${o}replicate.svg`,RunwayML:`${o}runwayml.png`,Sagemaker:`${o}bedrock.svg`,Sambanova:`${o}sambanova.svg`,"SAP Generative AI Hub":`${o}sap.png`,Snowflake:`${o}snowflake.svg`,"Text-Completion-Codestral":`${o}mistral.svg`,TogetherAI:`${o}togetherai.svg`,Topaz:`${o}topaz.svg`,Triton:`${o}nvidia_triton.png`,V0:`${o}v0.svg`,"Vercel Ai Gateway":`${o}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${o}google.svg`,"Vertex Ai Beta":`${o}google.svg`,Vllm:`${o}vllm.png`,VolcEngine:`${o}volcengine.png`,"Voyage AI":`${o}voyage.webp`,Watsonx:`${o}watsonx.svg`,"Watsonx Text":`${o}watsonx.svg`,xAI:`${o}xai.svg`,Xinference:`${o}xinference.svg`};e.s(["Providers",()=>i,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:r[e],displayName:e}}let t=Object.keys(a).find(t=>a[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let o=i[t];return{logo:r[o],displayName:o}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let i=a[e];console.log(`Provider mapped to: ${i}`);let o=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let a=t.litellm_provider;(a===i||"string"==typeof a&&a.includes(i))&&o.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&o.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&o.push(e)}))),o},"providerLogoMap",0,r,"provider_map",0,a])},798496,e=>{"use strict";var t=e.i(843476),i=e.i(152990),a=e.i(682830),o=e.i(271645),r=e.i(269200),n=e.i(427612),s=e.i(64848),l=e.i(942232),p=e.i(496020),d=e.i(977572),c=e.i(94629),g=e.i(360820),m=e.i(871943);function u({data:e=[],columns:u,isLoading:f=!1,defaultSorting:_=[],pagination:h,onPaginationChange:A,enablePagination:x=!1,onRowClick:b}){let[y,I]=o.default.useState(_),[v]=o.default.useState("onChange"),[C,E]=o.default.useState({}),[O,T]=o.default.useState({}),S=(0,i.useReactTable)({data:e,columns:u,state:{sorting:y,columnSizing:C,columnVisibility:O,...x&&h?{pagination:h}:{}},columnResizeMode:v,onSortingChange:I,onColumnSizingChange:E,onColumnVisibilityChange:T,...x&&A?{onPaginationChange:A}:{},getCoreRowModel:(0,a.getCoreRowModel)(),getSortedRowModel:(0,a.getSortedRowModel)(),...x?{getPaginationRowModel:(0,a.getPaginationRowModel)()}:{},enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("div",{className:"relative min-w-full",children:(0,t.jsxs)(r.Table,{className:"[&_td]:py-2 [&_th]:py-2",style:{width:S.getTotalSize(),minWidth:"100%",tableLayout:"fixed"},children:[(0,t.jsx)(n.TableHead,{children:S.getHeaderGroups().map(e=>(0,t.jsx)(p.TableRow,{children:e.headers.map(e=>(0,t.jsxs)(s.TableHeaderCell,{className:`py-1 h-8 relative ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,i.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(g.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(m.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(c.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,t.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 ${e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200"}`})]},e.id))},e.id))}),(0,t.jsx)(l.TableBody,{children:f?(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading models..."})})})}):S.getRowModel().rows.length>0?S.getRowModel().rows.map(e=>(0,t.jsx)(p.TableRow,{onClick:()=>b?.(e.original),className:b?"cursor-pointer hover:bg-gray-50":"",children:e.getVisibleCells().map(e=>(0,t.jsx)(d.TableCell,{className:`py-0.5 overflow-hidden ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,i.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No models found"})})})})})]})})})})}e.s(["ModelDataTable",()=>u])}]);
\ No newline at end of file
+${t}`}],190272)},652272,209261,e=>{"use strict";var t=e.i(843476),i=e.i(271645),a=e.i(447566),o=e.i(166406),r=e.i(492030),n=e.i(596239);let s=e=>"github"===e.source.source&&e.source.repo?`/plugin marketplace add ${e.source.repo}`:"url"===e.source.source&&e.source.url?`/plugin marketplace add ${e.source.url}`:`/plugin marketplace add ${e.name}`;e.s(["formatInstallCommand",0,s,"getCategoryBadgeColor",0,e=>{if(!e)return"gray";let t=e.toLowerCase();if(t.includes("development")||t.includes("dev"))return"blue";if(t.includes("productivity")||t.includes("workflow"))return"green";if(t.includes("learning")||t.includes("education"))return"purple";if(t.includes("security")||t.includes("safety"))return"red";if(t.includes("data")||t.includes("analytics"))return"orange";else if(t.includes("integration")||t.includes("api"))return"yellow";return"gray"},"isValidEmail",0,e=>!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),"isValidSemanticVersion",0,e=>!e||/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(e),"isValidUrl",0,e=>{if(!e)return!0;try{return new URL(e),!0}catch{return!1}},"parseKeywords",0,e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>""!==e):[],"validatePluginName",0,e=>!!e&&""!==e.trim()&&/^[a-z0-9-]+$/.test(e)],209261),e.s(["default",0,({skill:e,onBack:l})=>{let p,[d,c]=(0,i.useState)("overview"),[g,m]=(0,i.useState)(null),u=(e,t)=>{navigator.clipboard.writeText(e),m(t),setTimeout(()=>m(null),2e3)},f="github"===(p=e.source).source&&p.repo?`https://github.com/${p.repo}`:"git-subdir"===p.source&&p.url?p.path?`${p.url}/tree/main/${p.path}`:p.url:"url"===p.source&&p.url?p.url:null,_=s(e),h=[...e.category?[{property:"Category",value:e.category}]:[],...e.domain?[{property:"Domain",value:e.domain}]:[],...e.namespace?[{property:"Namespace",value:e.namespace}]:[],...e.version?[{property:"Version",value:e.version}]:[],...e.author?.name?[{property:"Author",value:e.author.name}]:[],...e.created_at?[{property:"Added",value:new Date(e.created_at).toLocaleDateString()}]:[]];return(0,t.jsxs)("div",{style:{padding:"24px 32px 24px 0"},children:[(0,t.jsxs)("div",{onClick:l,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(a.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:"Skills"})]}),(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name}),e.description&&(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"8px 0 0 0",lineHeight:1.6},children:e.description})]}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28,marginTop:24},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:[{key:"overview",label:"Overview"},{key:"usage",label:"How to Use"}].map(e=>(0,t.jsx)("div",{onClick:()=>c(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Skill Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Metadata registered with this skill"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:160},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:h.map((e,i)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},i))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Status"}),(0,t.jsx)("span",{style:{fontSize:12,padding:"3px 10px",borderRadius:12,backgroundColor:e.enabled?"#e6f4ea":"#f1f3f4",color:e.enabled?"#137333":"#5f6368",fontWeight:500},children:e.enabled?"Public":"Draft"})]}),f&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Source"}),(0,t.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,color:"#1a73e8",wordBreak:"break-all",display:"flex",alignItems:"center",gap:4},children:[f.replace("https://",""),(0,t.jsx)(n.LinkOutlined,{style:{fontSize:11,flexShrink:0}})]})]}),e.keywords&&e.keywords.length>0&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.keywords.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Skill ID"}),(0,t.jsx)("div",{style:{fontSize:12,fontFamily:"monospace",color:"#3c4043",wordBreak:"break-all"},children:e.id})]})]})]}),"usage"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"Using this skill"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:"Once your proxy is set as a marketplace, enable this skill in Claude Code with one command:"}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden",marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"Run in Claude Code"}),(0,t.jsxs)("button",{onClick:()=>u(_,"install"),style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"install"===g?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["install"===g?(0,t.jsx)(r.CheckOutlined,{}):(0,t.jsx)(o.CopyOutlined,{}),"install"===g?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:14,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:_})]}),(0,t.jsxs)("p",{style:{fontSize:13,color:"#5f6368",lineHeight:1.6,margin:0},children:["Don't have the marketplace configured yet?"," ",(0,t.jsx)("span",{onClick:()=>c("setup"),style:{color:"#1a73e8",cursor:"pointer"},children:"See one-time setup →"})]})]}),"setup"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"One-time marketplace setup"}),(0,t.jsxs)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:["Add this to ",(0,t.jsx)("code",{style:{fontSize:13,backgroundColor:"#f1f3f4",padding:"1px 6px",borderRadius:4},children:"~/.claude/settings.json"})," to point Claude Code at your proxy:"]}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"~/.claude/settings.json"}),(0,t.jsxs)("button",{onClick:()=>{u(JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2),"settings")},style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"settings"===g?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["settings"===g?(0,t.jsx)(r.CheckOutlined,{}):(0,t.jsx)(o.CopyOutlined,{}),"settings"===g?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:13,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2)})]})]})]})}],652272)},879664,e=>{"use strict";let t=(0,e.i(475254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",()=>t])},916925,e=>{"use strict";var t,i=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t.ZAI="Z.AI (Zhipu AI)",t);let a={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference",ZAI:"zai"},o="../ui/assets/logos/",r={"A2A Agent":`${o}a2a_agent.png`,Ai21:`${o}ai21.svg`,"Ai21 Chat":`${o}ai21.svg`,"AI/ML API":`${o}aiml_api.svg`,"Aiohttp Openai":`${o}openai_small.svg`,Anthropic:`${o}anthropic.svg`,"Anthropic Text":`${o}anthropic.svg`,AssemblyAI:`${o}assemblyai_small.png`,Azure:`${o}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${o}microsoft_azure.svg`,"Azure Text":`${o}microsoft_azure.svg`,Baseten:`${o}baseten.svg`,"Amazon Bedrock":`${o}bedrock.svg`,"Amazon Bedrock Mantle":`${o}bedrock.svg`,"AWS SageMaker":`${o}bedrock.svg`,Cerebras:`${o}cerebras.svg`,Cloudflare:`${o}cloudflare.svg`,Codestral:`${o}mistral.svg`,Cohere:`${o}cohere.svg`,"Cohere Chat":`${o}cohere.svg`,Cometapi:`${o}cometapi.svg`,Cursor:`${o}cursor.svg`,"Databricks (Qwen API)":`${o}databricks.svg`,Dashscope:`${o}dashscope.svg`,Deepseek:`${o}deepseek.svg`,Deepgram:`${o}deepgram.png`,DeepInfra:`${o}deepinfra.png`,ElevenLabs:`${o}elevenlabs.png`,"Fal AI":`${o}fal_ai.jpg`,"Featherless Ai":`${o}featherless.svg`,"Fireworks AI":`${o}fireworks.svg`,Friendliai:`${o}friendli.svg`,"Github Copilot":`${o}github_copilot.svg`,"Google AI Studio":`${o}google.svg`,GradientAI:`${o}gradientai.svg`,Groq:`${o}groq.svg`,vllm:`${o}vllm.png`,Huggingface:`${o}huggingface.svg`,Hyperbolic:`${o}hyperbolic.svg`,Infinity:`${o}infinity.png`,"Jina AI":`${o}jina.png`,"Lambda Ai":`${o}lambda.svg`,"Lm Studio":`${o}lmstudio.svg`,"Meta Llama":`${o}meta_llama.svg`,MiniMax:`${o}minimax.svg`,"Mistral AI":`${o}mistral.svg`,Moonshot:`${o}moonshot.svg`,Morph:`${o}morph.svg`,Nebius:`${o}nebius.svg`,Novita:`${o}novita.svg`,"Nvidia Nim":`${o}nvidia_nim.svg`,Ollama:`${o}ollama.svg`,"Ollama Chat":`${o}ollama.svg`,Oobabooga:`${o}openai_small.svg`,OpenAI:`${o}openai_small.svg`,"Openai Like":`${o}openai_small.svg`,"OpenAI Text Completion":`${o}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${o}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${o}openai_small.svg`,Openrouter:`${o}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${o}oracle.svg`,Perplexity:`${o}perplexity-ai.svg`,Recraft:`${o}recraft.svg`,Replicate:`${o}replicate.svg`,RunwayML:`${o}runwayml.png`,Sagemaker:`${o}bedrock.svg`,Sambanova:`${o}sambanova.svg`,"SAP Generative AI Hub":`${o}sap.png`,Snowflake:`${o}snowflake.svg`,"Text-Completion-Codestral":`${o}mistral.svg`,TogetherAI:`${o}togetherai.svg`,Topaz:`${o}topaz.svg`,Triton:`${o}nvidia_triton.png`,V0:`${o}v0.svg`,"Vercel Ai Gateway":`${o}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${o}google.svg`,"Vertex Ai Beta":`${o}google.svg`,Vllm:`${o}vllm.png`,VolcEngine:`${o}volcengine.png`,"Voyage AI":`${o}voyage.webp`,Watsonx:`${o}watsonx.svg`,"Watsonx Text":`${o}watsonx.svg`,xAI:`${o}xai.svg`,Xinference:`${o}xinference.svg`};e.s(["Providers",()=>i,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else if("Z.AI (Zhipu AI)"===e)return"zai/glm-4.5";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:r[e],displayName:e}}let t=Object.keys(a).find(t=>a[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let o=i[t];return{logo:r[o],displayName:o}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let i=a[e];console.log(`Provider mapped to: ${i}`);let o=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let a=t.litellm_provider;(a===i||"string"==typeof a&&a.includes(i))&&o.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&o.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&o.push(e)}))),o},"providerLogoMap",0,r,"provider_map",0,a])},798496,e=>{"use strict";var t=e.i(843476),i=e.i(152990),a=e.i(682830),o=e.i(271645),r=e.i(269200),n=e.i(427612),s=e.i(64848),l=e.i(942232),p=e.i(496020),d=e.i(977572),c=e.i(94629),g=e.i(360820),m=e.i(871943);function u({data:e=[],columns:u,isLoading:f=!1,defaultSorting:_=[],pagination:h,onPaginationChange:A,enablePagination:x=!1,onRowClick:b}){let[y,I]=o.default.useState(_),[v]=o.default.useState("onChange"),[C,E]=o.default.useState({}),[O,T]=o.default.useState({}),S=(0,i.useReactTable)({data:e,columns:u,state:{sorting:y,columnSizing:C,columnVisibility:O,...x&&h?{pagination:h}:{}},columnResizeMode:v,onSortingChange:I,onColumnSizingChange:E,onColumnVisibilityChange:T,...x&&A?{onPaginationChange:A}:{},getCoreRowModel:(0,a.getCoreRowModel)(),getSortedRowModel:(0,a.getSortedRowModel)(),...x?{getPaginationRowModel:(0,a.getPaginationRowModel)()}:{},enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("div",{className:"relative min-w-full",children:(0,t.jsxs)(r.Table,{className:"[&_td]:py-2 [&_th]:py-2",style:{width:S.getTotalSize(),minWidth:"100%",tableLayout:"fixed"},children:[(0,t.jsx)(n.TableHead,{children:S.getHeaderGroups().map(e=>(0,t.jsx)(p.TableRow,{children:e.headers.map(e=>(0,t.jsxs)(s.TableHeaderCell,{className:`py-1 h-8 relative ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,i.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(g.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(m.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(c.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,t.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 ${e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200"}`})]},e.id))},e.id))}),(0,t.jsx)(l.TableBody,{children:f?(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading models..."})})})}):S.getRowModel().rows.length>0?S.getRowModel().rows.map(e=>(0,t.jsx)(p.TableRow,{onClick:()=>b?.(e.original),className:b?"cursor-pointer hover:bg-gray-50":"",children:e.getVisibleCells().map(e=>(0,t.jsx)(d.TableCell,{className:`py-0.5 overflow-hidden ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,i.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No models found"})})})})})]})})})})}e.s(["ModelDataTable",()=>u])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/06b2ea8c776c2e9b.js b/litellm/proxy/_experimental/out/_next/static/chunks/06b2ea8c776c2e9b.js
new file mode 100644
index 0000000000..fe571604a7
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/06b2ea8c776c2e9b.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,233538,e=>{"use strict";function t(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let l=(null==t?void 0:t.getAttribute("disabled"))==="";return!(l&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(r))&&l}e.s(["isDisabledReactIssue7711",()=>t])},220508,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["CheckCircleIcon",0,r],220508)},503269,214520,601893,694421,140721,942803,35889,722678,e=>{"use strict";var t=e.i(271645),r=e.i(914189);function l(e,l,s){let[a,n]=(0,t.useState)(s),i=void 0!==e,o=(0,t.useRef)(i),c=(0,t.useRef)(!1),d=(0,t.useRef)(!1);return!i||o.current||c.current?i||!o.current||d.current||(d.current=!0,o.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(c.current=!0,o.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[i?e:a,(0,r.useEvent)(e=>(i||n(e),null==l?void 0:l(e)))]}function s(e){let[r]=(0,t.useState)(e);return r}e.s(["useControllable",()=>l],503269),e.s(["useDefaultValue",()=>s],214520);let a=(0,t.createContext)(void 0);function n(){return(0,t.useContext)(a)}e.s(["useDisabled",()=>n],601893);var i=e.i(174080),o=e.i(746725);function c(e={},t=null,r=[]){for(let[l,s]of Object.entries(e))!function e(t,r,l){if(Array.isArray(l))for(let[s,a]of l.entries())e(t,d(r,s.toString()),a);else l instanceof Date?t.push([r,l.toISOString()]):"boolean"==typeof l?t.push([r,l?"1":"0"]):"string"==typeof l?t.push([r,l]):"number"==typeof l?t.push([r,`${l}`]):null==l?t.push([r,""]):c(l,r,t)}(r,d(t,l),s);return r}function d(e,t){return e?e+"["+t+"]":t}function u(e){var t,r;let l=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(l){for(let t of l.elements)if(t!==e&&("INPUT"===t.tagName&&"submit"===t.type||"BUTTON"===t.tagName&&"submit"===t.type||"INPUT"===t.nodeName&&"image"===t.type))return void t.click();null==(r=l.requestSubmit)||r.call(l)}}e.s(["attemptSubmit",()=>u,"objectToFormEntries",()=>c],694421);var m=e.i(700020),f=e.i(2788);let h=(0,t.createContext)(null);function g({children:e}){let r=(0,t.useContext)(h);if(!r)return t.default.createElement(t.default.Fragment,null,e);let{target:l}=r;return l?(0,i.createPortal)(t.default.createElement(t.default.Fragment,null,e),l):null}function p({data:e,form:r,disabled:l,onReset:s,overrides:a}){let[n,i]=(0,t.useState)(null),d=(0,o.useDisposables)();return(0,t.useEffect)(()=>{if(s&&n)return d.addEventListener(n,"reset",s)},[n,r,s]),t.default.createElement(g,null,t.default.createElement(x,{setForm:i,formId:r}),c(e).map(([e,s])=>t.default.createElement(f.Hidden,{features:f.HiddenFeatures.Hidden,...(0,m.compact)({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:l,name:e,value:s,...a})})))}function x({setForm:e,formId:r}){return(0,t.useEffect)(()=>{if(r){let t=document.getElementById(r);t&&e(t)}},[e,r]),r?null:t.default.createElement(f.Hidden,{features:f.HiddenFeatures.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let r=t.closest("form");r&&e(r)}})}e.s(["FormFields",()=>p],140721);let b=(0,t.createContext)(void 0);function y(){return(0,t.useContext)(b)}e.s(["useProvidedId",()=>y],942803);var v=e.i(835696),j=e.i(294316);let k=(0,t.createContext)(null);function N(){var e,r;return null!=(r=null==(e=(0,t.useContext)(k))?void 0:e.value)?r:void 0}function w(){let[e,l]=(0,t.useState)([]);return[e.length>0?e.join(" "):void 0,(0,t.useMemo)(()=>function(e){let s=(0,r.useEvent)(e=>(l(t=>[...t,e]),()=>l(t=>{let r=t.slice(),l=r.indexOf(e);return -1!==l&&r.splice(l,1),r}))),a=(0,t.useMemo)(()=>({register:s,slot:e.slot,name:e.name,props:e.props,value:e.value}),[s,e.slot,e.name,e.props,e.value]);return t.default.createElement(k.Provider,{value:a},e.children)},[l])]}k.displayName="DescriptionContext";let S=Object.assign((0,m.forwardRefWithAs)(function(e,r){let l=(0,t.useId)(),s=n(),{id:a=`headlessui-description-${l}`,...i}=e,o=function e(){let r=(0,t.useContext)(k);if(null===r){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return r}(),c=(0,j.useSyncRefs)(r);(0,v.useIsoMorphicEffect)(()=>o.register(a),[a,o.register]);let d=s||!1,u=(0,t.useMemo)(()=>({...o.slot,disabled:d}),[o.slot,d]),f={ref:c,...o.props,id:a};return(0,m.useRender)()({ourProps:f,theirProps:i,slot:u,defaultTag:"p",name:o.name||"Description"})}),{});e.s(["Description",()=>S,"useDescribedBy",()=>N,"useDescriptions",()=>w],35889);let C=(0,t.createContext)(null);function M(e){var r,l,s;let a=null!=(l=null==(r=(0,t.useContext)(C))?void 0:r.value)?l:void 0;return(null!=(s=null==e?void 0:e.length)?s:0)>0?[a,...e].filter(Boolean).join(" "):a}function O({inherit:e=!1}={}){let l=M(),[s,a]=(0,t.useState)([]),n=e?[l,...s].filter(Boolean):s;return[n.length>0?n.join(" "):void 0,(0,t.useMemo)(()=>function(e){let l=(0,r.useEvent)(e=>(a(t=>[...t,e]),()=>a(t=>{let r=t.slice(),l=r.indexOf(e);return -1!==l&&r.splice(l,1),r}))),s=(0,t.useMemo)(()=>({register:l,slot:e.slot,name:e.name,props:e.props,value:e.value}),[l,e.slot,e.name,e.props,e.value]);return t.default.createElement(C.Provider,{value:s},e.children)},[a])]}C.displayName="LabelContext";let E=Object.assign((0,m.forwardRefWithAs)(function(e,l){var s;let a=(0,t.useId)(),i=function e(){let r=(0,t.useContext)(C);if(null===r){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return r}(),o=y(),c=n(),{id:d=`headlessui-label-${a}`,htmlFor:u=null!=o?o:null==(s=i.props)?void 0:s.htmlFor,passive:f=!1,...h}=e,g=(0,j.useSyncRefs)(l);(0,v.useIsoMorphicEffect)(()=>i.register(d),[d,i.register]);let p=(0,r.useEvent)(e=>{let t=e.currentTarget;if(t instanceof HTMLLabelElement&&e.preventDefault(),i.props&&"onClick"in i.props&&"function"==typeof i.props.onClick&&i.props.onClick(e),t instanceof HTMLLabelElement){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let r=e.getAttribute("aria-disabled");if("true"===r||""===r)return;(e instanceof HTMLInputElement&&("radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}}),x=c||!1,b=(0,t.useMemo)(()=>({...i.slot,disabled:x}),[i.slot,x]),k={ref:g,...i.props,id:d,htmlFor:u,onClick:p};return f&&("onClick"in k&&(delete k.htmlFor,delete k.onClick),"onClick"in h&&delete h.onClick),(0,m.useRender)()({ourProps:k,theirProps:h,slot:b,defaultTag:u?"label":"div",name:i.name||"Label"})}),{});e.s(["Label",()=>E,"useLabelledBy",()=>M,"useLabels",()=>O],722678)},888288,e=>{"use strict";var t=e.i(271645);let r=(e,r)=>{let l=void 0!==r,[s,a]=(0,t.useState)(e);return[l?r:s,e=>{l||a(e)}]};e.s(["default",()=>r])},361653,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t])},841947,e=>{"use strict";let t=(0,e.i(475254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},603908,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",()=>t])},689020,e=>{"use strict";var t=e.i(764205);let r=async e=>{try{let r=await (0,t.modelHubCall)(e);if(console.log("model_info:",r),r?.data.length>0){let e=r.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,r])},597440,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let l={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"};var s=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(s.default,(0,t.default)({},e,{ref:a,icon:l}))});e.s(["default",0,a],597440)},955135,e=>{"use strict";var t=e.i(597440);e.s(["DeleteOutlined",()=>t.default])},107233,37727,e=>{"use strict";var t=e.i(603908);e.s(["Plus",()=>t.default],107233);var r=e.i(841947);e.s(["X",()=>r.default],37727)},158392,419470,e=>{"use strict";var t=e.i(843476),r=e.i(311451);let l={ttl:3600,lowest_latency_buffer:0},s=({routingStrategyArgs:e})=>{let s={ttl:"Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Latency-Based Configuration"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Fine-tune latency-based routing behavior"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e||l).map(([e,l])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:e.replace(/_/g," ")}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:s[e]||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:"object"==typeof l?JSON.stringify(l,null,2):l?.toString(),className:"font-mono text-sm w-full"})]})},e))})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"})]})},a=({routerSettings:e,routerFieldsMetadata:l})=>(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Reliability & Retries"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure retry logic and failure handling"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e).filter(([e,t])=>"fallbacks"!=e&&"context_window_fallbacks"!=e&&"routing_strategy_args"!=e&&"routing_strategy"!=e&&"enable_tag_filtering"!=e).map(([e,s])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:l[e]?.ui_field_name||e}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:l[e]?.field_description||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:null==s||"null"===s?"":"object"==typeof s?JSON.stringify(s,null,2):s?.toString()||"",placeholder:"—",className:"font-mono text-sm w-full"})]})},e))})]});var n=e.i(199133);let i=({selectedStrategy:e,availableStrategies:r,routingStrategyDescriptions:l,routerFieldsMetadata:s,onStrategyChange:a})=>(0,t.jsxs)("div",{className:"space-y-2 max-w-3xl",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:s.routing_strategy?.ui_field_name||"Routing Strategy"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:s.routing_strategy?.field_description||""})]}),(0,t.jsx)("div",{className:"routing-strategy-select max-w-3xl",children:(0,t.jsx)(n.Select,{value:e,onChange:a,style:{width:"100%"},size:"large",children:r.map(e=>(0,t.jsx)(n.Select.Option,{value:e,label:e,children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 py-1",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e}),l[e]&&(0,t.jsx)("span",{className:"text-xs text-gray-500 font-normal",children:l[e]})]})},e))})})]});var o=e.i(790848);let c=({enabled:e,routerFieldsMetadata:r,onToggle:l})=>(0,t.jsx)("div",{className:"space-y-3 max-w-3xl",children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:r.enable_tag_filtering?.ui_field_name||"Enable Tag Filtering"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[r.enable_tag_filtering?.field_description||"",r.enable_tag_filtering?.link&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("a",{href:r.enable_tag_filtering.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Learn more"})]})]})]}),(0,t.jsx)(o.Switch,{checked:e,onChange:l,className:"ml-4"})]})});e.s(["default",0,({value:e,onChange:r,routerFieldsMetadata:l,availableRoutingStrategies:n,routingStrategyDescriptions:o})=>(0,t.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Routing Settings"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure how requests are routed to deployments"})]}),n.length>0&&(0,t.jsx)(i,{selectedStrategy:e.selectedStrategy||e.routerSettings.routing_strategy||null,availableStrategies:n,routingStrategyDescriptions:o,routerFieldsMetadata:l,onStrategyChange:t=>{r({...e,selectedStrategy:t})}}),(0,t.jsx)(c,{enabled:e.enableTagFiltering,routerFieldsMetadata:l,onToggle:t=>{r({...e,enableTagFiltering:t})}})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),"latency-based-routing"===e.selectedStrategy&&(0,t.jsx)(s,{routingStrategyArgs:e.routerSettings.routing_strategy_args}),(0,t.jsx)(a,{routerSettings:e.routerSettings,routerFieldsMetadata:l})]})],158392);var d=e.i(994388),u=e.i(653496),m=e.i(107233),f=e.i(271645),h=e.i(888259),g=e.i(592968),p=e.i(361653),p=p;let x=(0,e.i(475254).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var b=e.i(37727);function y({group:e,onChange:r,availableModels:l,maxFallbacks:s}){let a=l.filter(t=>t!==e.primaryModel),i=e.fallbackModels.length{let l=[...e.fallbackModels];l.includes(t)&&(l=l.filter(e=>e!==t)),r({...e,primaryModel:t,fallbackModels:l})},showSearch:!0,getPopupContainer:e=>e.parentElement||document.body,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:l.map(e=>({label:e,value:e}))}),!e.primaryModel&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-amber-600 text-xs bg-amber-50 p-2 rounded",children:[(0,t.jsx)(p.default,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Select a model to begin configuring fallbacks"})]})]}),(0,t.jsx)("div",{className:"flex items-center justify-center -my-4 z-10",children:(0,t.jsxs)("div",{className:"bg-indigo-50 text-indigo-500 px-4 py-1 rounded-full text-xs font-bold border border-indigo-100 flex items-center gap-2 shadow-sm",children:[(0,t.jsx)(x,{className:"w-4 h-4"}),"IF FAILS, TRY..."]})}),(0,t.jsxs)("div",{className:`transition-opacity duration-300 ${!e.primaryModel?"opacity-50 pointer-events-none":"opacity-100"}`,children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Fallback Chain ",(0,t.jsx)("span",{className:"text-red-500",children:"*"}),(0,t.jsxs)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:["(Max ",s," fallbacks at a time)"]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-200",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(n.Select,{mode:"multiple",className:"w-full",size:"large",placeholder:i?"Select fallback models to add...":`Maximum ${s} fallbacks reached`,value:e.fallbackModels,onChange:t=>{let l=t.slice(0,s);r({...e,fallbackModels:l})},disabled:!e.primaryModel,getPopupContainer:e=>e.parentElement||document.body,options:a.map(e=>({label:e,value:e})),optionRender:(r,l)=>{let s=e.fallbackModels.includes(r.value),a=s?e.fallbackModels.indexOf(r.value)+1:null;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s&&null!==a&&(0,t.jsx)("span",{className:"flex items-center justify-center w-5 h-5 rounded bg-indigo-100 text-indigo-600 text-xs font-bold",children:a}),(0,t.jsx)("span",{children:r.label})]})},maxTagCount:"responsive",maxTagPlaceholder:e=>(0,t.jsx)(g.Tooltip,{styles:{root:{pointerEvents:"none"}},title:e.map(({value:e})=>e).join(", "),children:(0,t.jsxs)("span",{children:["+",e.length," more"]})}),showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1 ml-1",children:i?`Search and select multiple models. Selected models will appear below in order. (${e.fallbackModels.length}/${s} used)`:`Maximum ${s} fallbacks reached. Remove some to add more.`})]}),(0,t.jsx)("div",{className:"space-y-2 min-h-[100px]",children:0===e.fallbackModels.length?(0,t.jsxs)("div",{className:"h-32 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)("span",{className:"text-sm",children:"No fallback models selected"}),(0,t.jsx)("span",{className:"text-xs mt-1",children:"Add models from the dropdown above"})]}):e.fallbackModels.map((l,s)=>(0,t.jsxs)("div",{className:"group flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200 hover:border-indigo-300 hover:shadow-sm transition-all",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded bg-gray-100 text-gray-400 group-hover:text-indigo-500 group-hover:bg-indigo-50",children:(0,t.jsx)("span",{className:"text-xs font-bold",children:s+1})}),(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"font-medium text-gray-800",children:l})})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t;return t=e.fallbackModels.filter((e,t)=>t!==s),void r({...e,fallbackModels:t})},className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-400 hover:text-red-500 p-1",children:(0,t.jsx)(b.X,{className:"w-4 h-4"})})]},`${l}-${s}`))})]})]})]})}function v({groups:e,onGroupsChange:r,availableModels:l,maxFallbacks:s=10,maxGroups:a=5}){let[n,i]=(0,f.useState)(e.length>0?e[0].id:"1");(0,f.useEffect)(()=>{e.length>0?e.some(e=>e.id===n)||i(e[0].id):i("1")},[e]);let o=()=>{if(e.length>=a)return;let t=Date.now().toString();r([...e,{id:t,primaryModel:null,fallbackModels:[]}]),i(t)},c=t=>{r(e.map(e=>e.id===t.id?t:e))},g=e.map((r,a)=>{let n=r.primaryModel?r.primaryModel:`Group ${a+1}`;return{key:r.id,label:n,closable:e.length>1,children:(0,t.jsx)(y,{group:r,onChange:c,availableModels:l,maxFallbacks:s})}});return 0===e.length?(0,t.jsxs)("div",{className:"text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300",children:[(0,t.jsx)("p",{className:"text-gray-500 mb-4",children:"No fallback groups configured"}),(0,t.jsx)(d.Button,{variant:"primary",onClick:o,icon:()=>(0,t.jsx)(m.Plus,{className:"w-4 h-4"}),children:"Create First Group"})]}):(0,t.jsx)(u.Tabs,{type:"editable-card",activeKey:n,onChange:i,onEdit:(t,l)=>{"add"===l?o():"remove"===l&&e.length>1&&(t=>{if(1===e.length)return h.default.warning("At least one group is required");let l=e.filter(e=>e.id!==t);r(l),n===t&&l.length>0&&i(l[l.length-1].id)})(t)},items:g,className:"fallback-tabs",tabBarStyle:{marginBottom:0},hideAdd:e.length>=a})}e.s(["FallbackSelectionForm",()=>v],419470)},525720,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),l=e.i(529681),s=e.i(908286),a=e.i(242064),n=e.i(246422),i=e.i(838378);let o=["wrap","nowrap","wrap-reverse"],c=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],d=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],u=function(e,t){let l,s,a;return(0,r.default)(Object.assign(Object.assign(Object.assign({},(l=!0===t.wrap?"wrap":t.wrap,{[`${e}-wrap-${l}`]:l&&o.includes(l)})),(s={},d.forEach(r=>{s[`${e}-align-${r}`]=t.align===r}),s[`${e}-align-stretch`]=!t.align&&!!t.vertical,s)),(a={},c.forEach(r=>{a[`${e}-justify-${r}`]=t.justify===r}),a)))},m=(0,n.genStyleHooks)("Flex",e=>{let{paddingXS:t,padding:r,paddingLG:l}=e,s=(0,i.mergeToken)(e,{flexGapSM:t,flexGap:r,flexGapLG:l});return[(e=>{let{componentCls:t}=e;return{[t]:{display:"flex",margin:0,padding:0,"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}})(s),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}})(s),(e=>{let{componentCls:t}=e,r={};return o.forEach(e=>{r[`${t}-wrap-${e}`]={flexWrap:e}}),r})(s),(e=>{let{componentCls:t}=e,r={};return d.forEach(e=>{r[`${t}-align-${e}`]={alignItems:e}}),r})(s),(e=>{let{componentCls:t}=e,r={};return c.forEach(e=>{r[`${t}-justify-${e}`]={justifyContent:e}}),r})(s)]},()=>({}),{resetStyle:!1});var f=function(e,t){var r={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(r[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,l=Object.getOwnPropertySymbols(e);st.indexOf(l[s])&&Object.prototype.propertyIsEnumerable.call(e,l[s])&&(r[l[s]]=e[l[s]]);return r};let h=t.default.forwardRef((e,n)=>{let{prefixCls:i,rootClassName:o,className:c,style:d,flex:h,gap:g,vertical:p=!1,component:x="div",children:b}=e,y=f(e,["prefixCls","rootClassName","className","style","flex","gap","vertical","component","children"]),{flex:v,direction:j,getPrefixCls:k}=t.default.useContext(a.ConfigContext),N=k("flex",i),[w,S,C]=m(N),M=null!=p?p:null==v?void 0:v.vertical,O=(0,r.default)(c,o,null==v?void 0:v.className,N,S,C,u(N,e),{[`${N}-rtl`]:"rtl"===j,[`${N}-gap-${g}`]:(0,s.isPresetSize)(g),[`${N}-vertical`]:M}),E=Object.assign(Object.assign({},null==v?void 0:v.style),d);return h&&(E.flex=h),g&&!(0,s.isPresetSize)(g)&&(E.gap=g),w(t.default.createElement(x,Object.assign({ref:n,className:O,style:E},(0,l.default)(y,["justify","wrap","align"])),b))});e.s(["Flex",0,h],525720)},646563,e=>{"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},954616,e=>{"use strict";var t=e.i(271645),r=e.i(114272),l=e.i(540143),s=e.i(915823),a=e.i(619273),n=class extends s.Subscribable{#e;#t=void 0;#r;#l;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,a.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.hashKey)(t.mutationKey)!==(0,a.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#s(),this.#a()}mutate(e,t){return this.#l=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#s(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){l.notifyManager.batch(()=>{if(this.#l&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,l={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#l.onSuccess?.(e.data,t,r,l)}catch(e){Promise.reject(e)}try{this.#l.onSettled?.(e.data,null,t,r,l)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#l.onError?.(e.error,t,r,l)}catch(e){Promise.reject(e)}try{this.#l.onSettled?.(void 0,e.error,t,r,l)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},i=e.i(912598);function o(e,r){let s=(0,i.useQueryClient)(r),[o]=t.useState(()=>new n(s,e));t.useEffect(()=>{o.setOptions(e)},[o,e]);let c=t.useSyncExternalStore(t.useCallback(e=>o.subscribe(l.notifyManager.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d=t.useCallback((e,t)=>{o.mutate(e,t).catch(a.noop)},[o]);if(c.error&&(0,a.shouldThrowError)(o.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:d,mutateAsync:c.mutate}}e.s(["useMutation",()=>o],954616)},127952,368869,e=>{"use strict";var t=e.i(843476),r=e.i(560445),l=e.i(175712),s=e.i(869216),a=e.i(311451),n=e.i(212931),i=e.i(898586);e.i(296059);var o=e.i(868297),c=e.i(732961),d=e.i(289882),u=e.i(170517),m=e.i(628882),f=e.i(320890),h=e.i(104458),g=e.i(722319),p=e.i(8398),x=e.i(279728);e.i(765846);var b=e.i(602716),y=e.i(328052);e.i(262370);var v=e.i(135551);let j=(e,t)=>new v.FastColor(e).setA(t).toRgbString(),k=(e,t)=>new v.FastColor(e).lighten(t).toHexString(),N=e=>{let t=(0,b.generate)(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},w=(e,t)=>{let r=e||"#000",l=t||"#fff";return{colorBgBase:r,colorTextBase:l,colorText:j(l,.85),colorTextSecondary:j(l,.65),colorTextTertiary:j(l,.45),colorTextQuaternary:j(l,.25),colorFill:j(l,.18),colorFillSecondary:j(l,.12),colorFillTertiary:j(l,.08),colorFillQuaternary:j(l,.04),colorBgSolid:j(l,.95),colorBgSolidHover:j(l,1),colorBgSolidActive:j(l,.9),colorBgElevated:k(r,12),colorBgContainer:k(r,8),colorBgLayout:k(r,0),colorBgSpotlight:k(r,26),colorBgBlur:j(l,.04),colorBorder:k(r,26),colorBorderSecondary:k(r,19)}},S={defaultSeed:f.defaultConfig.token,useToken:function(){let[e,t,r]=(0,h.useToken)();return{theme:e,token:t,hashId:r}},defaultAlgorithm:g.default,darkAlgorithm:(e,t)=>{let r=Object.keys(u.defaultPresetColors).map(t=>{let r=(0,b.generate)(e[t],{theme:"dark"});return Array.from({length:10},()=>1).reduce((e,l,s)=>(e[`${t}-${s+1}`]=r[s],e[`${t}${s+1}`]=r[s],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{}),l=null!=t?t:(0,g.default)(e),s=(0,y.default)(e,{generateColorPalettes:N,generateNeutralColorPalettes:w});return Object.assign(Object.assign(Object.assign(Object.assign({},l),r),s),{colorPrimaryBg:s.colorPrimaryBorder,colorPrimaryBgHover:s.colorPrimaryBorderHover})},compactAlgorithm:(e,t)=>{let r=null!=t?t:(0,g.default)(e),l=r.fontSizeSM,s=r.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),function(e){let{sizeUnit:t,sizeStep:r}=e,l=r-2;return{sizeXXL:t*(l+10),sizeXL:t*(l+6),sizeLG:t*(l+2),sizeMD:t*(l+2),sizeMS:t*(l+1),size:t*l,sizeSM:t*l,sizeXS:t*(l-1),sizeXXS:t*(l-1)}}(null!=t?t:e)),(0,x.default)(l)),{controlHeight:s}),(0,p.default)(Object.assign(Object.assign({},r),{controlHeight:s})))},getDesignToken:e=>{let t=(null==e?void 0:e.algorithm)?(0,o.createTheme)(e.algorithm):d.default,r=Object.assign(Object.assign({},u.default),null==e?void 0:e.token);return(0,c.getComputedToken)(r,{override:null==e?void 0:e.token},t,m.default)},defaultConfig:f.defaultConfig,_internalContext:f.DesignTokenContext};e.s(["theme",0,S],368869);var C=e.i(270377),M=e.i(271645);function O({isOpen:e,title:o,alertMessage:c,message:d,resourceInformationTitle:u,resourceInformation:m,onCancel:f,onOk:h,confirmLoading:g,requiredConfirmation:p}){let{Title:x,Text:b}=i.Typography,{token:y}=S.useToken(),[v,j]=(0,M.useState)("");return(0,M.useEffect)(()=>{e&&j("")},[e]),(0,t.jsx)(n.Modal,{title:o,open:e,onOk:h,onCancel:f,confirmLoading:g,okText:g?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!p&&v!==p||g},cancelButtonProps:{disabled:g},children:(0,t.jsxs)("div",{className:"space-y-4",children:[c&&(0,t.jsx)(r.Alert,{message:c,type:"warning"}),(0,t.jsx)(l.Card,{title:u,className:"mt-4",styles:{body:{padding:"16px"},header:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder}},style:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder},children:(0,t.jsx)(s.Descriptions,{column:1,size:"small",children:m&&m.map(({label:e,value:r,...l})=>(0,t.jsx)(s.Descriptions.Item,{label:(0,t.jsx)("span",{className:"font-semibold",children:e}),children:(0,t.jsx)(b,{...l,children:r??"-"})},e))})}),(0,t.jsx)("div",{children:(0,t.jsx)(b,{children:d})}),p&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,t.jsxs)(b,{className:"block text-base font-medium text-gray-700 dark:text-gray-300 mb-2",children:[(0,t.jsx)(b,{children:"Type "}),(0,t.jsx)(b,{strong:!0,type:"danger",children:p}),(0,t.jsx)(b,{children:" to confirm deletion:"})]}),(0,t.jsx)(a.Input,{value:v,onChange:e=>j(e.target.value),placeholder:p,className:"rounded-md",prefix:(0,t.jsx)(C.ExclamationCircleOutlined,{style:{color:y.colorError}}),autoFocus:!0})]})]})})}e.s(["default",()=>O],127952)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/088fea506f07e1cd.js b/litellm/proxy/_experimental/out/_next/static/chunks/088fea506f07e1cd.js
new file mode 100644
index 0000000000..84bed8b7d1
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/088fea506f07e1cd.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,349356,e=>{e.v({AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"})},137429,e=>{e.v({0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"})},916925,e=>{"use strict";var t,a=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t.ZAI="Z.AI (Zhipu AI)",t);let r={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference",ZAI:"zai"},n="../ui/assets/logos/",i={"A2A Agent":`${n}a2a_agent.png`,Ai21:`${n}ai21.svg`,"Ai21 Chat":`${n}ai21.svg`,"AI/ML API":`${n}aiml_api.svg`,"Aiohttp Openai":`${n}openai_small.svg`,Anthropic:`${n}anthropic.svg`,"Anthropic Text":`${n}anthropic.svg`,AssemblyAI:`${n}assemblyai_small.png`,Azure:`${n}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${n}microsoft_azure.svg`,"Azure Text":`${n}microsoft_azure.svg`,Baseten:`${n}baseten.svg`,"Amazon Bedrock":`${n}bedrock.svg`,"Amazon Bedrock Mantle":`${n}bedrock.svg`,"AWS SageMaker":`${n}bedrock.svg`,Cerebras:`${n}cerebras.svg`,Cloudflare:`${n}cloudflare.svg`,Codestral:`${n}mistral.svg`,Cohere:`${n}cohere.svg`,"Cohere Chat":`${n}cohere.svg`,Cometapi:`${n}cometapi.svg`,Cursor:`${n}cursor.svg`,"Databricks (Qwen API)":`${n}databricks.svg`,Dashscope:`${n}dashscope.svg`,Deepseek:`${n}deepseek.svg`,Deepgram:`${n}deepgram.png`,DeepInfra:`${n}deepinfra.png`,ElevenLabs:`${n}elevenlabs.png`,"Fal AI":`${n}fal_ai.jpg`,"Featherless Ai":`${n}featherless.svg`,"Fireworks AI":`${n}fireworks.svg`,Friendliai:`${n}friendli.svg`,"Github Copilot":`${n}github_copilot.svg`,"Google AI Studio":`${n}google.svg`,GradientAI:`${n}gradientai.svg`,Groq:`${n}groq.svg`,vllm:`${n}vllm.png`,Huggingface:`${n}huggingface.svg`,Hyperbolic:`${n}hyperbolic.svg`,Infinity:`${n}infinity.png`,"Jina AI":`${n}jina.png`,"Lambda Ai":`${n}lambda.svg`,"Lm Studio":`${n}lmstudio.svg`,"Meta Llama":`${n}meta_llama.svg`,MiniMax:`${n}minimax.svg`,"Mistral AI":`${n}mistral.svg`,Moonshot:`${n}moonshot.svg`,Morph:`${n}morph.svg`,Nebius:`${n}nebius.svg`,Novita:`${n}novita.svg`,"Nvidia Nim":`${n}nvidia_nim.svg`,Ollama:`${n}ollama.svg`,"Ollama Chat":`${n}ollama.svg`,Oobabooga:`${n}openai_small.svg`,OpenAI:`${n}openai_small.svg`,"Openai Like":`${n}openai_small.svg`,"OpenAI Text Completion":`${n}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${n}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${n}openai_small.svg`,Openrouter:`${n}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${n}oracle.svg`,Perplexity:`${n}perplexity-ai.svg`,Recraft:`${n}recraft.svg`,Replicate:`${n}replicate.svg`,RunwayML:`${n}runwayml.png`,Sagemaker:`${n}bedrock.svg`,Sambanova:`${n}sambanova.svg`,"SAP Generative AI Hub":`${n}sap.png`,Snowflake:`${n}snowflake.svg`,"Text-Completion-Codestral":`${n}mistral.svg`,TogetherAI:`${n}togetherai.svg`,Topaz:`${n}topaz.svg`,Triton:`${n}nvidia_triton.png`,V0:`${n}v0.svg`,"Vercel Ai Gateway":`${n}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${n}google.svg`,"Vertex Ai Beta":`${n}google.svg`,Vllm:`${n}vllm.png`,VolcEngine:`${n}volcengine.png`,"Voyage AI":`${n}voyage.webp`,Watsonx:`${n}watsonx.svg`,"Watsonx Text":`${n}watsonx.svg`,xAI:`${n}xai.svg`,Xinference:`${n}xinference.svg`};e.s(["Providers",()=>a,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else if("Z.AI (Zhipu AI)"===e)return"zai/glm-4.5";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:i[e],displayName:e}}let t=Object.keys(r).find(t=>r[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let n=a[t];return{logo:i[n],displayName:n}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let a=r[e];console.log(`Provider mapped to: ${a}`);let n=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let r=t.litellm_provider;(r===a||"string"==typeof r&&r.includes(a))&&n.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&n.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&n.push(e)}))),n},"providerLogoMap",0,i,"provider_map",0,r])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["LinkOutlined",0,i],596239)},928685,e=>{"use strict";var t=e.i(38953);e.s(["SearchOutlined",()=>t.default])},44121,186515,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["MenuFoldOutlined",0,i],44121);let o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"};var l=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:o}))});e.s(["MenuUnfoldOutlined",0,l],186515)},438957,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["KeyOutlined",0,i],438957)},366308,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["ToolOutlined",0,i],366308)},313603,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["SettingOutlined",0,i],313603)},477189,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["AppstoreOutlined",0,i],477189)},292335,122520,165615,e=>{"use strict";let t={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",TOKEN:"token",BASIC:"basic",OAUTH2:"oauth2",AWS_SIGV4:"aws_sigv4"},a={SSE:"sse",HTTP:"http",STDIO:"stdio",OPENAPI:"openapi"};function r(e){if(e instanceof Error)return e.message;if(e&&"object"==typeof e){let t=e.detail;return"string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e?"string"==typeof e.msg?e.msg:JSON.stringify(e):String(e)).join("; "):t&&"object"==typeof t&&"string"==typeof t.error?t.error:"string"==typeof e.message?e.message:JSON.stringify(e)}return String(e)}e.s(["AUTH_TYPE",0,t,"OAUTH_FLOW",0,{INTERACTIVE:"interactive",M2M:"m2m"},"TRANSPORT",0,a,"handleAuth",0,e=>null==e?t.NONE:e,"handleTransport",0,(e,t)=>null==e?a.SSE:t&&e!==a.STDIO?a.OPENAPI:e],292335),e.s(["extractErrorMessage",()=>r],122520);let n=e=>{let t=new Uint8Array(e),a="";return t.forEach(e=>a+=String.fromCharCode(e)),btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},i=async e=>{let t=new TextEncoder().encode(e);return n(await window.crypto.subtle.digest("SHA-256",t))};e.s(["generateCodeChallenge",0,i,"generateCodeVerifier",0,()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),n(e.buffer)}],165615)},264843,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"}}]},name:"message",theme:"outlined"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["MessageOutlined",0,i],264843)},883552,e=>{"use strict";e.i(247167);var t=e.i(271645),a=e.i(562901),r=e.i(343794),n=e.i(914949),i=e.i(529681),o=e.i(242064),l=e.i(829672),s=e.i(285781),c=e.i(836938),u=e.i(920228),d=e.i(62405),m=e.i(408850),f=e.i(87414),p=e.i(310730);let g=(0,e.i(246422).genStyleHooks)("Popconfirm",e=>(e=>{let{componentCls:t,iconCls:a,antCls:r,zIndexPopup:n,colorText:i,colorWarning:o,marginXXS:l,marginXS:s,fontSize:c,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:n,[`&${r}-popover`]:{fontSize:c},[`${t}-message`]:{marginBottom:s,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${a}`]:{color:o,fontSize:c,lineHeight:1,marginInlineEnd:s},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:l,color:i}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:s}}}}})(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1});var h=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a};let v=e=>{let{prefixCls:r,okButtonProps:n,cancelButtonProps:i,title:l,description:p,cancelText:g,okText:h,okType:v="primary",icon:A=t.createElement(a.default,null),showCancel:O=!0,close:$,onConfirm:b,onCancel:y,onPopupClick:I}=e,{getPrefixCls:E}=t.useContext(o.ConfigContext),[S]=(0,m.useLocale)("Popconfirm",f.default.Popconfirm),C=(0,c.getRenderPropValue)(l),T=(0,c.getRenderPropValue)(p);return t.createElement("div",{className:`${r}-inner-content`,onClick:I},t.createElement("div",{className:`${r}-message`},A&&t.createElement("span",{className:`${r}-message-icon`},A),t.createElement("div",{className:`${r}-message-text`},C&&t.createElement("div",{className:`${r}-title`},C),T&&t.createElement("div",{className:`${r}-description`},T))),t.createElement("div",{className:`${r}-buttons`},O&&t.createElement(u.default,Object.assign({onClick:y,size:"small"},i),g||(null==S?void 0:S.cancelText)),t.createElement(s.default,{buttonProps:Object.assign(Object.assign({size:"small"},(0,d.convertLegacyProps)(v)),n),actionFn:b,close:$,prefixCls:E("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},h||(null==S?void 0:S.okText))))};var A=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a};let O=t.forwardRef((e,s)=>{var c,u;let{prefixCls:d,placement:m="top",trigger:f="click",okType:p="primary",icon:h=t.createElement(a.default,null),children:O,overlayClassName:$,onOpenChange:b,onVisibleChange:y,overlayStyle:I,styles:E,classNames:S}=e,C=A(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:T,className:_,style:M,classNames:x,styles:w}=(0,o.useComponentConfig)("popconfirm"),[L,D]=(0,n.default)(!1,{value:null!=(c=e.open)?c:e.visible,defaultValue:null!=(u=e.defaultOpen)?u:e.defaultVisible}),k=(e,t)=>{D(e,!0),null==y||y(e),null==b||b(e,t)},N=T("popconfirm",d),z=(0,r.default)(N,_,$,x.root,null==S?void 0:S.root),R=(0,r.default)(x.body,null==S?void 0:S.body),[P]=g(N);return P(t.createElement(l.default,Object.assign({},(0,i.default)(C,["title"]),{trigger:f,placement:m,onOpenChange:(t,a)=>{let{disabled:r=!1}=e;r||k(t,a)},open:L,ref:s,classNames:{root:z,body:R},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},w.root),M),I),null==E?void 0:E.root),body:Object.assign(Object.assign({},w.body),null==E?void 0:E.body)},content:t.createElement(v,Object.assign({okType:p,icon:h},e,{prefixCls:N,close:e=>{k(!1,e)},onConfirm:t=>{var a;return null==(a=e.onConfirm)?void 0:a.call(void 0,t)},onCancel:t=>{var a;k(!1,t),null==(a=e.onCancel)||a.call(void 0,t)}})),"data-popover-inject":!0}),O))});O._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:a,placement:n,className:i,style:l}=e,s=h(e,["prefixCls","placement","className","style"]),{getPrefixCls:c}=t.useContext(o.ConfigContext),u=c("popconfirm",a),[d]=g(u);return d(t.createElement(p.default,{placement:n,className:(0,r.default)(u,i),style:l,content:t.createElement(v,Object.assign({prefixCls:u},s))}))},e.s(["Popconfirm",0,O],883552)},689020,e=>{"use strict";var t=e.i(764205);let a=async e=>{try{let a=await (0,t.modelHubCall)(e);if(console.log("model_info:",a),a?.data.length>0){let e=a.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,a])},597440,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["default",0,i],597440)},955135,e=>{"use strict";var t=e.i(597440);e.s(["DeleteOutlined",()=>t.default])},646563,e=>{"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},464571,e=>{"use strict";var t=e.i(920228);e.s(["Button",()=>t.default])},959013,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(n.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["default",0,i],959013)},244451,e=>{"use strict";let t;e.i(247167);var a=e.i(271645),r=e.i(343794),n=e.i(242064),i=e.i(763731),o=e.i(174428);let l=80*Math.PI,s=e=>{let{dotClassName:t,style:n,hasCircleCls:i}=e;return a.createElement("circle",{className:(0,r.default)(`${t}-circle`,{[`${t}-circle-bg`]:i}),r:40,cx:50,cy:50,strokeWidth:20,style:n})},c=({percent:e,prefixCls:t})=>{let n=`${t}-dot`,i=`${n}-holder`,c=`${i}-hidden`,[u,d]=a.useState(!1);(0,o.default)(()=>{0!==e&&d(!0)},[0!==e]);let m=Math.max(Math.min(e,100),0);if(!u)return null;let f={strokeDashoffset:`${l/4}`,strokeDasharray:`${l*m/100} ${l*(100-m)/100}`};return a.createElement("span",{className:(0,r.default)(i,`${n}-progress`,m<=0&&c)},a.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m},a.createElement(s,{dotClassName:n,hasCircleCls:!0}),a.createElement(s,{dotClassName:n,style:f})))};function u(e){let{prefixCls:t,percent:n=0}=e,i=`${t}-dot`,o=`${i}-holder`,l=`${o}-hidden`;return a.createElement(a.Fragment,null,a.createElement("span",{className:(0,r.default)(o,n>0&&l)},a.createElement("span",{className:(0,r.default)(i,`${t}-dot-spin`)},[1,2,3,4].map(e=>a.createElement("i",{className:`${t}-dot-item`,key:e})))),a.createElement(c,{prefixCls:t,percent:n}))}function d(e){var t;let{prefixCls:n,indicator:o,percent:l}=e,s=`${n}-dot`;return o&&a.isValidElement(o)?(0,i.cloneElement)(o,{className:(0,r.default)(null==(t=o.props)?void 0:t.className,s),percent:l}):a.createElement(u,{prefixCls:n,percent:l})}e.i(296059);var m=e.i(694758),f=e.i(183293),p=e.i(246422),g=e.i(838378);let h=new m.Keyframes("antSpinMove",{to:{opacity:1}}),v=new m.Keyframes("antRotate",{to:{transform:"rotate(405deg)"}}),A=(0,p.genStyleHooks)("Spin",e=>(e=>{let{componentCls:t,calc:a}=e;return{[t]:Object.assign(Object.assign({},(0,f.resetComponent)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:a(a(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:a(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:a(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:a(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:a(a(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:a(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:a(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:a(a(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:a(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:a(e.dotSize).sub(a(e.marginXXS).div(2)).div(2).equal(),height:a(e.dotSize).sub(a(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:h,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:v,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:a(a(e.dotSizeSM).sub(a(e.marginXXS).div(2))).div(2).equal(),height:a(a(e.dotSizeSM).sub(a(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:a(a(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:a(a(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})((0,g.mergeToken)(e,{spinDotDefault:e.colorTextDescription})),e=>{let{controlHeightLG:t,controlHeight:a}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:a}}),O=[[30,.05],[70,.03],[96,.01]];var $=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a};let b=e=>{var i;let{prefixCls:o,spinning:l=!0,delay:s=0,className:c,rootClassName:u,size:m="default",tip:f,wrapperClassName:p,style:g,children:h,fullscreen:v=!1,indicator:b,percent:y}=e,I=$(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:E,direction:S,className:C,style:T,indicator:_}=(0,n.useComponentConfig)("spin"),M=E("spin",o),[x,w,L]=A(M),[D,k]=a.useState(()=>l&&(!l||!s||!!Number.isNaN(Number(s)))),N=function(e,t){let[r,n]=a.useState(0),i=a.useRef(null),o="auto"===t;return a.useEffect(()=>(o&&e&&(n(0),i.current=setInterval(()=>{n(e=>{let t=100-e;for(let a=0;a{i.current&&(clearInterval(i.current),i.current=null)}),[o,e]),o?r:t}(D,y);a.useEffect(()=>{if(l){let e=function(e,t,a){var r,n=a||{},i=n.noTrailing,o=void 0!==i&&i,l=n.noLeading,s=void 0!==l&&l,c=n.debounceMode,u=void 0===c?void 0:c,d=!1,m=0;function f(){r&&clearTimeout(r)}function p(){for(var a=arguments.length,n=Array(a),i=0;ie?s?(m=Date.now(),o||(r=setTimeout(u?g:p,e))):p():!0!==o&&(r=setTimeout(u?g:p,void 0===u?e-c:e)))}return p.cancel=function(e){var t=(e||{}).upcomingOnly;f(),d=!(void 0!==t&&t)},p}(s,()=>{k(!0)},{debounceMode:false});return e(),()=>{var t;null==(t=null==e?void 0:e.cancel)||t.call(e)}}k(!1)},[s,l]);let z=a.useMemo(()=>void 0!==h&&!v,[h,v]),R=(0,r.default)(M,C,{[`${M}-sm`]:"small"===m,[`${M}-lg`]:"large"===m,[`${M}-spinning`]:D,[`${M}-show-text`]:!!f,[`${M}-rtl`]:"rtl"===S},c,!v&&u,w,L),P=(0,r.default)(`${M}-container`,{[`${M}-blur`]:D}),H=null!=(i=null!=b?b:_)?i:t,V=Object.assign(Object.assign({},T),g),B=a.createElement("div",Object.assign({},I,{style:V,className:R,"aria-live":"polite","aria-busy":D}),a.createElement(d,{prefixCls:M,indicator:H,percent:N}),f&&(z||v)?a.createElement("div",{className:`${M}-text`},f):null);return x(z?a.createElement("div",Object.assign({},I,{className:(0,r.default)(`${M}-nested-loading`,p,w,L)}),D&&a.createElement("div",{key:"loading"},B),a.createElement("div",{className:P,key:"container"},h)):v?a.createElement("div",{className:(0,r.default)(`${M}-fullscreen`,{[`${M}-fullscreen-show`]:D},u,w,L)},B):B)};b.setDefaultIndicator=e=>{t=e},e.s(["default",0,b],244451)},482725,e=>{"use strict";var t=e.i(244451);e.s(["Spin",()=>t.default])},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},751904,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default])},822315,(e,t,a)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",a="minute",r="hour",n="week",i="month",o="quarter",l="year",s="date",c="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=function(e,t,a){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(a)+e},f="en",p={};p[f]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],a=e%100;return"["+e+(t[(a-20)%10]||t[a]||t[0])+"]"}};var g="$isDayjsObject",h=function(e){return e instanceof $||!(!e||!e[g])},v=function e(t,a,r){var n;if(!t)return f;if("string"==typeof t){var i=t.toLowerCase();p[i]&&(n=i),a&&(p[i]=a,n=i);var o=t.split("-");if(!n&&o.length>1)return e(o[0])}else{var l=t.name;p[l]=t,n=l}return!r&&n&&(f=n),n||!r&&f},A=function(e,t){if(h(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new $(a)},O={s:m,z:function(e){var t=-e.utcOffset(),a=Math.abs(t);return(t<=0?"+":"-")+m(Math.floor(a/60),2,"0")+":"+m(a%60,2,"0")},m:function e(t,a){if(t.date(){"use strict";function r(e){return(r="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)}Object.defineProperty(s,"__esModule",{value:!0}),s.CopyToClipboard=void 0;var l=n(e.r(271645)),a=n(e.r(844343)),i=["text","onCopy","options","children"];function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,r)}return s}function d(e){for(var t=1;t=0||(l[s]=e[s]);return l}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(l[s]=e[s])}return l}(e,i),r=l.default.Children.only(t);return l.default.cloneElement(r,d(d({},s),{},{onClick:this.onClick}))}}],function(e,t){for(var s=0;s{"use strict";var r=e.r(743151).CopyToClipboard;r.CopyToClipboard=r,t.exports=r},663435,152473,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(199133),l=e.i(898586),a=e.i(56456);let i={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class n{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...i,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function o(e,t){let[r,l]=(0,s.useState)(e),a=function(e,t){let[r]=(0,s.useState)(()=>{var s;return Object.getOwnPropertyNames(Object.getPrototypeOf(s=new n(e,t))).filter(e=>"function"==typeof s[e]).reduce((e,t)=>{let r=s[t];return"function"==typeof r&&(e[t]=r.bind(s)),e},{})});return r.setOptions(t),r}(l,t);return[r,a.maybeExecute,a]}e.s(["useDebouncedState",()=>o],152473);var d=e.i(785242);let{Text:c}=l.Typography;e.s(["default",0,({value:e,onChange:l,onTeamSelect:i,disabled:n,organizationId:u,pageSize:m=20})=>{let[h,x]=(0,s.useState)(""),[p,f]=o("",{wait:300}),{data:g,fetchNextPage:b,hasNextPage:y,isFetchingNextPage:j,isLoading:v}=(0,d.useInfiniteTeams)(m,p||void 0,u),w=(0,s.useMemo)(()=>{if(!g?.pages)return[];let e=new Set,t=[];for(let s of g.pages)for(let r of s.teams)e.has(r.team_id)||(e.add(r.team_id),t.push(r));return t},[g]);return(0,t.jsx)(r.Select,{showSearch:!0,placeholder:"Search or select a team",value:e||void 0,onChange:e=>{l?.(e??""),i&&i(e?w.find(t=>t.team_id===e)??null:null)},disabled:n,allowClear:!0,filterOption:!1,onSearch:e=>{x(e),f(e)},searchValue:h,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&y&&!j&&b()},loading:v,notFoundContent:v?(0,t.jsx)(a.LoadingOutlined,{spin:!0}):"No teams found","data-testid":"team-dropdown",popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,j&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(a.LoadingOutlined,{spin:!0})})]}),children:w.map(e=>(0,t.jsxs)(r.Select.Option,{value:e.team_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,t.jsxs)(c,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})}],663435)},519756,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let r={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"};var l=e.i(9583),a=s.forwardRef(function(e,a){return s.createElement(l.default,(0,t.default)({},e,{ref:a,icon:r}))});e.s(["UploadOutlined",0,a],519756)},435451,620250,e=>{"use strict";var t=e.i(843476),s=e.i(290571),r=e.i(271645);let l=e=>{var t=(0,s.__rest)(e,[]);return r.default.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),r.default.createElement("path",{d:"M12 4v16m8-8H4"}))},a=e=>{var t=(0,s.__rest)(e,[]);return r.default.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),r.default.createElement("path",{d:"M20 12H4"}))};var i=e.i(444755),n=e.i(673706),o=e.i(677955);let d="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",u=r.default.forwardRef((e,t)=>{let{onSubmit:u,enableStepper:m=!0,disabled:h,onValueChange:x,onChange:p}=e,f=(0,s.__rest)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,r.useRef)(null),[b,y]=r.default.useState(!1),j=r.default.useCallback(()=>{y(!0)},[]),v=r.default.useCallback(()=>{y(!1)},[]),[w,_]=r.default.useState(!1),N=r.default.useCallback(()=>{_(!0)},[]),C=r.default.useCallback(()=>{_(!1)},[]);return r.default.createElement(o.default,Object.assign({type:"number",ref:(0,n.mergeRefs)([g,t]),disabled:h,makeInputClassName:(0,n.makeClassName)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null==(t=g.current)?void 0:t.value;null==u||u(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&j(),"ArrowUp"===e.key&&N()},onKeyUp:e=>{"ArrowDown"===e.key&&v(),"ArrowUp"===e.key&&C()},onChange:e=>{h||(null==x||x(parseFloat(e.target.value)),null==p||p(e))},stepper:m?r.default.createElement("div",{className:(0,i.tremorTwMerge)("flex justify-center align-middle")},r.default.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;h||(null==(e=g.current)||e.stepDown(),null==(t=g.current)||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.tremorTwMerge)(!h&&c,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},r.default.createElement(a,{"data-testid":"step-down",className:(b?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),r.default.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;h||(null==(e=g.current)||e.stepUp(),null==(t=g.current)||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.tremorTwMerge)(!h&&c,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},r.default.createElement(l,{"data-testid":"step-up",className:(w?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},f))});u.displayName="NumberInput",e.s(["NumberInput",()=>u],620250),e.s(["default",0,({step:e=.01,style:s={width:"100%"},placeholder:r="Enter a numerical value",min:l,max:a,onChange:i,...n})=>(0,t.jsx)(u,{onWheel:e=>e.currentTarget.blur(),step:e,style:s,placeholder:r,min:l,max:a,onChange:i,...n})],435451)},285027,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let r={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"};var l=e.i(9583),a=s.forwardRef(function(e,a){return s.createElement(l.default,(0,t.default)({},e,{ref:a,icon:r}))});e.s(["WarningOutlined",0,a],285027)},213205,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-add",theme:"outlined"};var l=e.i(9583),a=s.forwardRef(function(e,a){return s.createElement(l.default,(0,t.default)({},e,{ref:a,icon:r}))});e.s(["UserAddOutlined",0,a],213205)},355619,e=>{"use strict";var t=e.i(764205);let s=async(e,s,r)=>{try{if(null===e||null===s)return;if(null!==r){let l=(await (0,t.modelAvailableCall)(r,e,s,!0,null,!0)).data.map(e=>e.id),a=[],i=[];return l.forEach(e=>{e.endsWith("/*")?a.push(e):i.push(e)}),[...a,...i]}}catch(e){console.error("Error fetching user models:",e)}};e.s(["fetchAvailableModelsForTeamOrKey",0,s,"getModelDisplayName",0,e=>{if("all-proxy-models"===e)return"All Proxy Models";if(e.endsWith("/*")){let t=e.replace("/*","");return`All ${t} models`}return e},"unfurlWildcardModelsInList",0,(e,t)=>{let s=[],r=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let l=e.replace("/*",""),a=t.filter(e=>e.startsWith(l+"/"));r.push(...a),s.push(e)}else r.push(e)}),[...s,...r].filter((e,t,s)=>s.indexOf(e)===t)}])},860585,e=>{"use strict";var t=e.i(843476),s=e.i(199133);let{Option:r}=s.Select;e.s(["default",0,({value:e,onChange:l,className:a="",style:i={}})=>(0,t.jsxs)(s.Select,{style:{width:"100%",...i},value:e||void 0,onChange:l,className:a,placeholder:"n/a",allowClear:!0,children:[(0,t.jsx)(r,{value:"1h",children:"hourly"}),(0,t.jsx)(r,{value:"24h",children:"daily"}),(0,t.jsx)(r,{value:"7d",children:"weekly"}),(0,t.jsx)(r,{value:"30d",children:"monthly"})]}),"getBudgetDurationLabel",0,e=>e?({"1h":"hourly","24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set"])},447082,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(599724),l=e.i(464571),a=e.i(212931),i=e.i(291542),n=e.i(515831),o=e.i(898586),d=e.i(519756),c=e.i(737434),u=e.i(285027),m=e.i(993914),h=e.i(955135);e.i(247167);var x=e.i(931067);let p={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"};var f=e.i(9583),g=s.forwardRef(function(e,t){return s.createElement(f.default,(0,x.default)({},e,{ref:t,icon:p}))}),b=e.i(764205),y=e.i(59935),j=e.i(220508),v=e.i(964306);let w=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});var _=e.i(237016),N=e.i(727749);e.s(["default",0,({accessToken:e,teams:x,possibleUIRoles:p,onUsersCreated:f})=>{let[C,S]=(0,s.useState)(!1),[k,O]=(0,s.useState)([]),[I,T]=(0,s.useState)(!1),[E,P]=(0,s.useState)(null),[U,M]=(0,s.useState)(null),[V,B]=(0,s.useState)(null),[F,L]=(0,s.useState)(null),[D,R]=(0,s.useState)(null),[z,A]=(0,s.useState)("http://localhost:4000");(0,s.useEffect)(()=>{(async()=>{try{let t=await (0,b.getProxyUISettings)(e);R(t)}catch(e){console.error("Error fetching UI settings:",e)}})(),A(new URL("/",window.location.href).toString())},[e]);let $=async()=>{T(!0);let t=k.map(e=>({...e,status:"pending"}));O(t);let s=!1;for(let r=0;re.trim()).filter(Boolean),0===t.teams.length&&delete t.teams),l.models&&"string"==typeof l.models&&""!==l.models.trim()&&(t.models=l.models.split(",").map(e=>e.trim()).filter(Boolean),0===t.models.length&&delete t.models),l.max_budget&&""!==l.max_budget.toString().trim()){let e=parseFloat(l.max_budget.toString());!isNaN(e)&&e>0&&(t.max_budget=e)}l.budget_duration&&""!==l.budget_duration.trim()&&(t.budget_duration=l.budget_duration.trim()),l.metadata&&"string"==typeof l.metadata&&""!==l.metadata.trim()&&(t.metadata=l.metadata.trim()),console.log("Sending user data:",t);let a=await (0,b.userCreateCall)(e,null,t);if(console.log("Full response:",a),a&&(a.key||a.user_id)){s=!0,console.log("Success case triggered");let t=a.data?.user_id||a.user_id;try{if(D?.SSO_ENABLED){let e=new URL("/ui",z).toString();O(t=>t.map((t,s)=>s===r?{...t,status:"success",key:a.key||a.user_id,invitation_link:e}:t))}else{let s=await (0,b.invitationCreateCall)(e,t),l=new URL(`/ui?invitation_id=${s.id}`,z).toString();O(e=>e.map((e,t)=>t===r?{...e,status:"success",key:a.key||a.user_id,invitation_link:l}:e))}}catch(e){console.error("Error creating invitation:",e),O(e=>e.map((e,t)=>t===r?{...e,status:"success",key:a.key||a.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=a?.error||"Failed to create user";console.log("Error message:",e),O(t=>t.map((t,s)=>s===r?{...t,status:"failed",error:e}:t))}}catch(t){console.error("Caught error:",t);let e=t?.response?.data?.error||t?.message||String(t);O(t=>t.map((t,s)=>s===r?{...t,status:"failed",error:e}:t))}}T(!1),s&&f&&f()},K=[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,s)=>s.isValid?s.status&&"pending"!==s.status?"success"===s.status?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(j.CheckCircleIcon,{className:"h-5 w-5 text-green-500 mr-2"}),(0,t.jsx)("span",{className:"text-green-500",children:"Success"})]}),s.invitation_link&&(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:s.invitation_link}),(0,t.jsx)(_.CopyToClipboard,{text:s.invitation_link,onCopy:()=>N.default.success("Invitation link copied!"),children:(0,t.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(v.XCircleIcon,{className:"h-5 w-5 text-red-500 mr-2"}),(0,t.jsx)("span",{className:"text-red-500",children:"Failed"})]}),s.error&&(0,t.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(s.error)})]}):(0,t.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(v.XCircleIcon,{className:"h-5 w-5 text-red-500 mr-2"}),(0,t.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),s.error&&(0,t.jsx)("span",{className:"text-sm text-red-500 ml-7",children:s.error})]})}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{type:"primary",className:"mb-0",onClick:()=>S(!0),children:"+ Bulk Invite Users"}),(0,t.jsx)(a.Modal,{title:"Bulk Invite Users",open:C,width:800,onCancel:()=>S(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,t.jsx)("div",{className:"flex flex-col",children:0===k.length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,t.jsxs)("div",{className:"ml-11 mb-6",children:[(0,t.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,t.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,t.jsx)("li",{children:"Download our CSV template"}),(0,t.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,t.jsx)("li",{children:"Save the file and upload it here"}),(0,t.jsx)("li",{children:"After creation, download the results file containing the Virtual Keys for each user"})]}),(0,t.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"user_email"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"user_role"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"teams"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"models"}),(0,t.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,t.jsx)(l.Button,{type:"primary",size:"large",className:"w-full md:w-auto",icon:(0,t.jsx)(c.DownloadOutlined,{}),children:"Download CSV Template"})]}),(0,t.jsxs)("div",{className:"flex items-center mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,t.jsxs)("div",{className:"ml-11",children:[F?(0,t.jsxs)("div",{className:`mb-4 p-4 rounded-md border ${V?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[V?(0,t.jsx)(g,{className:"text-red-500 text-xl mr-3"}):(0,t.jsx)(m.FileTextOutlined,{className:"text-blue-500 text-xl mr-3"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Typography.Text,{strong:!0,className:V?"text-red-800":"text-blue-800",children:F.name}),(0,t.jsxs)(o.Typography.Text,{className:`block text-xs ${V?"text-red-600":"text-blue-600"}`,children:[(F.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,t.jsx)(l.Button,{size:"small",onClick:()=>{L(null),O([]),P(null),M(null),B(null)},className:"flex items-center",icon:(0,t.jsx)(h.DeleteOutlined,{}),children:"Remove"})]}),V?(0,t.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,t.jsx)(u.WarningOutlined,{className:"mr-2 mt-0.5"}),(0,t.jsx)("span",{children:V})]}):!U&&(0,t.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,t.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,t.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,t.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,t.jsx)(n.Upload,{beforeUpload:e=>((P(null),M(null),B(null),L(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?B(`File is too large (${(e.size/1048576).toFixed(1)} MB). Please upload a CSV file smaller than 5MB.`):y.default.parse(e,{complete:e=>{if(!e.data||0===e.data.length){M("The CSV file appears to be empty. Please upload a file with data."),O([]);return}if(1===e.data.length){M("The CSV file only contains headers but no user data. Please add user data to your CSV."),O([]);return}let t=e.data[0];if(0===t.length||1===t.length&&""===t[0]){M("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),O([]);return}let s=["user_email","user_role"].filter(e=>!t.includes(e));if(s.length>0){M(`Your CSV is missing these required columns: ${s.join(", ")}. Please add these columns to your CSV file.`),O([]);return}try{let s=e.data.slice(1).map((e,s)=>{if(0===e.length||1===e.length&&""===e[0])return null;if(e.length=parseFloat(r.max_budget.toString())&&l.push("Max budget must be greater than 0")),r.budget_duration&&!r.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&l.push(`Invalid budget duration format "${r.budget_duration}". Use format like "30d", "1mo", "2w", "6h"`),r.teams&&"string"==typeof r.teams&&x&&x.length>0){let e=x.map(e=>e.team_id),t=r.teams.split(",").map(e=>e.trim()).filter(t=>!e.includes(t));t.length>0&&l.push(`Unknown team(s): ${t.join(", ")}`)}return l.length>0&&(r.isValid=!1,r.error=l.join(", ")),r}).filter(Boolean),r=s.filter(e=>e.isValid);O(s),0===s.length?M("No valid data rows found in the CSV file. Please check your file format."):0===r.length?P("No valid users found in the CSV. Please check the errors below and fix your CSV file."):r.length{P(`Failed to parse CSV file: ${e.message}`),O([])},header:!1}):(B(`Invalid file type: ${e.name}. Please upload a CSV file (.csv extension).`),N.default.fromBackend("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,t.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,t.jsx)(d.UploadOutlined,{className:"text-3xl text-gray-400 mb-2"}),(0,t.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,t.jsx)(l.Button,{size:"small",children:"Browse files"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),U&&(0,t.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)(w,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Typography.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,t.jsx)(o.Typography.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:U}),(0,t.jsx)(o.Typography.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center mb-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:k.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),E&&(0,t.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)(u.WarningOutlined,{className:"text-red-500 mr-2 mt-1"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.Text,{className:"text-red-600 font-medium",children:E}),k.some(e=>!e.isValid)&&(0,t.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,t.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,t.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,t.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,t.jsxs)("div",{className:"ml-11",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,t.jsx)("div",{className:"flex items-center",children:k.some(e=>"success"===e.status||"failed"===e.status)?(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(r.Text,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,t.jsxs)(r.Text,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[k.filter(e=>"success"===e.status).length," Successful"]}),k.some(e=>"failed"===e.status)&&(0,t.jsxs)(r.Text,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[k.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(r.Text,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,t.jsxs)(r.Text,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[k.filter(e=>e.isValid).length," of ",k.length," users valid"]})]})}),!k.some(e=>"success"===e.status||"failed"===e.status)&&(0,t.jsxs)("div",{className:"flex space-x-3",children:[(0,t.jsx)(l.Button,{onClick:()=>{O([]),P(null)},children:"Back"}),(0,t.jsx)(l.Button,{type:"primary",onClick:$,disabled:0===k.filter(e=>e.isValid).length||I,children:I?"Creating...":`Create ${k.filter(e=>e.isValid).length} Users`})]})]}),k.some(e=>"success"===e.status)&&(0,t.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,t.jsxs)("div",{className:"flex items-start",children:[(0,t.jsx)("div",{className:"mr-3 mt-1",children:(0,t.jsx)(j.CheckCircleIcon,{className:"h-5 w-5 text-blue-500"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.Text,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,t.jsxs)(r.Text,{className:"block text-sm text-blue-700 mt-1",children:[(0,t.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing Virtual Keys and invitation links. Users will need these Virtual Keys to make LLM requests through LiteLLM."]})]})]})}),(0,t.jsx)(i.Table,{dataSource:k,columns:K,size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!k.some(e=>"success"===e.status||"failed"===e.status)&&(0,t.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,t.jsx)(l.Button,{onClick:()=>{O([]),P(null)},className:"mr-3",children:"Back"}),(0,t.jsx)(l.Button,{type:"primary",onClick:$,disabled:0===k.filter(e=>e.isValid).length||I,children:I?"Creating...":`Create ${k.filter(e=>e.isValid).length} Users`})]}),k.some(e=>"success"===e.status||"failed"===e.status)&&(0,t.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,t.jsx)(l.Button,{onClick:()=>{O([]),P(null)},className:"mr-3",children:"Start New Bulk Import"}),(0,t.jsx)(l.Button,{type:"primary",onClick:()=>{let e=k.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),t=new Blob([y.default.unparse(e)],{type:"text/csv"}),s=window.URL.createObjectURL(t),r=document.createElement("a");r.href=s,r.download="bulk_users_results.csv",document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(s)},icon:(0,t.jsx)(c.DownloadOutlined,{}),children:"Download User Credentials"})]})]})]})})})]})}],447082)},371455,172372,e=>{"use strict";var t=e.i(843476),s=e.i(827252),r=e.i(213205),l=e.i(912598),a=e.i(109799),i=e.i(677667),n=e.i(130643),o=e.i(898667),d=e.i(35983),c=e.i(779241),u=e.i(560445),m=e.i(464571),h=e.i(536916),x=e.i(808613),p=e.i(311451),f=e.i(212931),g=e.i(199133),b=e.i(770914),y=e.i(592968),j=e.i(898586),v=e.i(271645),w=e.i(447082),_=e.i(663435),N=e.i(355619),C=e.i(727749),S=e.i(764205),k=e.i(237016),O=e.i(599724);function I({isInvitationLinkModalVisible:e,setIsInvitationLinkModalVisible:s,baseUrl:r,invitationLinkData:l,modalType:a="invitation"}){let{Title:i,Paragraph:n}=j.Typography,o=()=>{if(!r)return"";let e=new URL(r).pathname,t=e&&"/"!==e?`${e}/ui`:"ui";if(l?.has_user_setup_sso)return new URL(t,r).toString();let s=`${t}?invitation_id=${l?.id}`;return"resetPassword"===a&&(s+="&action=reset_password"),new URL(s,r).toString()};return(0,t.jsxs)(f.Modal,{title:"invitation"===a?"Invitation Link":"Reset Password Link",open:e,width:800,footer:null,onOk:()=>{s(!1)},onCancel:()=>{s(!1)},children:[(0,t.jsx)(n,{children:"invitation"===a?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,t.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,t.jsx)(O.Text,{className:"text-base",children:"User ID"}),(0,t.jsx)(O.Text,{children:l?.user_id})]}),(0,t.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,t.jsx)(O.Text,{children:"invitation"===a?"Invitation Link":"Reset Password Link"}),(0,t.jsx)(O.Text,{children:(0,t.jsx)(O.Text,{children:o()})})]}),(0,t.jsx)("div",{className:"flex justify-end mt-5",children:(0,t.jsx)(k.CopyToClipboard,{text:o(),onCopy:()=>C.default.success("Copied!"),children:(0,t.jsx)(m.Button,{type:"primary",children:"invitation"===a?"Copy invitation link":"Copy password reset link"})})})]})}e.s(["default",()=>I],172372);let{Option:T}=g.Select,{Text:E,Link:P,Title:U}=j.Typography;e.s(["CreateUserButton",0,({userID:e,accessToken:j,teams:k,possibleUIRoles:O,onUserCreated:U,isEmbedded:M=!1})=>{let V=(0,l.useQueryClient)(),[B,F]=(0,v.useState)(null),[L]=x.Form.useForm(),[D,R]=(0,v.useState)(!1),[z,A]=(0,v.useState)(!1),[$,K]=(0,v.useState)([]),[W,H]=(0,v.useState)(!1),[q,G]=(0,v.useState)(null),[J,Q]=(0,v.useState)(null),{data:X=[]}=(0,a.useOrganizations)();(0,v.useMemo)(()=>{let e=X.flatMap(e=>e.teams||[]);return e.length>0?e:k||[]},[X,k]),(0,v.useEffect)(()=>{let t=async()=>{try{let t=await (0,S.modelAvailableCall)(j,e,"any"),s=[];for(let e=0;e{try{C.default.info("Making API Call"),M||R(!0),t.models&&0!==t.models.length||"proxy_admin"===t.user_role||(t.models=["no-default-models"]),t.organization_ids&&(t.organizations=t.organization_ids,delete t.organization_ids);let s=await (0,S.userCreateCall)(j,null,t);await V.invalidateQueries({queryKey:["userList"]}),A(!0);let r=s.data?.user_id||s.user_id;if(U&&M){U(r),L.resetFields();return}if(B?.SSO_ENABLED){let t={id:"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),user_id:r,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:e,updated_at:new Date,updated_by:e,has_user_setup_sso:!0};G(t),H(!0)}else(0,S.invitationCreateCall)(j,r).then(e=>{e.has_user_setup_sso=!1,G(e),H(!0)});C.default.success("API user Created"),L.resetFields(),localStorage.removeItem("userData"+e)}catch(t){let e=t.response?.data?.detail||t?.message||"Error creating the user";C.default.fromBackend(e),console.error("Error creating the user:",t)}};return M?(0,t.jsxs)(x.Form,{form:L,onFinish:Y,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{user_role:"internal_user_viewer",send_invite_email:!0},children:[(0,t.jsx)(u.Alert,{message:"Email invitations",description:(0,t.jsxs)(t.Fragment,{children:["New users receive an email invite only when an email integration (SMTP, Resend, or SendGrid) is configured."," ",(0,t.jsx)(P,{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",children:"Learn how to set up email notifications"})]}),type:"info",showIcon:!0,className:"mb-4"}),(0,t.jsx)(x.Form.Item,{label:"User Email",name:"user_email",children:(0,t.jsx)(c.TextInput,{placeholder:""})}),(0,t.jsx)(x.Form.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(g.Select,{children:O&&Object.entries(O).map(([e,{ui_label:s,description:r}])=>(0,t.jsx)(d.SelectItem,{value:e,title:s,children:(0,t.jsxs)("div",{className:"flex",children:[s," ",(0,t.jsx)(E,{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:r})]})},e))})}),(0,t.jsx)(x.Form.Item,{label:"Team",name:"team_id",children:(0,t.jsx)(_.default,{})}),(0,t.jsx)(x.Form.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(p.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(x.Form.Item,{label:"Send invitation email",name:"send_invite_email",valuePropName:"checked",children:(0,t.jsx)(h.Checkbox,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(m.Button,{htmlType:"submit",children:"Create User"})})]}):(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(m.Button,{type:"primary",className:"mb-0",onClick:()=>R(!0),children:"+ Invite User"}),(0,t.jsx)(w.default,{accessToken:j,teams:k,possibleUIRoles:O}),(0,t.jsxs)(f.Modal,{title:"Invite User",open:D,width:800,footer:null,onOk:()=>{R(!1),L.resetFields()},onCancel:()=>{R(!1),A(!1),L.resetFields()},children:[(0,t.jsxs)(b.Space,{direction:"vertical",size:"middle",children:[(0,t.jsx)(E,{className:"mb-1",children:"Create a User who can own keys"}),(0,t.jsx)(u.Alert,{message:"Email invitations",description:(0,t.jsxs)(t.Fragment,{children:["New users receive an email invite only when an email integration (SMTP, Resend, or SendGrid) is configured."," ",(0,t.jsx)(P,{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",children:"Learn how to set up email notifications"})]}),type:"info",showIcon:!0,className:"mb-4"})]}),(0,t.jsxs)(x.Form,{form:L,onFinish:Y,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{user_role:"internal_user_viewer",send_invite_email:!0},children:[(0,t.jsx)(x.Form.Item,{label:"User Email",name:"user_email",children:(0,t.jsx)(p.Input,{})}),(0,t.jsx)(x.Form.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(y.Tooltip,{title:"This role is independent of any team/org specific roles. Configure Team / Organization Admins in the Settings",children:(0,t.jsx)(s.InfoCircleOutlined,{})})]}),name:"user_role",children:(0,t.jsx)(g.Select,{children:O&&Object.entries(O).map(([e,{ui_label:s,description:r}])=>(0,t.jsxs)(d.SelectItem,{value:e,title:s,children:[(0,t.jsx)(E,{children:s}),(0,t.jsxs)(E,{type:"secondary",children:[" - ",r]})]},e))})}),(0,t.jsx)(x.Form.Item,{label:"Team",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,t.jsx)(_.default,{})}),(0,t.jsx)(x.Form.Item,{label:"Organization",name:"organization_ids",help:"The user will be added to the selected organization(s).",children:(0,t.jsx)(g.Select,{mode:"multiple",placeholder:"Select Organization",style:{width:"100%"},children:X.map(e=>(0,t.jsxs)(T,{value:e.organization_id,children:[e.organization_alias," (",e.organization_id,")"]},e.organization_id))})}),(0,t.jsx)(x.Form.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(p.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(x.Form.Item,{label:"Send invitation email",name:"send_invite_email",valuePropName:"checked",children:(0,t.jsx)(h.Checkbox,{})}),(0,t.jsxs)(i.Accordion,{children:[(0,t.jsx)(o.AccordionHeader,{children:(0,t.jsx)(E,{strong:!0,children:"Personal Key Creation"})}),(0,t.jsx)(n.AccordionBody,{children:(0,t.jsx)(x.Form.Item,{className:"gap-2",label:(0,t.jsxs)("span",{children:["Models"," ",(0,t.jsx)(y.Tooltip,{title:"Models user has access to, outside of team scope.",children:(0,t.jsx)(s.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,t.jsxs)(g.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,t.jsx)(g.Select.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(g.Select.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),$.map(e=>(0,t.jsx)(g.Select.Option,{value:e,children:(0,N.getModelDisplayName)(e)},e))]})})})]}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(m.Button,{type:"primary",icon:(0,t.jsx)(r.UserAddOutlined,{}),htmlType:"submit",children:"Invite User"})})]})]}),z&&(0,t.jsx)(I,{isInvitationLinkModalVisible:W,setIsInvitationLinkModalVisible:H,baseUrl:J||"",invitationLinkData:q})]})}],371455)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7c36bfe1ba5e3ba8.js b/litellm/proxy/_experimental/out/_next/static/chunks/0c3e8651e0e97232.js
similarity index 63%
rename from litellm/proxy/_experimental/out/_next/static/chunks/7c36bfe1ba5e3ba8.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/0c3e8651e0e97232.js
index 52b32d16f8..de6040bfaf 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/7c36bfe1ba5e3ba8.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/0c3e8651e0e97232.js
@@ -1,4 +1,4 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,745434,e=>{"use strict";var t=e.i(843476),l=e.i(994388),i=e.i(389083),s=e.i(599724),a=e.i(592968),n=e.i(262218),r=e.i(166406),c=e.i(827252);e.s(["getAgentHubTableColumns",0,(e,o,d=!1)=>[{header:"Agent Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.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)(s.Text,{className:"font-medium text-sm",children:l.name}),(0,t.jsx)(a.Tooltip,{title:"Copy agent name",children:(0,t.jsx)(r.CopyOutlined,{onClick:()=>o(l.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(s.Text,{className:"text-xs text-gray-600",children:l.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(s.Text,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"Version",accessorKey:"version",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsxs)(i.Badge,{color:"blue",size:"sm",children:["v",l.version]})},meta:{className:"hidden lg:table-cell"}},{header:"Protocol",accessorKey:"protocolVersion",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(s.Text,{className:"text-xs",children:l.protocolVersion||"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:({row:e})=>{let l=e.original.skills||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(s.Text,{className:"text-xs font-medium",children:[l.length," skill",1!==l.length?"s":""]}),l.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map(e=>(0,t.jsx)(n.Tag,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,t.jsxs)(s.Text,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})}},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:({row:e})=>{let l=Object.entries(e.original.capabilities||{}).filter(([e,t])=>!0===t).map(([e])=>e);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(s.Text,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,t.jsx)(i.Badge,{color:"green",size:"xs",children:e},e))})}},{header:"I/O Modes",accessorKey:"defaultInputModes",enableSorting:!1,cell:({row:e})=>{let l=e.original,i=l.defaultInputModes||[],a=l.defaultOutputModes||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(s.Text,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"In:"})," ",i.join(", ")||"-"]}),(0,t.jsxs)(s.Text,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"Out:"})," ",a.join(", ")||"-"]})]})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"is_public",enableSorting:!0,sortingFn:(e,t)=>(!0===e.original.is_public)-(!0===t.original.is_public),cell:({row:e})=>!0===e.original.is_public?(0,t.jsx)(i.Badge,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(i.Badge,{color:"gray",size:"xs",children:"No"}),meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:({row:i})=>{let s=i.original;return(0,t.jsxs)(l.Button,{size:"xs",variant:"secondary",onClick:()=>e(s),icon:c.InfoCircleOutlined,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]])},280898,e=>{"use strict";e.i(247167);var t=e.i(271645),l=e.i(121229),i=e.i(864517),s=e.i(343794),a=e.i(931067),n=e.i(209428),r=e.i(211577),c=e.i(703923),o=e.i(404948),d=["className","prefixCls","style","active","status","iconPrefix","icon","wrapperStyle","stepNumber","disabled","description","title","subTitle","progressDot","stepIcon","tailContent","icons","stepIndex","onStepClick","onClick","render"];function m(e){return"string"==typeof e}let x=function(e){var l,i,x,u,h,p=e.className,g=e.prefixCls,b=e.style,j=e.active,f=e.status,v=e.iconPrefix,y=e.icon,N=(e.wrapperStyle,e.stepNumber),S=e.disabled,k=e.description,$=e.title,T=e.subTitle,w=e.progressDot,C=e.stepIcon,_=e.tailContent,P=e.icons,M=e.stepIndex,I=e.onStepClick,B=e.onClick,z=e.render,A=(0,c.default)(e,d),O={};I&&!S&&(O.role="button",O.tabIndex=0,O.onClick=function(e){null==B||B(e),I(M)},O.onKeyDown=function(e){var t=e.which;(t===o.default.ENTER||t===o.default.SPACE)&&I(M)});var H=f||"wait",E=(0,s.default)("".concat(g,"-item"),"".concat(g,"-item-").concat(H),p,(h={},(0,r.default)(h,"".concat(g,"-item-custom"),y),(0,r.default)(h,"".concat(g,"-item-active"),j),(0,r.default)(h,"".concat(g,"-item-disabled"),!0===S),h)),F=(0,n.default)({},b),L=t.createElement("div",(0,a.default)({},A,{className:E,style:F}),t.createElement("div",(0,a.default)({onClick:B},O,{className:"".concat(g,"-item-container")}),t.createElement("div",{className:"".concat(g,"-item-tail")},_),t.createElement("div",{className:"".concat(g,"-item-icon")},(x=(0,s.default)("".concat(g,"-icon"),"".concat(v,"icon"),(l={},(0,r.default)(l,"".concat(v,"icon-").concat(y),y&&m(y)),(0,r.default)(l,"".concat(v,"icon-check"),!y&&"finish"===f&&(P&&!P.finish||!P)),(0,r.default)(l,"".concat(v,"icon-cross"),!y&&"error"===f&&(P&&!P.error||!P)),l)),u=t.createElement("span",{className:"".concat(g,"-icon-dot")}),i=w?"function"==typeof w?t.createElement("span",{className:"".concat(g,"-icon")},w(u,{index:N-1,status:f,title:$,description:k})):t.createElement("span",{className:"".concat(g,"-icon")},u):y&&!m(y)?t.createElement("span",{className:"".concat(g,"-icon")},y):P&&P.finish&&"finish"===f?t.createElement("span",{className:"".concat(g,"-icon")},P.finish):P&&P.error&&"error"===f?t.createElement("span",{className:"".concat(g,"-icon")},P.error):y||"finish"===f||"error"===f?t.createElement("span",{className:x}):t.createElement("span",{className:"".concat(g,"-icon")},N),C&&(i=C({index:N-1,status:f,title:$,description:k,node:i})),i)),t.createElement("div",{className:"".concat(g,"-item-content")},t.createElement("div",{className:"".concat(g,"-item-title")},$,T&&t.createElement("div",{title:"string"==typeof T?T:void 0,className:"".concat(g,"-item-subtitle")},T)),k&&t.createElement("div",{className:"".concat(g,"-item-description")},k))));return z&&(L=z(L)||null),L};var u=["prefixCls","style","className","children","direction","type","labelPlacement","iconPrefix","status","size","current","progressDot","stepIcon","initial","icons","onChange","itemRender","items"];function h(e){var l,i=e.prefixCls,o=void 0===i?"rc-steps":i,d=e.style,m=void 0===d?{}:d,h=e.className,p=(e.children,e.direction),g=e.type,b=void 0===g?"default":g,j=e.labelPlacement,f=e.iconPrefix,v=void 0===f?"rc":f,y=e.status,N=void 0===y?"process":y,S=e.size,k=e.current,$=void 0===k?0:k,T=e.progressDot,w=e.stepIcon,C=e.initial,_=void 0===C?0:C,P=e.icons,M=e.onChange,I=e.itemRender,B=e.items,z=(0,c.default)(e,u),A="inline"===b,O=A||void 0!==T&&T,H=A||void 0===p?"horizontal":p,E=A?void 0:S,F=(0,s.default)(o,"".concat(o,"-").concat(H),h,(l={},(0,r.default)(l,"".concat(o,"-").concat(E),E),(0,r.default)(l,"".concat(o,"-label-").concat(O?"vertical":void 0===j?"horizontal":j),"horizontal"===H),(0,r.default)(l,"".concat(o,"-dot"),!!O),(0,r.default)(l,"".concat(o,"-navigation"),"navigation"===b),(0,r.default)(l,"".concat(o,"-inline"),A),l)),L=function(e){M&&$!==e&&M(e)};return t.default.createElement("div",(0,a.default)({className:F,style:m},z),(void 0===B?[]:B).filter(function(e){return e}).map(function(e,l){var i=(0,n.default)({},e),s=_+l;return"error"===N&&l===$-1&&(i.className="".concat(o,"-next-error")),i.status||(s===$?i.status=N:s<$?i.status="finish":i.status="wait"),A&&(i.icon=void 0,i.subTitle=void 0),!i.render&&I&&(i.render=function(e){return I(i,e)}),t.default.createElement(x,(0,a.default)({},i,{active:s===$,stepNumber:s+1,stepIndex:s,key:s,prefixCls:o,iconPrefix:v,wrapperStyle:m,progressDot:O,stepIcon:w,icons:P,onStepClick:M&&L}))}))}h.Step=x;var p=e.i(242064),g=e.i(517455),b=e.i(150073),j=e.i(309821),f=e.i(491816);e.i(296059);var v=e.i(915654),y=e.i(183293),N=e.i(246422),S=e.i(838378);let k=(e,t)=>{let l=`${t.componentCls}-item`,i=`${e}IconColor`,s=`${e}TitleColor`,a=`${e}DescriptionColor`,n=`${e}TailColor`,r=`${e}IconBgColor`,c=`${e}IconBorderColor`,o=`${e}DotColor`;return{[`${l}-${e} ${l}-icon`]:{backgroundColor:t[r],borderColor:t[c],[`> ${t.componentCls}-icon`]:{color:t[i],[`${t.componentCls}-icon-dot`]:{background:t[o]}}},[`${l}-${e}${l}-custom ${l}-icon`]:{[`> ${t.componentCls}-icon`]:{color:t[o]}},[`${l}-${e} > ${l}-container > ${l}-content > ${l}-title`]:{color:t[s],"&::after":{backgroundColor:t[n]}},[`${l}-${e} > ${l}-container > ${l}-content > ${l}-description`]:{color:t[a]},[`${l}-${e} > ${l}-container > ${l}-tail::after`]:{backgroundColor:t[n]}}},$=(0,N.genStyleHooks)("Steps",e=>{let{colorTextDisabled:t,controlHeightLG:l,colorTextLightSolid:i,colorText:s,colorPrimary:a,colorTextDescription:n,colorTextQuaternary:r,colorError:c,colorBorderSecondary:o,colorSplit:d}=e;return(e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,y.resetComponent)(e)),{display:"flex",width:"100%",fontSize:0,textAlign:"initial"}),(e=>{let{componentCls:t,motionDurationSlow:l}=e,i=`${t}-item`,s=`${i}-icon`;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[i]:{position:"relative",display:"inline-block",flex:1,overflow:"hidden",verticalAlign:"top","&:last-child":{flex:"none",[`> ${i}-container > ${i}-tail, > ${i}-container > ${i}-content > ${i}-title::after`]:{display:"none"}}},[`${i}-container`]:{outline:"none",[`&:focus-visible ${s}`]:(0,y.genFocusOutline)(e)},[`${s}, ${i}-content`]:{display:"inline-block",verticalAlign:"top"},[s]:{width:e.iconSize,height:e.iconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:e.marginXS,fontSize:e.iconFontSize,fontFamily:e.fontFamily,lineHeight:(0,v.unit)(e.iconSize),textAlign:"center",borderRadius:e.iconSize,border:`${(0,v.unit)(e.lineWidth)} ${e.lineType} transparent`,transition:`background-color ${l}, border-color ${l}`,[`${t}-icon`]:{position:"relative",top:e.iconTop,color:e.colorPrimary,lineHeight:1}},[`${i}-tail`]:{position:"absolute",top:e.calc(e.iconSize).div(2).equal(),insetInlineStart:0,width:"100%","&::after":{display:"inline-block",width:"100%",height:e.lineWidth,background:e.colorSplit,borderRadius:e.lineWidth,transition:`background ${l}`,content:'""'}},[`${i}-title`]:{position:"relative",display:"inline-block",paddingInlineEnd:e.padding,color:e.colorText,fontSize:e.fontSizeLG,lineHeight:(0,v.unit)(e.titleLineHeight),"&::after":{position:"absolute",top:e.calc(e.titleLineHeight).div(2).equal(),insetInlineStart:"100%",display:"block",width:9999,height:e.lineWidth,background:e.processTailColor,content:'""'}},[`${i}-subtitle`]:{display:"inline",marginInlineStart:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize},[`${i}-description`]:{color:e.colorTextDescription,fontSize:e.fontSize}},k("wait",e)),k("process",e)),{[`${i}-process > ${i}-container > ${i}-title`]:{fontWeight:e.fontWeightStrong}}),k("finish",e)),k("error",e)),{[`${i}${t}-next-error > ${t}-item-title::after`]:{background:e.colorError},[`${i}-disabled`]:{cursor:"not-allowed"}})})(e)),(e=>{let{componentCls:t,motionDurationSlow:l}=e;return{[`& ${t}-item`]:{[`&:not(${t}-item-active)`]:{[`& > ${t}-item-container[role='button']`]:{cursor:"pointer",[`${t}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${t}-icon`]:{transition:`color ${l}`}},"&:hover":{[`${t}-item`]:{"&-title, &-subtitle, &-description":{color:e.colorPrimary}}}},[`&:not(${t}-item-process)`]:{[`& > ${t}-item-container[role='button']:hover`]:{[`${t}-item`]:{"&-icon":{borderColor:e.colorPrimary,[`${t}-icon`]:{color:e.colorPrimary}}}}}}},[`&${t}-horizontal:not(${t}-label-vertical)`]:{[`${t}-item`]:{paddingInlineStart:e.padding,whiteSpace:"nowrap","&:first-child":{paddingInlineStart:0},[`&:last-child ${t}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:"none"},"&-description":{maxWidth:e.descriptionMaxWidth,whiteSpace:"normal"}}}}})(e)),(e=>{let{componentCls:t,customIconTop:l,customIconSize:i,customIconFontSize:s}=e;return{[`${t}-item-custom`]:{[`> ${t}-item-container > ${t}-item-icon`]:{height:"auto",background:"none",border:0,[`> ${t}-icon`]:{top:l,width:i,height:i,fontSize:s,lineHeight:(0,v.unit)(i)}}},[`&:not(${t}-vertical)`]:{[`${t}-item-custom`]:{[`${t}-item-icon`]:{width:"auto",background:"none"}}}}})(e)),(e=>{let{componentCls:t,iconSizeSM:l,fontSizeSM:i,fontSize:s,colorTextDescription:a}=e;return{[`&${t}-small`]:{[`&${t}-horizontal:not(${t}-label-vertical) ${t}-item`]:{paddingInlineStart:e.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${t}-item-icon`]:{width:l,height:l,marginTop:0,marginBottom:0,marginInline:`0 ${(0,v.unit)(e.marginXS)}`,fontSize:i,lineHeight:(0,v.unit)(l),textAlign:"center",borderRadius:l},[`${t}-item-title`]:{paddingInlineEnd:e.paddingSM,fontSize:s,lineHeight:(0,v.unit)(l),"&::after":{top:e.calc(l).div(2).equal()}},[`${t}-item-description`]:{color:a,fontSize:s},[`${t}-item-tail`]:{top:e.calc(l).div(2).sub(e.paddingXXS).equal()},[`${t}-item-custom ${t}-item-icon`]:{width:"inherit",height:"inherit",lineHeight:"inherit",background:"none",border:0,borderRadius:0,[`> ${t}-icon`]:{fontSize:l,lineHeight:(0,v.unit)(l),transform:"none"}}}}})(e)),(e=>{let{componentCls:t,iconSizeSM:l,iconSize:i}=e;return{[`&${t}-vertical`]:{display:"flex",flexDirection:"column",[`> ${t}-item`]:{display:"block",flex:"1 0 auto",paddingInlineStart:0,overflow:"visible",[`${t}-item-icon`]:{float:"left",marginInlineEnd:e.margin},[`${t}-item-content`]:{display:"block",minHeight:e.calc(e.controlHeight).mul(1.5).equal(),overflow:"hidden"},[`${t}-item-title`]:{lineHeight:(0,v.unit)(i)},[`${t}-item-description`]:{paddingBottom:e.paddingSM}},[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{position:"absolute",top:0,insetInlineStart:e.calc(i).div(2).sub(e.lineWidth).equal(),width:e.lineWidth,height:"100%",padding:`${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).add(i).equal())} 0 ${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).equal())}`,"&::after":{width:e.lineWidth,height:"100%"}},[`> ${t}-item:not(:last-child) > ${t}-item-container > ${t}-item-tail`]:{display:"block"},[` > ${t}-item > ${t}-item-container > ${t}-item-content > ${t}-item-title`]:{"&::after":{display:"none"}},[`&${t}-small ${t}-item-container`]:{[`${t}-item-tail`]:{position:"absolute",top:0,insetInlineStart:e.calc(l).div(2).sub(e.lineWidth).equal(),padding:`${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).add(l).equal())} 0 ${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).equal())}`},[`${t}-item-title`]:{lineHeight:(0,v.unit)(l)}}}}})(e)),(e=>{let{componentCls:t}=e,l=`${t}-item`;return{[`${t}-horizontal`]:{[`${l}-tail`]:{transform:"translateY(-50%)"}}}})(e)),(e=>{let{componentCls:t,iconSize:l,lineHeight:i,iconSizeSM:s}=e;return{[`&${t}-label-vertical`]:{[`${t}-item`]:{overflow:"visible","&-tail":{marginInlineStart:e.calc(l).div(2).add(e.controlHeightLG).equal(),padding:`0 ${(0,v.unit)(e.paddingLG)}`},"&-content":{display:"block",width:e.calc(l).div(2).add(e.controlHeightLG).mul(2).equal(),marginTop:e.marginSM,textAlign:"center"},"&-icon":{display:"inline-block",marginInlineStart:e.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:"none"}},"&-subtitle":{display:"block",marginBottom:e.marginXXS,marginInlineStart:0,lineHeight:i}},[`&${t}-small:not(${t}-dot)`]:{[`${t}-item`]:{"&-icon":{marginInlineStart:e.calc(l).sub(s).div(2).add(e.controlHeightLG).equal()}}}}}})(e)),(e=>{let{componentCls:t,descriptionMaxWidth:l,lineHeight:i,dotCurrentSize:s,dotSize:a,motionDurationSlow:n}=e;return{[`&${t}-dot, &${t}-dot${t}-small`]:{[`${t}-item`]:{"&-title":{lineHeight:i},"&-tail":{top:e.calc(e.dotSize).sub(e.calc(e.lineWidth).mul(3).equal()).div(2).equal(),width:"100%",marginTop:0,marginBottom:0,marginInline:`${(0,v.unit)(e.calc(l).div(2).equal())} 0`,padding:0,"&::after":{width:`calc(100% - ${(0,v.unit)(e.calc(e.marginSM).mul(2).equal())})`,height:e.calc(e.lineWidth).mul(3).equal(),marginInlineStart:e.marginSM}},"&-icon":{width:a,height:a,marginInlineStart:e.calc(e.descriptionMaxWidth).sub(a).div(2).equal(),paddingInlineEnd:0,lineHeight:(0,v.unit)(a),background:"transparent",border:0,[`${t}-icon-dot`]:{position:"relative",float:"left",width:"100%",height:"100%",borderRadius:100,transition:`all ${n}`,"&::after":{position:"absolute",top:e.calc(e.marginSM).mul(-1).equal(),insetInlineStart:e.calc(a).sub(e.calc(e.controlHeightLG).mul(1.5).equal()).div(2).equal(),width:e.calc(e.controlHeightLG).mul(1.5).equal(),height:e.controlHeight,background:"transparent",content:'""'}}},"&-content":{width:l},[`&-process ${t}-item-icon`]:{position:"relative",top:e.calc(a).sub(s).div(2).equal(),width:s,height:s,lineHeight:(0,v.unit)(s),background:"none",marginInlineStart:e.calc(e.descriptionMaxWidth).sub(s).div(2).equal()},[`&-process ${t}-icon`]:{[`&:first-child ${t}-icon-dot`]:{insetInlineStart:0}}}},[`&${t}-vertical${t}-dot`]:{[`${t}-item-icon`]:{marginTop:e.calc(e.controlHeight).sub(a).div(2).equal(),marginInlineStart:0,background:"none"},[`${t}-item-process ${t}-item-icon`]:{marginTop:e.calc(e.controlHeight).sub(s).div(2).equal(),top:0,insetInlineStart:e.calc(a).sub(s).div(2).equal(),marginInlineStart:0},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:e.calc(e.controlHeight).sub(a).div(2).equal(),insetInlineStart:0,margin:0,padding:`${(0,v.unit)(e.calc(a).add(e.paddingXS).equal())} 0 ${(0,v.unit)(e.paddingXS)}`,"&::after":{marginInlineStart:e.calc(a).sub(e.lineWidth).div(2).equal()}},[`&${t}-small`]:{[`${t}-item-icon`]:{marginTop:e.calc(e.controlHeightSM).sub(a).div(2).equal()},[`${t}-item-process ${t}-item-icon`]:{marginTop:e.calc(e.controlHeightSM).sub(s).div(2).equal()},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:e.calc(e.controlHeightSM).sub(a).div(2).equal()}},[`${t}-item:first-child ${t}-icon-dot`]:{insetInlineStart:0},[`${t}-item-content`]:{width:"inherit"}}}})(e)),(e=>{let{componentCls:t,navContentMaxWidth:l,navArrowColor:i,stepsNavActiveColor:s,motionDurationSlow:a}=e;return{[`&${t}-navigation`]:{paddingTop:e.paddingSM,[`&${t}-small`]:{[`${t}-item`]:{"&-container":{marginInlineStart:e.calc(e.marginSM).mul(-1).equal()}}},[`${t}-item`]:{overflow:"visible",textAlign:"center","&-container":{display:"inline-block",height:"100%",marginInlineStart:e.calc(e.margin).mul(-1).equal(),paddingBottom:e.paddingSM,textAlign:"start",transition:`opacity ${a}`,[`${t}-item-content`]:{maxWidth:l},[`${t}-item-title`]:Object.assign(Object.assign({maxWidth:"100%",paddingInlineEnd:0},y.textEllipsis),{"&::after":{display:"none"}})},[`&:not(${t}-item-active)`]:{[`${t}-item-container[role='button']`]:{cursor:"pointer","&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:"none"}},"&::after":{position:"absolute",top:`calc(50% - ${(0,v.unit)(e.calc(e.paddingSM).div(2).equal())})`,insetInlineStart:"100%",display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,borderTop:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${i}`,borderBottom:"none",borderInlineStart:"none",borderInlineEnd:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${i}`,transform:"translateY(-50%) translateX(-50%) rotate(45deg)",content:'""'},"&::before":{position:"absolute",bottom:0,insetInlineStart:"50%",display:"inline-block",width:0,height:e.lineWidthBold,backgroundColor:s,transition:`width ${a}, inset-inline-start ${a}`,transitionTimingFunction:"ease-out",content:'""'}},[`${t}-item${t}-item-active::before`]:{insetInlineStart:0,width:"100%"}},[`&${t}-navigation${t}-vertical`]:{[`> ${t}-item`]:{marginInlineEnd:0,"&::before":{display:"none"},[`&${t}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:"unset",display:"block",width:e.calc(e.lineWidth).mul(3).equal(),height:`calc(100% - ${(0,v.unit)(e.marginLG)})`},"&::after":{position:"relative",insetInlineStart:"50%",display:"block",width:e.calc(e.controlHeight).mul(.25).equal(),height:e.calc(e.controlHeight).mul(.25).equal(),marginBottom:e.marginXS,textAlign:"center",transform:"translateY(-50%) translateX(-50%) rotate(135deg)"},"&:last-child":{"&::after":{display:"none"}},[`> ${t}-item-container > ${t}-item-tail`]:{visibility:"hidden"}}},[`&${t}-navigation${t}-horizontal`]:{[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{visibility:"hidden"}}}})(e)),(e=>{let{componentCls:t}=e;return{[`&${t}-rtl`]:{direction:"rtl",[`${t}-item`]:{"&-subtitle":{float:"left"}},[`&${t}-navigation`]:{[`${t}-item::after`]:{transform:"rotate(-45deg)"}},[`&${t}-vertical`]:{[`> ${t}-item`]:{"&::after":{transform:"rotate(225deg)"},[`${t}-item-icon`]:{float:"right"}}},[`&${t}-dot`]:{[`${t}-item-icon ${t}-icon-dot, &${t}-small ${t}-item-icon ${t}-icon-dot`]:{float:"right"}}}}})(e)),(e=>{let{antCls:t,componentCls:l,iconSize:i,iconSizeSM:s,processIconColor:a,marginXXS:n,lineWidthBold:r,lineWidth:c,paddingXXS:o}=e,d=e.calc(i).add(e.calc(r).mul(4).equal()).equal(),m=e.calc(s).add(e.calc(e.lineWidth).mul(4).equal()).equal();return{[`&${l}-with-progress`]:{[`${l}-item`]:{paddingTop:o,[`&-process ${l}-item-container ${l}-item-icon ${l}-icon`]:{color:a}},[`&${l}-vertical > ${l}-item `]:{paddingInlineStart:o,[`> ${l}-item-container > ${l}-item-tail`]:{top:n,insetInlineStart:e.calc(i).div(2).sub(c).add(o).equal()}},[`&, &${l}-small`]:{[`&${l}-horizontal ${l}-item:first-child`]:{paddingBottom:o,paddingInlineStart:o}},[`&${l}-small${l}-vertical > ${l}-item > ${l}-item-container > ${l}-item-tail`]:{insetInlineStart:e.calc(s).div(2).sub(c).add(o).equal()},[`&${l}-label-vertical ${l}-item ${l}-item-tail`]:{top:e.calc(i).div(2).add(o).equal()},[`${l}-item-icon`]:{position:"relative",[`${t}-progress`]:{position:"absolute",insetInlineStart:"50%",top:"50%",transform:"translate(-50%, -50%)","&-inner":{width:`${(0,v.unit)(d)} !important`,height:`${(0,v.unit)(d)} !important`}}},[`&${l}-small`]:{[`&${l}-label-vertical ${l}-item ${l}-item-tail`]:{top:e.calc(s).div(2).add(o).equal()},[`${l}-item-icon ${t}-progress-inner`]:{width:`${(0,v.unit)(m)} !important`,height:`${(0,v.unit)(m)} !important`}}}}})(e)),(e=>{let{componentCls:t,inlineDotSize:l,inlineTitleColor:i,inlineTailColor:s}=e,a=e.calc(e.paddingXS).add(e.lineWidth).equal(),n={[`${t}-item-container ${t}-item-content ${t}-item-title`]:{color:i}};return{[`&${t}-inline`]:{width:"auto",display:"inline-flex",[`${t}-item`]:{flex:"none","&-container":{padding:`${(0,v.unit)(a)} ${(0,v.unit)(e.paddingXXS)} 0`,margin:`0 ${(0,v.unit)(e.calc(e.marginXXS).div(2).equal())}`,borderRadius:e.borderRadiusSM,cursor:"pointer",transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:l,height:l,marginInlineStart:`calc(50% - ${(0,v.unit)(e.calc(l).div(2).equal())})`,[`> ${t}-icon`]:{top:0},[`${t}-icon-dot`]:{borderRadius:e.calc(e.fontSizeSM).div(4).equal(),"&::after":{display:"none"}}},"&-content":{width:"auto",marginTop:e.calc(e.marginXS).sub(e.lineWidth).equal()},"&-title":{color:i,fontSize:e.fontSizeSM,lineHeight:e.lineHeightSM,fontWeight:"normal",marginBottom:e.calc(e.marginXXS).div(2).equal()},"&-description":{display:"none"},"&-tail":{marginInlineStart:0,top:e.calc(l).div(2).add(a).equal(),transform:"translateY(-50%)","&:after":{width:"100%",height:e.lineWidth,borderRadius:0,marginInlineStart:0,background:s}},[`&:first-child ${t}-item-tail`]:{width:"50%",marginInlineStart:"50%"},[`&:last-child ${t}-item-tail`]:{display:"block",width:"50%"},"&-wait":Object.assign({[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:e.colorBorderBg,border:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${s}`}},n),"&-finish":Object.assign({[`${t}-item-tail::after`]:{backgroundColor:s},[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:s,border:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${s}`}},n),"&-error":n,"&-active, &-process":Object.assign({[`${t}-item-icon`]:{width:l,height:l,marginInlineStart:`calc(50% - ${(0,v.unit)(e.calc(l).div(2).equal())})`,top:0}},n),[`&:not(${t}-item-active) > ${t}-item-container[role='button']:hover`]:{[`${t}-item-title`]:{color:i}}}}}})(e))}})((0,S.mergeToken)(e,{processIconColor:i,processTitleColor:s,processDescriptionColor:s,processIconBgColor:a,processIconBorderColor:a,processDotColor:a,processTailColor:d,waitTitleColor:n,waitDescriptionColor:n,waitTailColor:d,waitDotColor:t,finishIconColor:a,finishTitleColor:s,finishDescriptionColor:n,finishTailColor:a,finishDotColor:a,errorIconColor:i,errorTitleColor:c,errorDescriptionColor:c,errorTailColor:d,errorIconBgColor:c,errorIconBorderColor:c,errorDotColor:c,stepsNavActiveColor:a,stepsProgressSize:l,inlineDotSize:6,inlineTitleColor:r,inlineTailColor:o}))},e=>({titleLineHeight:e.controlHeight,customIconSize:e.controlHeight,customIconTop:0,customIconFontSize:e.controlHeightSM,iconSize:e.controlHeight,iconTop:-.5,iconFontSize:e.fontSize,iconSizeSM:e.fontSizeHeading3,dotSize:e.controlHeight/4,dotCurrentSize:e.controlHeightLG/4,navArrowColor:e.colorTextDisabled,navContentMaxWidth:"unset",descriptionMaxWidth:140,waitIconColor:e.wireframe?e.colorTextDisabled:e.colorTextLabel,waitIconBgColor:e.wireframe?e.colorBgContainer:e.colorFillContent,waitIconBorderColor:e.wireframe?e.colorTextDisabled:"transparent",finishIconBgColor:e.wireframe?e.colorBgContainer:e.controlItemBgActive,finishIconBorderColor:e.wireframe?e.colorPrimary:e.controlItemBgActive}));var T=e.i(876556),w=function(e,t){var l={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(l[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,i=Object.getOwnPropertySymbols(e);st.indexOf(i[s])&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(l[i[s]]=e[i[s]]);return l};let C=e=>{var a,n;let{percent:r,size:c,className:o,rootClassName:d,direction:m,items:x,responsive:u=!0,current:v=0,children:y,style:N}=e,S=w(e,["percent","size","className","rootClassName","direction","items","responsive","current","children","style"]),{xs:k}=(0,b.default)(u),{getPrefixCls:C,direction:_,className:P,style:M}=(0,p.useComponentConfig)("steps"),I=t.useMemo(()=>u&&k?"vertical":m,[u,k,m]),B=(0,g.default)(c),z=C("steps",e.prefixCls),[A,O,H]=$(z),E="inline"===e.type,F=C("",e.iconPrefix),L=(a=x,n=y,a?a:(0,T.default)(n).map(e=>{if(t.isValidElement(e)){let{props:t}=e;return Object.assign({},t)}return null}).filter(e=>e)),D=E?void 0:r,q=Object.assign(Object.assign({},M),N),R=(0,s.default)(P,{[`${z}-rtl`]:"rtl"===_,[`${z}-with-progress`]:void 0!==D},o,d,O,H),W={finish:t.createElement(l.default,{className:`${z}-finish-icon`}),error:t.createElement(i.default,{className:`${z}-error-icon`})};return A(t.createElement(h,Object.assign({icons:W},S,{style:q,current:v,size:B,items:L,itemRender:E?(e,l)=>e.description?t.createElement(f.default,{title:e.description},l):l:void 0,stepIcon:({node:e,status:l})=>"process"===l&&void 0!==D?t.createElement("div",{className:`${z}-progress-icon`},t.createElement(j.default,{type:"circle",percent:D,size:"small"===B?32:40,strokeWidth:4,format:()=>null}),e):e,direction:I,prefixCls:z,iconPrefix:F,className:R})))};C.Step=h.Step,e.s(["Steps",0,C],280898)},934879,e=>{"use strict";var t=e.i(843476),l=e.i(745434),i=e.i(271645),s=e.i(212931),a=e.i(808613),n=e.i(280898),r=e.i(464571),c=e.i(536916),o=e.i(599724),d=e.i(629569),m=e.i(389083),x=e.i(764205),u=e.i(727749);let{Step:h}=n.Steps,p=({visible:e,onClose:l,accessToken:p,agentHubData:g,onSuccess:b})=>{let[j,f]=(0,i.useState)(0),[v,y]=(0,i.useState)(new Set),[N,S]=(0,i.useState)(!1),[k]=a.Form.useForm(),$=()=>{f(0),y(new Set),k.resetFields(),l()};(0,i.useEffect)(()=>{e&&g.length>0&&y(new Set(g.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[e,g]);let T=async()=>{if(0===v.size)return void u.default.fromBackend("Please select at least one agent to make public");S(!0);try{let e=Array.from(v);await (0,x.makeAgentsPublicCall)(p,e),u.default.success(`Successfully made ${e.length} agent(s) public!`),$(),b()}catch(e){console.error("Error making agents public:",e),u.default.fromBackend("Failed to make agents public. Please try again.")}finally{S(!1)}};return(0,t.jsx)(s.Modal,{title:"Make Agents Public",open:e,onCancel:$,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:k,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:j,className:"mb-6",children:[(0,t.jsx)(h,{title:"Select Agents"}),(0,t.jsx)(h,{title:"Confirm"})]}),(()=>{switch(j){case 0:let e,l;return e=g.length>0&&g.every(e=>v.has(e.agent_id||e.name)),l=v.size>0&&!e,(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select Agents to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(c.Checkbox,{checked:e,indeterminate:l,onChange:e=>{e.target.checked?y(new Set(g.map(e=>e.agent_id||e.name))):y(new Set)},disabled:0===g.length,children:["Select All ",g.length>0&&`(${g.length})`]})})]}),(0,t.jsx)(o.Text,{className:"text-sm text-gray-600",children:"Select the agents you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these agents."}),(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===g.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(o.Text,{children:"No agents available."})}):g.map(e=>{let l=e.agent_id||e.name;return(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(c.Checkbox,{checked:v.has(l),onChange:e=>{var t;let i;return t=e.target.checked,i=new Set(v),void(t?i.add(l):i.delete(l),y(i))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:e.name}),(0,t.jsxs)(m.Badge,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:e.description}),e.skills&&e.skills.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.skills.slice(0,3).map(e=>(0,t.jsx)(m.Badge,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},l)})})}),v.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:v.size})," agent",1!==v.size?"s":""," selected"]})})]});case 1:return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{children:"Confirm Making Agents Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(o.Text,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these agents 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)(o.Text,{className:"font-medium",children:"Agents 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(v).map(e=>{let l=g.find(t=>(t.agent_id||t.name)===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:l?.name||e}),l&&(0,t.jsxs)(m.Badge,{color:"blue",size:"xs",children:["v",l.version]})]}),l?.description&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:l.description})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:v.size})," agent",1!==v.size?"s":""," will be made public"]})})]});default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===j?$:()=>{1===j&&f(0)},children:0===j?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===j&&(0,t.jsx)(r.Button,{onClick:()=>{if(0===j){if(0===v.size)return void u.default.fromBackend("Please select at least one agent to make public");f(1)}},disabled:0===v.size,children:"Next"}),1===j&&(0,t.jsx)(r.Button,{onClick:T,loading:N,children:"Make Public"})]})]})]})})},{Step:g}=n.Steps,b=({visible:e,onClose:l,accessToken:h,mcpHubData:p,onSuccess:b})=>{let[j,f]=(0,i.useState)(0),[v,y]=(0,i.useState)(new Set),[N,S]=(0,i.useState)(!1),[k]=a.Form.useForm(),$=()=>{f(0),y(new Set),k.resetFields(),l()};(0,i.useEffect)(()=>{e&&p.length>0&&y(new Set(p.filter(e=>e.mcp_info?.is_public===!0).map(e=>e.server_id)))},[e]);let T=async()=>{if(0===v.size)return void u.default.fromBackend("Please select at least one MCP server to make public");S(!0);try{let e=Array.from(v);await (0,x.makeMCPPublicCall)(h,e),u.default.success(`Successfully made ${e.length} MCP server(s) public!`),$(),b()}catch(e){console.error("Error making MCP servers public:",e),u.default.fromBackend("Failed to make MCP servers public. Please try again.")}finally{S(!1)}};return(0,t.jsx)(s.Modal,{title:"Make MCP Servers Public",open:e,onCancel:$,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:k,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:j,className:"mb-6",children:[(0,t.jsx)(g,{title:"Select Servers"}),(0,t.jsx)(g,{title:"Confirm"})]}),(()=>{switch(j){case 0:let e,l;return e=p.length>0&&p.every(e=>v.has(e.server_id)),l=v.size>0&&!e,(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select MCP Servers to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(c.Checkbox,{checked:e,indeterminate:l,onChange:e=>{e.target.checked?y(new Set(p.map(e=>e.server_id))):y(new Set)},disabled:0===p.length,children:["Select All ",p.length>0&&`(${p.length})`]})})]}),(0,t.jsx)(o.Text,{className:"text-sm text-gray-600",children:"Select the MCP servers you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these servers."}),(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)(o.Text,{children:"No MCP servers available."})}):p.map(e=>{let l=e.mcp_info?.is_public===!0;return(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(c.Checkbox,{checked:v.has(e.server_id),onChange:t=>{var l,i;let s;return l=e.server_id,i=t.target.checked,s=new Set(v),void(i?s.add(l):s.delete(l),y(s))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:e.server_name}),l&&(0,t.jsx)(m.Badge,{color:"emerald",size:"sm",children:"Public"}),(0,t.jsx)(m.Badge,{color:"blue",size:"sm",children:e.transport}),(0,t.jsx)(m.Badge,{color:"active"===e.status||"healthy"===e.status?"green":"inactive"===e.status||"unhealthy"===e.status?"red":"gray",size:"sm",children:e.status||"unknown"})]}),(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:e.description||e.url}),e.allowed_tools&&e.allowed_tools.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowed_tools.slice(0,3).map((e,l)=>(0,t.jsx)(m.Badge,{color:"purple",size:"xs",children:e},l)),e.allowed_tools.length>3&&(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),v.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:v.size})," MCP server",1!==v.size?"s":""," selected"]})})]});case 1:return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{children:"Confirm Making MCP Servers Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(o.Text,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these MCP servers 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)(o.Text,{className:"font-medium",children:"MCP Servers 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(v).map(e=>{let l=p.find(t=>t.server_id===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:l?.server_name||e}),l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Badge,{color:"blue",size:"xs",children:l.transport}),(0,t.jsx)(m.Badge,{color:"active"===l.status||"healthy"===l.status?"green":"inactive"===l.status||"unhealthy"===l.status?"red":"gray",size:"xs",children:l.status||"unknown"})]})]}),l?.description&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:l.description}),l?.url&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-500 mt-1",children:l.url})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:v.size})," MCP server",1!==v.size?"s":""," will be made public"]})})]});default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===j?$:()=>{1===j&&f(0)},children:0===j?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===j&&(0,t.jsx)(r.Button,{onClick:()=>{if(0===j){if(0===v.size)return void u.default.fromBackend("Please select at least one MCP server to make public");f(1)}},disabled:0===v.size,children:"Next"}),1===j&&(0,t.jsx)(r.Button,{onClick:T,loading:N,children:"Make Public"})]})]})]})})};var j=e.i(304967);let f=({modelHubData:e,onFilteredDataChange:l,showFiltersCard:s=!0,className:a=""})=>{let n,r,c,[d,m]=(0,i.useState)(""),[x,u]=(0,i.useState)(""),[h,p]=(0,i.useState)(""),[g,b]=(0,i.useState)(""),f=(0,i.useRef)([]),v=(0,i.useMemo)(()=>e?.filter(e=>{let t=e.model_group.toLowerCase().includes(d.toLowerCase()),l=""===x||e.providers.includes(x),i=""===h||e.mode===h,s=""===g||Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).some(([e])=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===g);return t&&l&&i&&s})||[],[e,d,x,h,g]);(0,i.useEffect)(()=>{(v.length!==f.current.length||v.some((e,t)=>e.model_group!==f.current[t]?.model_group))&&(f.current=v,l(v))},[v,l]);let y=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:d,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:x,onChange:e=>u(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"}),e&&(n=new Set,e.forEach(e=>{e.providers.forEach(e=>n.add(e))}),Array.from(n)).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)(o.Text,{className:"text-sm font-medium mb-2",children:"Mode:"}),(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-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),e&&(r=new Set,e.forEach(e=>{e.mode&&r.add(e.mode)}),Array.from(r)).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)(o.Text,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:g,onChange:e=>b(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"}),e&&(c=new Set,e.forEach(e=>{Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).forEach(([e])=>{let t=e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");c.add(t)})}),Array.from(c).sort()).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(d||x||h||g)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{m(""),u(""),p(""),b("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return s?(0,t.jsx)(j.Card,{className:`mb-6 ${a}`,children:y}):(0,t.jsx)("div",{className:a,children:y})},{Step:v}=n.Steps,y=({visible:e,onClose:l,accessToken:h,modelHubData:p,onSuccess:g})=>{let[b,j]=(0,i.useState)(0),[y,N]=(0,i.useState)(new Set),[S,k]=(0,i.useState)([]),[$,T]=(0,i.useState)(!1),[w]=a.Form.useForm(),C=()=>{j(0),N(new Set),k([]),w.resetFields(),l()},_=(0,i.useCallback)(e=>{k(e)},[]);(0,i.useEffect)(()=>{e&&p.length>0&&(k(p),N(new Set(p.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[e,p]);let P=async()=>{if(0===y.size)return void u.default.fromBackend("Please select at least one model to make public");T(!0);try{let e=Array.from(y);await (0,x.makeModelGroupPublic)(h,e),u.default.success(`Successfully made ${e.length} model group(s) public!`),C(),g()}catch(e){console.error("Error making model groups public:",e),u.default.fromBackend("Failed to make model groups public. Please try again.")}finally{T(!1)}};return(0,t.jsx)(s.Modal,{title:"Make Models Public",open:e,onCancel:C,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:w,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:b,className:"mb-6",children:[(0,t.jsx)(v,{title:"Select Models"}),(0,t.jsx)(v,{title:"Confirm"})]}),(()=>{switch(b){case 0:let e,l;return e=S.length>0&&S.every(e=>y.has(e.model_group)),l=y.size>0&&!e,(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(c.Checkbox,{checked:e,indeterminate:l,onChange:e=>{e.target.checked?N(new Set(S.map(e=>e.model_group))):N(new Set)},disabled:0===S.length,children:["Select All ",S.length>0&&`(${S.length})`]})})]}),(0,t.jsx)(o.Text,{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 Virtual Key to use these models."}),(0,t.jsx)(f,{modelHubData:p,onFilteredDataChange:_,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===S.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(o.Text,{children:"No models match the current filters."})}):S.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)(c.Checkbox,{checked:y.has(e.model_group),onChange:t=>{var l,i;let s;return l=e.model_group,i=t.target.checked,s=new Set(y),void(i?s.add(l):s.delete(l),N(s))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(m.Badge,{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)(m.Badge,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),y.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:y.size})," model",1!==y.size?"s":""," selected"]})})]});case 1:return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{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)(o.Text,{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)(o.Text,{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(y).map(e=>{let l=p.find(t=>t.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)(o.Text,{className:"font-medium",children:e}),l&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:l.providers.map(e=>(0,t.jsx)(m.Badge,{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)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:y.size})," model",1!==y.size?"s":""," will be made public"]})})]});default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===b?C:()=>{1===b&&j(0)},children:0===b?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===b&&(0,t.jsx)(r.Button,{onClick:()=>{if(0===b){if(0===y.size)return void u.default.fromBackend("Please select at least one model to make public");j(1)}},disabled:0===y.size,children:"Next"}),1===b&&(0,t.jsx)(r.Button,{onClick:P,loading:$,children:"Make Public"})]})]})]})})};var N=e.i(994388),S=e.i(592968),k=e.i(262218),$=e.i(166406),T=e.i(827252);let w=e=>`$${(1e6*e).toFixed(2)}`,C=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString();var _=e.i(902555),P=e.i(708347),M=e.i(871943),I=e.i(502547),B=e.i(434626),z=e.i(250980),A=e.i(269200),O=e.i(942232),H=e.i(977572),E=e.i(427612),F=e.i(64848),L=e.i(496020),D=e.i(522016);let q=({accessToken:e,userRole:l})=>{let[s,a]=(0,i.useState)([]),[n,r]=(0,i.useState)({url:"",displayName:""}),[c,m]=(0,i.useState)(null),[h,p]=(0,i.useState)(!1),[g,b]=(0,i.useState)(!0),[f,v]=(0,i.useState)(!1),[y,N]=(0,i.useState)([]),S=async()=>{if(e)try{p(!0);let e=await (0,x.getPublicModelHubInfo)();if(e&&e.useful_links){let t=e.useful_links||{},l=Object.entries(t).map(([e,t])=>"object"==typeof t&&null!==t&&"url"in t?{id:`${t.index??0}-${e}`,displayName:e,url:t.url,index:t.index??0}:{id:`0-${e}`,displayName:e,url:t,index:0}).sort((e,t)=>(e.index??0)-(t.index??0)).map((e,t)=>({...e,id:`${t}-${e.displayName}`}));a(l)}else a([])}catch(e){console.error("Error fetching useful links:",e),a([])}finally{p(!1)}};if((0,i.useEffect)(()=>{S()},[e]),!(0,P.isAdminRole)(l||""))return null;let k=async t=>{if(!e)return!1;try{let l={};return t.forEach((e,t)=>{l[e.displayName]={url:e.url,index:t}}),await (0,x.updateUsefulLinksCall)(e,l),!0}catch(e){return console.error("Error saving links:",e),u.default.fromBackend(`Failed to save links - ${e}`),!1}},$=async()=>{if(!n.url||!n.displayName)return;try{new URL(n.url)}catch{u.default.fromBackend("Please enter a valid URL");return}if(s.some(e=>e.displayName===n.displayName))return void u.default.fromBackend("A link with this display name already exists");let e=[...s,{id:`${Date.now()}-${n.displayName}`,displayName:n.displayName,url:n.url}];await k(e)&&(a(e),r({url:"",displayName:""}),u.default.success("Link added successfully"))},T=async()=>{if(!c)return;try{new URL(c.url)}catch{u.default.fromBackend("Please enter a valid URL");return}if(s.some(e=>e.id!==c.id&&e.displayName===c.displayName))return void u.default.fromBackend("A link with this display name already exists");let e=s.map(e=>e.id===c.id?c:e);await k(e)&&(a(e),m(null),u.default.success("Link updated successfully"))},w=()=>{m(null)},C=async e=>{let t=s.filter(t=>t.id!==e);await k(t)&&(a(t),u.default.success("Link deleted successfully"))},q=async()=>{await k(s)&&(v(!1),N([]),u.default.success("Link order saved successfully"))};return(0,t.jsxs)(j.Card,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>b(!g),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(d.Title,{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:g?(0,t.jsx)(M.ChevronDownIcon,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(I.ChevronRightIcon,{className:"w-5 h-5 text-gray-500"})})]}),g&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(o.Text,{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:"Display Name"}),(0,t.jsx)("input",{type:"text",value:n.displayName,onChange:e=>r({...n,displayName:e.target.value}),placeholder:"Friendly name",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:"URL"}),(0,t.jsx)("input",{type:"text",value:n.url,onChange:e=>r({...n,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.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:$,disabled:!n.url||!n.displayName,className:`flex items-center px-4 py-2 rounded-md text-sm ${!n.url||!n.displayName?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-green-600 text-white hover:bg-green-700"}`,children:[(0,t.jsx)(z.PlusCircleIcon,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700",children:"Manage Existing Links"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)(D.default,{href:`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`,target:"_blank",rel:"noopener noreferrer",className:"text-xs bg-blue-50 text-blue-600 px-3 py-1.5 rounded hover:bg-blue-100 flex items-center",title:"Open Public Model Hub",children:["Public Model Hub",(0,t.jsx)(B.ExternalLinkIcon,{className:"w-4 h-4 ml-1"})]}),f?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:q,className:"text-xs bg-green-600 text-white px-3 py-1.5 rounded hover:bg-green-700",children:"Save Order"}),(0,t.jsx)("button",{onClick:()=>{a([...y]),v(!1),N([])},className:"text-xs bg-gray-50 text-gray-600 px-3 py-1.5 rounded hover:bg-gray-100",children:"Cancel"})]}):(0,t.jsx)("button",{onClick:()=>{c&&m(null),N([...s]),v(!0)},className:"text-xs bg-purple-50 text-purple-600 px-3 py-1.5 rounded hover:bg-purple-100 flex items-center",children:"Rearrange Order"})]})]}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(A.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(E.TableHead,{children:(0,t.jsxs)(L.TableRow,{children:[(0,t.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(O.TableBody,{children:[s.map((e,l)=>(0,t.jsx)(L.TableRow,{className:"h-8",children:c&&c.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:c.displayName,onChange:e=>m({...c,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:c.url,onChange:e=>m({...c,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:T,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:w,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)(H.TableCell,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(H.TableCell,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(H.TableCell,{className:"py-0.5 whitespace-nowrap",children:f?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(_.default,{variant:"Up",onClick:()=>(e=>{if(0===e)return;let t=[...s];[t[e-1],t[e]]=[t[e],t[e-1]],a(t)})(l),tooltipText:"Move up",disabled:0===l,disabledTooltipText:"Already at the top",dataTestId:`move-up-${e.id}`}),(0,t.jsx)(_.default,{variant:"Down",onClick:()=>(e=>{if(e===s.length-1)return;let t=[...s];[t[e],t[e+1]]=[t[e+1],t[e]],a(t)})(l),tooltipText:"Move down",disabled:l===s.length-1,disabledTooltipText:"Already at the bottom",dataTestId:`move-down-${e.id}`})]}):(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(_.default,{variant:"Open",onClick:()=>{var t;return t=e.url,void window.open(t,"_blank")},tooltipText:"Open link",dataTestId:`open-link-${e.id}`}),(0,t.jsx)(_.default,{variant:"Edit",onClick:()=>{m({...e})},tooltipText:"Edit link",dataTestId:`edit-link-${e.id}`}),(0,t.jsx)(_.default,{variant:"Delete",onClick:()=>C(e.id),tooltipText:"Delete link",dataTestId:`delete-link-${e.id}`})]})})]})},e.id)),0===s.length&&(0,t.jsx)(L.TableRow,{children:(0,t.jsx)(H.TableCell,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})};var R=e.i(737033);let{Step:W}=n.Steps,U=({visible:e,onClose:l,accessToken:h,skillsList:p,onSuccess:g})=>{let[b,j]=(0,i.useState)(0),[f,v]=(0,i.useState)(new Set),[y,N]=(0,i.useState)(!1),[S]=a.Form.useForm(),k=()=>{j(0),v(new Set),S.resetFields(),l()};(0,i.useEffect)(()=>{e&&p.length>0&&v(new Set(p.filter(e=>e.enabled).map(e=>e.name)))},[e,p]);let $=async()=>{if(0===f.size)return void u.default.fromBackend("Please select at least one skill");N(!0);try{await Promise.all(p.map(e=>{let t=f.has(e.name);return t&&!e.enabled?(0,x.enableClaudeCodePlugin)(h,e.name):!t&&e.enabled?(0,x.disableClaudeCodePlugin)(h,e.name):Promise.resolve()})),u.default.success(`Skill Hub updated — ${f.size} skill(s) published`),k(),g()}catch(e){console.error("Error publishing skills:",e),u.default.fromBackend("Failed to update skills. Please try again.")}finally{N(!1)}},T=p.length>0&&p.every(e=>f.has(e.name)),w=f.size>0&&!T;return(0,t.jsx)(s.Modal,{title:"Publish to Skill Hub",open:e,onCancel:k,footer:null,width:700,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:S,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:b,className:"mb-6",children:[(0,t.jsx)(W,{title:"Select Skills"}),(0,t.jsx)(W,{title:"Confirm"})]}),0===b?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select Skills to Publish"}),(0,t.jsxs)(c.Checkbox,{checked:T,indeterminate:w,onChange:e=>{e.target.checked?v(new Set(p.map(e=>e.name))):v(new Set)},disabled:0===p.length,children:["Select All (",p.length,")"]})]}),(0,t.jsx)(o.Text,{className:"text-sm text-gray-600",children:"Selected skills will be visible to all users in the Skill Hub. Deselected skills will be unpublished."}),(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)(o.Text,{children:"No skills registered yet."})}):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)(c.Checkbox,{checked:f.has(e.name),onChange:t=>{var l,i;let s;return l=e.name,i=t.target.checked,s=new Set(f),void(i?s.add(l):s.delete(l),v(s))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Text,{className:"font-medium font-mono text-sm",children:e.name}),e.enabled&&(0,t.jsx)(m.Badge,{color:"green",size:"xs",children:"Public"})]}),e.description&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-500 truncate max-w-sm",children:e.description})]}),e.domain&&(0,t.jsx)(m.Badge,{color:"blue",size:"xs",children:e.domain})]},e.name))})}),f.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:f.size})," skill",1!==f.size?"s":""," will be published"]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{children:"Confirm Publish to Skill Hub"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(o.Text,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Note:"})," Published skills will be visible to all users in the Skill Hub tab. Skills not in the list below will be unpublished."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Skills to be published:"}),(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(f).map(e=>{let l=p.find(t=>t.name===e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[(0,t.jsx)(o.Text,{className:"font-mono text-sm",children:e}),l?.domain&&(0,t.jsx)(m.Badge,{color:"blue",size:"xs",children:l.domain})]},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:f.size})," skill",1!==f.size?"s":""," will be published"]})})]}),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===b?k:()=>j(0),children:0===b?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===b&&(0,t.jsx)(r.Button,{onClick:()=>{0===f.size?u.default.fromBackend("Please select at least one skill"):j(1)},disabled:0===f.size,children:"Next"}),1===b&&(0,t.jsx)(r.Button,{onClick:$,loading:y,children:"Publish to Hub"})]})]})]})})};var K=e.i(798496),X=e.i(976883),G=e.i(197647),V=e.i(653824),Y=e.i(881073),J=e.i(404206),Q=e.i(723731),Z=e.i(174886),ee=e.i(618566),et=e.i(650056),el=e.i(292639),ei=e.i(161281),es=e.i(268004);e.s(["default",0,({accessToken:e,publicPage:a,premiumUser:n,userRole:r})=>{let c,h,[g,v]=(0,i.useState)(!1),[_,M]=(0,i.useState)(null),[I,B]=(0,i.useState)(!0),[z,A]=(0,i.useState)(!1),[O,H]=(0,i.useState)(!1),[E,F]=(0,i.useState)(null),[L,D]=(0,i.useState)([]),[W,ea]=(0,i.useState)(!1),[en,er]=(0,i.useState)(null),[ec,eo]=(0,i.useState)(!1),[ed,em]=(0,i.useState)(!0),[ex,eu]=(0,i.useState)(null),[eh,ep]=(0,i.useState)(!1),[eg,eb]=(0,i.useState)(null),[ej,ef]=(0,i.useState)(!0),[ev,ey]=(0,i.useState)(null),[eN,eS]=(0,i.useState)(!1),[ek,e$]=(0,i.useState)(!1),[eT,ew]=(0,i.useState)([]),[eC,e_]=(0,i.useState)(!1),[eP,eM]=(0,i.useState)(!1),eI=(0,ee.useRouter)(),{data:eB,isLoading:ez}=(0,el.useUISettings)();(0,i.useEffect)(()=>{if(!ez&&a&&!0===eB?.values?.require_auth_for_public_ai_hub){let e=(0,es.getCookie)("token");if(!(0,ei.checkTokenValidity)(e))return void eI.replace(`${(0,x.getProxyBaseUrl)()}/ui/login`)}},[ez,a,eB,eI]),(0,i.useEffect)(()=>{let t=async e=>{try{B(!0);let t=await (0,x.modelHubCall)(e);console.log("ModelHubData:",t),M(t.data),(0,x.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log(`data: ${JSON.stringify(e)}`),!0==e.field_value&&v(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{B(!1)}},l=async()=>{try{B(!0),await (0,x.getUiConfig)();let e=await (0,x.modelHubPublicModelsCall)();console.log("ModelHubData:",e),console.log("First model structure:",e[0]),console.log("Model has model_group?",e[0]?.model_group),console.log("Model has providers?",e[0]?.providers),M(e),v(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{B(!1)}};e?t(e):a&&l()},[e,a]),(0,i.useEffect)(()=>{let t=async()=>{if(e)try{em(!0);let t=await (0,x.getAgentsList)(e);console.log("AgentHubData:",t);let l=t.agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.litellm_params.is_public}));er(l)}catch(e){console.error("There was an error fetching the agent data",e)}finally{em(!1)}};a||t()},[a,e]),(0,i.useEffect)(()=>{let t=async()=>{if(e)try{ef(!0);let t=await (0,x.fetchMCPServers)(e);console.log("MCPHubData:",t),eb(t)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ef(!1)}};a||t()},[a,e]),(0,i.useEffect)(()=>{(async()=>{if(e)try{e_(!0);let t=!0===a,l=await (0,x.getClaudeCodePluginsList)(e,t);ew(l.plugins)}catch(e){console.error("Error fetching skill hub data",e)}finally{e_(!1)}})()},[e,a]);let eA=()=>{A(!1),H(!1),F(null),ep(!1),eu(null),eS(!1),ey(null)},eO=()=>{A(!1),H(!1),F(null),ep(!1),eu(null),eS(!1),ey(null)},eH=e=>{navigator.clipboard.writeText(e),u.default.success("Copied to clipboard!")},eE=e=>`$${(1e6*e).toFixed(2)}`,eF=(0,i.useCallback)(e=>{D(e)},[]);return(console.log("publicPage: ",a),console.log("publicPageAllowed: ",g),a&&g)?(0,t.jsx)(X.default,{accessToken:e}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==a?(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)(d.Title,{className:"text-center",children:"AI Hub"}),(0,P.isAdminRole)(r||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models, agents, and MCP servers public for developers to know what's available."}):(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)(o.Text,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(o.Text,{className:"mr-2",children:`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`}),(0,t.jsx)("button",{onClick:()=>eH(`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(Z.Copy,{size:16,className:"text-gray-600"})})]})]})]}),(0,P.isAdminRole)(r||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(q,{accessToken:e,userRole:r})}),(0,t.jsxs)(V.TabGroup,{children:[(0,t.jsxs)(Y.TabList,{className:"mb-4",children:[(0,t.jsx)(G.Tab,{children:"Model Hub"}),(0,t.jsx)(G.Tab,{children:"Agent Hub"}),(0,t.jsx)(G.Tab,{children:"MCP Hub"}),(0,t.jsx)(G.Tab,{children:"Skill Hub"})]}),(0,t.jsxs)(Q.TabPanels,{children:[(0,t.jsxs)(J.TabPanel,{children:[(0,t.jsxs)(j.Card,{children:[!1==a&&(0,P.isAdminRole)(r||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>void(e&&ea(!0)),children:"Select Models to Make Public"})}),(0,t.jsx)(f,{modelHubData:_||[],onFilteredDataChange:eF}),(0,t.jsx)(K.ModelDataTable,{columns:((e,l,i=!1)=>{let s=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let i=e.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)(o.Text,{className:"font-medium text-sm",children:i.model_group}),(0,t.jsx)(S.Tooltip,{title:"Copy model name",children:(0,t.jsx)($.CopyOutlined,{onClick:()=>l(i.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)(o.Text,{className:"text-xs text-gray-600",children:i.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,t)=>{let l=e.original.providers.join(", "),i=t.original.providers.join(", ");return l.localeCompare(i)},cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(k.Tag,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(o.Text,{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:({row:e})=>{let l=e.original;return l.mode?(0,t.jsx)(m.Badge,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(o.Text,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,t)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((t.original.max_input_tokens||0)+(t.original.max_output_tokens||0)),cell:({row:e})=>{let l=e.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(o.Text,{className:"text-xs",children:[l.max_input_tokens?C(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?C(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,t)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((t.original.input_cost_per_token||0)+(t.original.output_cost_per_token||0)),cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(o.Text,{className:"text-xs",children:l.input_cost_per_token?w(l.input_cost_per_token):"-"}),(0,t.jsx)(o.Text,{className:"text-xs text-gray-500",children:l.output_cost_per_token?w(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:({row:e})=>{let l=Object.entries(e.original).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>e),i=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(o.Text,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,l)=>(0,t.jsx)(m.Badge,{color:i[l%i.length],size:"xs",children:e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,t)=>(!0===e.original.is_public_model_group)-(!0===t.original.is_public_model_group),cell:({row:e})=>!0===e.original.is_public_model_group?(0,t.jsx)(m.Badge,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Badge,{color:"gray",size:"xs",children:"No"}),meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:({row:l})=>{let i=l.original;return(0,t.jsxs)(N.Button,{size:"xs",variant:"secondary",onClick:()=>e(i),icon:T.InfoCircleOutlined,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return i?s.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):s})(e=>{F(e),A(!0)},eH,a),data:L,isLoading:I,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(o.Text,{className:"text-sm text-gray-600",children:["Showing ",L.length," of ",_?.length||0," models"]})})]}),(0,t.jsxs)(J.TabPanel,{children:[(0,t.jsxs)(j.Card,{children:[!1==a&&(0,P.isAdminRole)(r||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>void(e&&eo(!0)),children:"Select Agents to Make Public"})}),(0,t.jsx)(K.ModelDataTable,{columns:(0,l.getAgentHubTableColumns)(e=>{eu(e),ep(!0)},eH,a),data:en||[],isLoading:ed,defaultSorting:[{id:"name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(o.Text,{className:"text-sm text-gray-600",children:["Showing ",en?.length||0," agent",en?.length!==1?"s":""]})})]}),(0,t.jsxs)(J.TabPanel,{children:[(0,t.jsxs)(j.Card,{children:[!1==a&&(0,P.isAdminRole)(r||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>void(e&&e$(!0)),children:"Select MCP Servers to Make Public"})}),(0,t.jsx)(K.ModelDataTable,{columns:((e,l,i=!1)=>[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let i=e.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)(o.Text,{className:"font-medium text-sm",children:i.server_name}),(0,t.jsx)(S.Tooltip,{title:"Copy server name",children:(0,t.jsx)($.CopyOutlined,{onClick:()=>l(i.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(o.Text,{className:"text-xs text-gray-600",children:i.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(o.Text,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"URL",accessorKey:"url",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let i=e.original;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"text-xs truncate max-w-xs",children:i.url}),(0,t.jsx)(S.Tooltip,{title:"Copy URL",children:(0,t.jsx)($.CopyOutlined,{onClick:()=>l(i.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs flex-shrink-0"})})]})},meta:{className:"hidden lg:table-cell"}},{header:"Transport",accessorKey:"transport",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(m.Badge,{color:"blue",size:"sm",children:l.transport})},meta:{className:"hidden md:table-cell"}},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original,i="none"===l.auth_type?"gray":"green";return(0,t.jsx)(m.Badge,{color:i,size:"sm",children:l.auth_type})},meta:{className:"hidden md:table-cell"}},{header:"Status",accessorKey:"status",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original,i={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,t.jsx)(m.Badge,{color:i,size:"sm",children:l.status||"unknown"})}},{header:"Tools",accessorKey:"allowed_tools",enableSorting:!1,cell:({row:e})=>{let l=e.original.allowed_tools||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(o.Text,{className:"text-xs font-medium",children:l.length>0?`${l.length} tool${1!==l.length?"s":""}`:"All tools"}),l.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map((e,l)=>(0,t.jsx)(k.Tag,{color:"purple",className:"text-xs",children:e},l)),l.length>2&&(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})},meta:{className:"hidden lg:table-cell"}},{header:"Created By",accessorKey:"created_by",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(o.Text,{className:"text-xs",children:l.created_by||"-"})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"mcp_info.is_public",enableSorting:!0,sortingFn:(e,t)=>(e.original.mcp_info?.is_public===!0)-(t.original.mcp_info?.is_public===!0),cell:({row:e})=>{let l=e.original;return l.mcp_info?.is_public===!0?(0,t.jsx)(m.Badge,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Badge,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:({row:l})=>{let i=l.original;return(0,t.jsxs)(N.Button,{size:"xs",variant:"secondary",onClick:()=>e(i),icon:T.InfoCircleOutlined,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}])(e=>{ey(e),eS(!0)},eH,a),data:eg||[],isLoading:ej,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(o.Text,{className:"text-sm text-gray-600",children:["Showing ",eg?.length||0," MCP server",eg?.length!==1?"s":""]})})]}),(0,t.jsxs)(J.TabPanel,{children:[!1==a&&(0,P.isAdminRole)(r||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>eM(!0),children:"Select Skills to Make Public"})}),(0,t.jsx)(R.default,{skills:eT,isLoading:eC,isAdmin:(0,P.isAdminRole)(r||""),accessToken:e,publicPage:a,onPublishSuccess:async()=>{ew((await (0,x.getClaudeCodePluginsList)(e||"",a)).plugins)}})]})]})]})]}):(0,t.jsxs)(j.Card,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(o.Text,{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)(s.Modal,{title:"Public Model Hub",width:600,open:O,footer:null,onOk:eA,onCancel:eO,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)(o.Text,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(o.Text,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(N.Button,{onClick:()=>{eI.replace(`/model_hub_table?key=${e}`)},children:"See Page"})})]})}),(0,t.jsx)(s.Modal,{title:E?.model_group||"Model Details",width:1e3,open:z,footer:null,onOk:eA,onCancel:eO,children:E&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{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)(o.Text,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(o.Text,{children:E.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(o.Text,{children:E.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:E.providers.map(e=>(0,t.jsx)(m.Badge,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{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)(o.Text,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(o.Text,{children:E.max_input_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(o.Text,{children:E.max_output_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(o.Text,{children:E.input_cost_per_token?eE(E.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(o.Text,{children:E.output_cost_per_token?eE(E.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(c=Object.entries(E).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>e),h=["green","blue","purple","orange","red","yellow"],0===c.length?(0,t.jsx)(o.Text,{className:"text-gray-500",children:"No special capabilities listed"}):c.map((e,l)=>(0,t.jsx)(m.Badge,{color:h[l%h.length],children:e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e)))})]}),(E.tpm||E.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[E.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(o.Text,{children:E.tpm.toLocaleString()})]}),E.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(o.Text,{children:E.rpm.toLocaleString()})]})]})]}),E.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:E.supported_openai_params.map(e=>(0,t.jsx)(m.Badge,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(et.Prism,{language:"python",className:"text-sm",children:`import openai
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,745434,e=>{"use strict";var t=e.i(843476),l=e.i(994388),s=e.i(389083),i=e.i(599724),a=e.i(592968),n=e.i(262218),r=e.i(166406),c=e.i(827252);e.s(["getAgentHubTableColumns",0,(e,o,d=!1)=>[{header:"Agent Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.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)(i.Text,{className:"font-medium text-sm",children:l.name}),(0,t.jsx)(a.Tooltip,{title:"Copy agent name",children:(0,t.jsx)(r.CopyOutlined,{onClick:()=>o(l.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(i.Text,{className:"text-xs text-gray-600",children:l.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(i.Text,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"Version",accessorKey:"version",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsxs)(s.Badge,{color:"blue",size:"sm",children:["v",l.version]})},meta:{className:"hidden lg:table-cell"}},{header:"Protocol",accessorKey:"protocolVersion",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(i.Text,{className:"text-xs",children:l.protocolVersion||"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:({row:e})=>{let l=e.original.skills||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(i.Text,{className:"text-xs font-medium",children:[l.length," skill",1!==l.length?"s":""]}),l.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map(e=>(0,t.jsx)(n.Tag,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,t.jsxs)(i.Text,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})}},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:({row:e})=>{let l=Object.entries(e.original.capabilities||{}).filter(([e,t])=>!0===t).map(([e])=>e);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(i.Text,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,t.jsx)(s.Badge,{color:"green",size:"xs",children:e},e))})}},{header:"I/O Modes",accessorKey:"defaultInputModes",enableSorting:!1,cell:({row:e})=>{let l=e.original,s=l.defaultInputModes||[],a=l.defaultOutputModes||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(i.Text,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"In:"})," ",s.join(", ")||"-"]}),(0,t.jsxs)(i.Text,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"Out:"})," ",a.join(", ")||"-"]})]})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"is_public",enableSorting:!0,sortingFn:(e,t)=>(!0===e.original.is_public)-(!0===t.original.is_public),cell:({row:e})=>!0===e.original.is_public?(0,t.jsx)(s.Badge,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(s.Badge,{color:"gray",size:"xs",children:"No"}),meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:({row:s})=>{let i=s.original;return(0,t.jsxs)(l.Button,{size:"xs",variant:"secondary",onClick:()=>e(i),icon:c.InfoCircleOutlined,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]])},280898,e=>{"use strict";e.i(247167);var t=e.i(271645),l=e.i(121229),s=e.i(864517),i=e.i(343794),a=e.i(931067),n=e.i(209428),r=e.i(211577),c=e.i(703923),o=e.i(404948),d=["className","prefixCls","style","active","status","iconPrefix","icon","wrapperStyle","stepNumber","disabled","description","title","subTitle","progressDot","stepIcon","tailContent","icons","stepIndex","onStepClick","onClick","render"];function m(e){return"string"==typeof e}let x=function(e){var l,s,x,u,h,p=e.className,g=e.prefixCls,b=e.style,j=e.active,f=e.status,v=e.iconPrefix,y=e.icon,N=(e.wrapperStyle,e.stepNumber),S=e.disabled,k=e.description,$=e.title,T=e.subTitle,w=e.progressDot,C=e.stepIcon,_=e.tailContent,P=e.icons,M=e.stepIndex,I=e.onStepClick,B=e.onClick,z=e.render,O=(0,c.default)(e,d),A={};I&&!S&&(A.role="button",A.tabIndex=0,A.onClick=function(e){null==B||B(e),I(M)},A.onKeyDown=function(e){var t=e.which;(t===o.default.ENTER||t===o.default.SPACE)&&I(M)});var H=f||"wait",E=(0,i.default)("".concat(g,"-item"),"".concat(g,"-item-").concat(H),p,(h={},(0,r.default)(h,"".concat(g,"-item-custom"),y),(0,r.default)(h,"".concat(g,"-item-active"),j),(0,r.default)(h,"".concat(g,"-item-disabled"),!0===S),h)),F=(0,n.default)({},b),L=t.createElement("div",(0,a.default)({},O,{className:E,style:F}),t.createElement("div",(0,a.default)({onClick:B},A,{className:"".concat(g,"-item-container")}),t.createElement("div",{className:"".concat(g,"-item-tail")},_),t.createElement("div",{className:"".concat(g,"-item-icon")},(x=(0,i.default)("".concat(g,"-icon"),"".concat(v,"icon"),(l={},(0,r.default)(l,"".concat(v,"icon-").concat(y),y&&m(y)),(0,r.default)(l,"".concat(v,"icon-check"),!y&&"finish"===f&&(P&&!P.finish||!P)),(0,r.default)(l,"".concat(v,"icon-cross"),!y&&"error"===f&&(P&&!P.error||!P)),l)),u=t.createElement("span",{className:"".concat(g,"-icon-dot")}),s=w?"function"==typeof w?t.createElement("span",{className:"".concat(g,"-icon")},w(u,{index:N-1,status:f,title:$,description:k})):t.createElement("span",{className:"".concat(g,"-icon")},u):y&&!m(y)?t.createElement("span",{className:"".concat(g,"-icon")},y):P&&P.finish&&"finish"===f?t.createElement("span",{className:"".concat(g,"-icon")},P.finish):P&&P.error&&"error"===f?t.createElement("span",{className:"".concat(g,"-icon")},P.error):y||"finish"===f||"error"===f?t.createElement("span",{className:x}):t.createElement("span",{className:"".concat(g,"-icon")},N),C&&(s=C({index:N-1,status:f,title:$,description:k,node:s})),s)),t.createElement("div",{className:"".concat(g,"-item-content")},t.createElement("div",{className:"".concat(g,"-item-title")},$,T&&t.createElement("div",{title:"string"==typeof T?T:void 0,className:"".concat(g,"-item-subtitle")},T)),k&&t.createElement("div",{className:"".concat(g,"-item-description")},k))));return z&&(L=z(L)||null),L};var u=["prefixCls","style","className","children","direction","type","labelPlacement","iconPrefix","status","size","current","progressDot","stepIcon","initial","icons","onChange","itemRender","items"];function h(e){var l,s=e.prefixCls,o=void 0===s?"rc-steps":s,d=e.style,m=void 0===d?{}:d,h=e.className,p=(e.children,e.direction),g=e.type,b=void 0===g?"default":g,j=e.labelPlacement,f=e.iconPrefix,v=void 0===f?"rc":f,y=e.status,N=void 0===y?"process":y,S=e.size,k=e.current,$=void 0===k?0:k,T=e.progressDot,w=e.stepIcon,C=e.initial,_=void 0===C?0:C,P=e.icons,M=e.onChange,I=e.itemRender,B=e.items,z=(0,c.default)(e,u),O="inline"===b,A=O||void 0!==T&&T,H=O||void 0===p?"horizontal":p,E=O?void 0:S,F=(0,i.default)(o,"".concat(o,"-").concat(H),h,(l={},(0,r.default)(l,"".concat(o,"-").concat(E),E),(0,r.default)(l,"".concat(o,"-label-").concat(A?"vertical":void 0===j?"horizontal":j),"horizontal"===H),(0,r.default)(l,"".concat(o,"-dot"),!!A),(0,r.default)(l,"".concat(o,"-navigation"),"navigation"===b),(0,r.default)(l,"".concat(o,"-inline"),O),l)),L=function(e){M&&$!==e&&M(e)};return t.default.createElement("div",(0,a.default)({className:F,style:m},z),(void 0===B?[]:B).filter(function(e){return e}).map(function(e,l){var s=(0,n.default)({},e),i=_+l;return"error"===N&&l===$-1&&(s.className="".concat(o,"-next-error")),s.status||(i===$?s.status=N:i<$?s.status="finish":s.status="wait"),O&&(s.icon=void 0,s.subTitle=void 0),!s.render&&I&&(s.render=function(e){return I(s,e)}),t.default.createElement(x,(0,a.default)({},s,{active:i===$,stepNumber:i+1,stepIndex:i,key:i,prefixCls:o,iconPrefix:v,wrapperStyle:m,progressDot:A,stepIcon:w,icons:P,onStepClick:M&&L}))}))}h.Step=x;var p=e.i(242064),g=e.i(517455),b=e.i(150073),j=e.i(309821),f=e.i(491816);e.i(296059);var v=e.i(915654),y=e.i(183293),N=e.i(246422),S=e.i(838378);let k=(e,t)=>{let l=`${t.componentCls}-item`,s=`${e}IconColor`,i=`${e}TitleColor`,a=`${e}DescriptionColor`,n=`${e}TailColor`,r=`${e}IconBgColor`,c=`${e}IconBorderColor`,o=`${e}DotColor`;return{[`${l}-${e} ${l}-icon`]:{backgroundColor:t[r],borderColor:t[c],[`> ${t.componentCls}-icon`]:{color:t[s],[`${t.componentCls}-icon-dot`]:{background:t[o]}}},[`${l}-${e}${l}-custom ${l}-icon`]:{[`> ${t.componentCls}-icon`]:{color:t[o]}},[`${l}-${e} > ${l}-container > ${l}-content > ${l}-title`]:{color:t[i],"&::after":{backgroundColor:t[n]}},[`${l}-${e} > ${l}-container > ${l}-content > ${l}-description`]:{color:t[a]},[`${l}-${e} > ${l}-container > ${l}-tail::after`]:{backgroundColor:t[n]}}},$=(0,N.genStyleHooks)("Steps",e=>{let{colorTextDisabled:t,controlHeightLG:l,colorTextLightSolid:s,colorText:i,colorPrimary:a,colorTextDescription:n,colorTextQuaternary:r,colorError:c,colorBorderSecondary:o,colorSplit:d}=e;return(e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,y.resetComponent)(e)),{display:"flex",width:"100%",fontSize:0,textAlign:"initial"}),(e=>{let{componentCls:t,motionDurationSlow:l}=e,s=`${t}-item`,i=`${s}-icon`;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[s]:{position:"relative",display:"inline-block",flex:1,overflow:"hidden",verticalAlign:"top","&:last-child":{flex:"none",[`> ${s}-container > ${s}-tail, > ${s}-container > ${s}-content > ${s}-title::after`]:{display:"none"}}},[`${s}-container`]:{outline:"none",[`&:focus-visible ${i}`]:(0,y.genFocusOutline)(e)},[`${i}, ${s}-content`]:{display:"inline-block",verticalAlign:"top"},[i]:{width:e.iconSize,height:e.iconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:e.marginXS,fontSize:e.iconFontSize,fontFamily:e.fontFamily,lineHeight:(0,v.unit)(e.iconSize),textAlign:"center",borderRadius:e.iconSize,border:`${(0,v.unit)(e.lineWidth)} ${e.lineType} transparent`,transition:`background-color ${l}, border-color ${l}`,[`${t}-icon`]:{position:"relative",top:e.iconTop,color:e.colorPrimary,lineHeight:1}},[`${s}-tail`]:{position:"absolute",top:e.calc(e.iconSize).div(2).equal(),insetInlineStart:0,width:"100%","&::after":{display:"inline-block",width:"100%",height:e.lineWidth,background:e.colorSplit,borderRadius:e.lineWidth,transition:`background ${l}`,content:'""'}},[`${s}-title`]:{position:"relative",display:"inline-block",paddingInlineEnd:e.padding,color:e.colorText,fontSize:e.fontSizeLG,lineHeight:(0,v.unit)(e.titleLineHeight),"&::after":{position:"absolute",top:e.calc(e.titleLineHeight).div(2).equal(),insetInlineStart:"100%",display:"block",width:9999,height:e.lineWidth,background:e.processTailColor,content:'""'}},[`${s}-subtitle`]:{display:"inline",marginInlineStart:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize},[`${s}-description`]:{color:e.colorTextDescription,fontSize:e.fontSize}},k("wait",e)),k("process",e)),{[`${s}-process > ${s}-container > ${s}-title`]:{fontWeight:e.fontWeightStrong}}),k("finish",e)),k("error",e)),{[`${s}${t}-next-error > ${t}-item-title::after`]:{background:e.colorError},[`${s}-disabled`]:{cursor:"not-allowed"}})})(e)),(e=>{let{componentCls:t,motionDurationSlow:l}=e;return{[`& ${t}-item`]:{[`&:not(${t}-item-active)`]:{[`& > ${t}-item-container[role='button']`]:{cursor:"pointer",[`${t}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${t}-icon`]:{transition:`color ${l}`}},"&:hover":{[`${t}-item`]:{"&-title, &-subtitle, &-description":{color:e.colorPrimary}}}},[`&:not(${t}-item-process)`]:{[`& > ${t}-item-container[role='button']:hover`]:{[`${t}-item`]:{"&-icon":{borderColor:e.colorPrimary,[`${t}-icon`]:{color:e.colorPrimary}}}}}}},[`&${t}-horizontal:not(${t}-label-vertical)`]:{[`${t}-item`]:{paddingInlineStart:e.padding,whiteSpace:"nowrap","&:first-child":{paddingInlineStart:0},[`&:last-child ${t}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:"none"},"&-description":{maxWidth:e.descriptionMaxWidth,whiteSpace:"normal"}}}}})(e)),(e=>{let{componentCls:t,customIconTop:l,customIconSize:s,customIconFontSize:i}=e;return{[`${t}-item-custom`]:{[`> ${t}-item-container > ${t}-item-icon`]:{height:"auto",background:"none",border:0,[`> ${t}-icon`]:{top:l,width:s,height:s,fontSize:i,lineHeight:(0,v.unit)(s)}}},[`&:not(${t}-vertical)`]:{[`${t}-item-custom`]:{[`${t}-item-icon`]:{width:"auto",background:"none"}}}}})(e)),(e=>{let{componentCls:t,iconSizeSM:l,fontSizeSM:s,fontSize:i,colorTextDescription:a}=e;return{[`&${t}-small`]:{[`&${t}-horizontal:not(${t}-label-vertical) ${t}-item`]:{paddingInlineStart:e.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${t}-item-icon`]:{width:l,height:l,marginTop:0,marginBottom:0,marginInline:`0 ${(0,v.unit)(e.marginXS)}`,fontSize:s,lineHeight:(0,v.unit)(l),textAlign:"center",borderRadius:l},[`${t}-item-title`]:{paddingInlineEnd:e.paddingSM,fontSize:i,lineHeight:(0,v.unit)(l),"&::after":{top:e.calc(l).div(2).equal()}},[`${t}-item-description`]:{color:a,fontSize:i},[`${t}-item-tail`]:{top:e.calc(l).div(2).sub(e.paddingXXS).equal()},[`${t}-item-custom ${t}-item-icon`]:{width:"inherit",height:"inherit",lineHeight:"inherit",background:"none",border:0,borderRadius:0,[`> ${t}-icon`]:{fontSize:l,lineHeight:(0,v.unit)(l),transform:"none"}}}}})(e)),(e=>{let{componentCls:t,iconSizeSM:l,iconSize:s}=e;return{[`&${t}-vertical`]:{display:"flex",flexDirection:"column",[`> ${t}-item`]:{display:"block",flex:"1 0 auto",paddingInlineStart:0,overflow:"visible",[`${t}-item-icon`]:{float:"left",marginInlineEnd:e.margin},[`${t}-item-content`]:{display:"block",minHeight:e.calc(e.controlHeight).mul(1.5).equal(),overflow:"hidden"},[`${t}-item-title`]:{lineHeight:(0,v.unit)(s)},[`${t}-item-description`]:{paddingBottom:e.paddingSM}},[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{position:"absolute",top:0,insetInlineStart:e.calc(s).div(2).sub(e.lineWidth).equal(),width:e.lineWidth,height:"100%",padding:`${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).add(s).equal())} 0 ${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).equal())}`,"&::after":{width:e.lineWidth,height:"100%"}},[`> ${t}-item:not(:last-child) > ${t}-item-container > ${t}-item-tail`]:{display:"block"},[` > ${t}-item > ${t}-item-container > ${t}-item-content > ${t}-item-title`]:{"&::after":{display:"none"}},[`&${t}-small ${t}-item-container`]:{[`${t}-item-tail`]:{position:"absolute",top:0,insetInlineStart:e.calc(l).div(2).sub(e.lineWidth).equal(),padding:`${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).add(l).equal())} 0 ${(0,v.unit)(e.calc(e.marginXXS).mul(1.5).equal())}`},[`${t}-item-title`]:{lineHeight:(0,v.unit)(l)}}}}})(e)),(e=>{let{componentCls:t}=e,l=`${t}-item`;return{[`${t}-horizontal`]:{[`${l}-tail`]:{transform:"translateY(-50%)"}}}})(e)),(e=>{let{componentCls:t,iconSize:l,lineHeight:s,iconSizeSM:i}=e;return{[`&${t}-label-vertical`]:{[`${t}-item`]:{overflow:"visible","&-tail":{marginInlineStart:e.calc(l).div(2).add(e.controlHeightLG).equal(),padding:`0 ${(0,v.unit)(e.paddingLG)}`},"&-content":{display:"block",width:e.calc(l).div(2).add(e.controlHeightLG).mul(2).equal(),marginTop:e.marginSM,textAlign:"center"},"&-icon":{display:"inline-block",marginInlineStart:e.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:"none"}},"&-subtitle":{display:"block",marginBottom:e.marginXXS,marginInlineStart:0,lineHeight:s}},[`&${t}-small:not(${t}-dot)`]:{[`${t}-item`]:{"&-icon":{marginInlineStart:e.calc(l).sub(i).div(2).add(e.controlHeightLG).equal()}}}}}})(e)),(e=>{let{componentCls:t,descriptionMaxWidth:l,lineHeight:s,dotCurrentSize:i,dotSize:a,motionDurationSlow:n}=e;return{[`&${t}-dot, &${t}-dot${t}-small`]:{[`${t}-item`]:{"&-title":{lineHeight:s},"&-tail":{top:e.calc(e.dotSize).sub(e.calc(e.lineWidth).mul(3).equal()).div(2).equal(),width:"100%",marginTop:0,marginBottom:0,marginInline:`${(0,v.unit)(e.calc(l).div(2).equal())} 0`,padding:0,"&::after":{width:`calc(100% - ${(0,v.unit)(e.calc(e.marginSM).mul(2).equal())})`,height:e.calc(e.lineWidth).mul(3).equal(),marginInlineStart:e.marginSM}},"&-icon":{width:a,height:a,marginInlineStart:e.calc(e.descriptionMaxWidth).sub(a).div(2).equal(),paddingInlineEnd:0,lineHeight:(0,v.unit)(a),background:"transparent",border:0,[`${t}-icon-dot`]:{position:"relative",float:"left",width:"100%",height:"100%",borderRadius:100,transition:`all ${n}`,"&::after":{position:"absolute",top:e.calc(e.marginSM).mul(-1).equal(),insetInlineStart:e.calc(a).sub(e.calc(e.controlHeightLG).mul(1.5).equal()).div(2).equal(),width:e.calc(e.controlHeightLG).mul(1.5).equal(),height:e.controlHeight,background:"transparent",content:'""'}}},"&-content":{width:l},[`&-process ${t}-item-icon`]:{position:"relative",top:e.calc(a).sub(i).div(2).equal(),width:i,height:i,lineHeight:(0,v.unit)(i),background:"none",marginInlineStart:e.calc(e.descriptionMaxWidth).sub(i).div(2).equal()},[`&-process ${t}-icon`]:{[`&:first-child ${t}-icon-dot`]:{insetInlineStart:0}}}},[`&${t}-vertical${t}-dot`]:{[`${t}-item-icon`]:{marginTop:e.calc(e.controlHeight).sub(a).div(2).equal(),marginInlineStart:0,background:"none"},[`${t}-item-process ${t}-item-icon`]:{marginTop:e.calc(e.controlHeight).sub(i).div(2).equal(),top:0,insetInlineStart:e.calc(a).sub(i).div(2).equal(),marginInlineStart:0},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:e.calc(e.controlHeight).sub(a).div(2).equal(),insetInlineStart:0,margin:0,padding:`${(0,v.unit)(e.calc(a).add(e.paddingXS).equal())} 0 ${(0,v.unit)(e.paddingXS)}`,"&::after":{marginInlineStart:e.calc(a).sub(e.lineWidth).div(2).equal()}},[`&${t}-small`]:{[`${t}-item-icon`]:{marginTop:e.calc(e.controlHeightSM).sub(a).div(2).equal()},[`${t}-item-process ${t}-item-icon`]:{marginTop:e.calc(e.controlHeightSM).sub(i).div(2).equal()},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:e.calc(e.controlHeightSM).sub(a).div(2).equal()}},[`${t}-item:first-child ${t}-icon-dot`]:{insetInlineStart:0},[`${t}-item-content`]:{width:"inherit"}}}})(e)),(e=>{let{componentCls:t,navContentMaxWidth:l,navArrowColor:s,stepsNavActiveColor:i,motionDurationSlow:a}=e;return{[`&${t}-navigation`]:{paddingTop:e.paddingSM,[`&${t}-small`]:{[`${t}-item`]:{"&-container":{marginInlineStart:e.calc(e.marginSM).mul(-1).equal()}}},[`${t}-item`]:{overflow:"visible",textAlign:"center","&-container":{display:"inline-block",height:"100%",marginInlineStart:e.calc(e.margin).mul(-1).equal(),paddingBottom:e.paddingSM,textAlign:"start",transition:`opacity ${a}`,[`${t}-item-content`]:{maxWidth:l},[`${t}-item-title`]:Object.assign(Object.assign({maxWidth:"100%",paddingInlineEnd:0},y.textEllipsis),{"&::after":{display:"none"}})},[`&:not(${t}-item-active)`]:{[`${t}-item-container[role='button']`]:{cursor:"pointer","&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:"none"}},"&::after":{position:"absolute",top:`calc(50% - ${(0,v.unit)(e.calc(e.paddingSM).div(2).equal())})`,insetInlineStart:"100%",display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,borderTop:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${s}`,borderBottom:"none",borderInlineStart:"none",borderInlineEnd:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${s}`,transform:"translateY(-50%) translateX(-50%) rotate(45deg)",content:'""'},"&::before":{position:"absolute",bottom:0,insetInlineStart:"50%",display:"inline-block",width:0,height:e.lineWidthBold,backgroundColor:i,transition:`width ${a}, inset-inline-start ${a}`,transitionTimingFunction:"ease-out",content:'""'}},[`${t}-item${t}-item-active::before`]:{insetInlineStart:0,width:"100%"}},[`&${t}-navigation${t}-vertical`]:{[`> ${t}-item`]:{marginInlineEnd:0,"&::before":{display:"none"},[`&${t}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:"unset",display:"block",width:e.calc(e.lineWidth).mul(3).equal(),height:`calc(100% - ${(0,v.unit)(e.marginLG)})`},"&::after":{position:"relative",insetInlineStart:"50%",display:"block",width:e.calc(e.controlHeight).mul(.25).equal(),height:e.calc(e.controlHeight).mul(.25).equal(),marginBottom:e.marginXS,textAlign:"center",transform:"translateY(-50%) translateX(-50%) rotate(135deg)"},"&:last-child":{"&::after":{display:"none"}},[`> ${t}-item-container > ${t}-item-tail`]:{visibility:"hidden"}}},[`&${t}-navigation${t}-horizontal`]:{[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{visibility:"hidden"}}}})(e)),(e=>{let{componentCls:t}=e;return{[`&${t}-rtl`]:{direction:"rtl",[`${t}-item`]:{"&-subtitle":{float:"left"}},[`&${t}-navigation`]:{[`${t}-item::after`]:{transform:"rotate(-45deg)"}},[`&${t}-vertical`]:{[`> ${t}-item`]:{"&::after":{transform:"rotate(225deg)"},[`${t}-item-icon`]:{float:"right"}}},[`&${t}-dot`]:{[`${t}-item-icon ${t}-icon-dot, &${t}-small ${t}-item-icon ${t}-icon-dot`]:{float:"right"}}}}})(e)),(e=>{let{antCls:t,componentCls:l,iconSize:s,iconSizeSM:i,processIconColor:a,marginXXS:n,lineWidthBold:r,lineWidth:c,paddingXXS:o}=e,d=e.calc(s).add(e.calc(r).mul(4).equal()).equal(),m=e.calc(i).add(e.calc(e.lineWidth).mul(4).equal()).equal();return{[`&${l}-with-progress`]:{[`${l}-item`]:{paddingTop:o,[`&-process ${l}-item-container ${l}-item-icon ${l}-icon`]:{color:a}},[`&${l}-vertical > ${l}-item `]:{paddingInlineStart:o,[`> ${l}-item-container > ${l}-item-tail`]:{top:n,insetInlineStart:e.calc(s).div(2).sub(c).add(o).equal()}},[`&, &${l}-small`]:{[`&${l}-horizontal ${l}-item:first-child`]:{paddingBottom:o,paddingInlineStart:o}},[`&${l}-small${l}-vertical > ${l}-item > ${l}-item-container > ${l}-item-tail`]:{insetInlineStart:e.calc(i).div(2).sub(c).add(o).equal()},[`&${l}-label-vertical ${l}-item ${l}-item-tail`]:{top:e.calc(s).div(2).add(o).equal()},[`${l}-item-icon`]:{position:"relative",[`${t}-progress`]:{position:"absolute",insetInlineStart:"50%",top:"50%",transform:"translate(-50%, -50%)","&-inner":{width:`${(0,v.unit)(d)} !important`,height:`${(0,v.unit)(d)} !important`}}},[`&${l}-small`]:{[`&${l}-label-vertical ${l}-item ${l}-item-tail`]:{top:e.calc(i).div(2).add(o).equal()},[`${l}-item-icon ${t}-progress-inner`]:{width:`${(0,v.unit)(m)} !important`,height:`${(0,v.unit)(m)} !important`}}}}})(e)),(e=>{let{componentCls:t,inlineDotSize:l,inlineTitleColor:s,inlineTailColor:i}=e,a=e.calc(e.paddingXS).add(e.lineWidth).equal(),n={[`${t}-item-container ${t}-item-content ${t}-item-title`]:{color:s}};return{[`&${t}-inline`]:{width:"auto",display:"inline-flex",[`${t}-item`]:{flex:"none","&-container":{padding:`${(0,v.unit)(a)} ${(0,v.unit)(e.paddingXXS)} 0`,margin:`0 ${(0,v.unit)(e.calc(e.marginXXS).div(2).equal())}`,borderRadius:e.borderRadiusSM,cursor:"pointer",transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:l,height:l,marginInlineStart:`calc(50% - ${(0,v.unit)(e.calc(l).div(2).equal())})`,[`> ${t}-icon`]:{top:0},[`${t}-icon-dot`]:{borderRadius:e.calc(e.fontSizeSM).div(4).equal(),"&::after":{display:"none"}}},"&-content":{width:"auto",marginTop:e.calc(e.marginXS).sub(e.lineWidth).equal()},"&-title":{color:s,fontSize:e.fontSizeSM,lineHeight:e.lineHeightSM,fontWeight:"normal",marginBottom:e.calc(e.marginXXS).div(2).equal()},"&-description":{display:"none"},"&-tail":{marginInlineStart:0,top:e.calc(l).div(2).add(a).equal(),transform:"translateY(-50%)","&:after":{width:"100%",height:e.lineWidth,borderRadius:0,marginInlineStart:0,background:i}},[`&:first-child ${t}-item-tail`]:{width:"50%",marginInlineStart:"50%"},[`&:last-child ${t}-item-tail`]:{display:"block",width:"50%"},"&-wait":Object.assign({[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:e.colorBorderBg,border:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${i}`}},n),"&-finish":Object.assign({[`${t}-item-tail::after`]:{backgroundColor:i},[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:i,border:`${(0,v.unit)(e.lineWidth)} ${e.lineType} ${i}`}},n),"&-error":n,"&-active, &-process":Object.assign({[`${t}-item-icon`]:{width:l,height:l,marginInlineStart:`calc(50% - ${(0,v.unit)(e.calc(l).div(2).equal())})`,top:0}},n),[`&:not(${t}-item-active) > ${t}-item-container[role='button']:hover`]:{[`${t}-item-title`]:{color:s}}}}}})(e))}})((0,S.mergeToken)(e,{processIconColor:s,processTitleColor:i,processDescriptionColor:i,processIconBgColor:a,processIconBorderColor:a,processDotColor:a,processTailColor:d,waitTitleColor:n,waitDescriptionColor:n,waitTailColor:d,waitDotColor:t,finishIconColor:a,finishTitleColor:i,finishDescriptionColor:n,finishTailColor:a,finishDotColor:a,errorIconColor:s,errorTitleColor:c,errorDescriptionColor:c,errorTailColor:d,errorIconBgColor:c,errorIconBorderColor:c,errorDotColor:c,stepsNavActiveColor:a,stepsProgressSize:l,inlineDotSize:6,inlineTitleColor:r,inlineTailColor:o}))},e=>({titleLineHeight:e.controlHeight,customIconSize:e.controlHeight,customIconTop:0,customIconFontSize:e.controlHeightSM,iconSize:e.controlHeight,iconTop:-.5,iconFontSize:e.fontSize,iconSizeSM:e.fontSizeHeading3,dotSize:e.controlHeight/4,dotCurrentSize:e.controlHeightLG/4,navArrowColor:e.colorTextDisabled,navContentMaxWidth:"unset",descriptionMaxWidth:140,waitIconColor:e.wireframe?e.colorTextDisabled:e.colorTextLabel,waitIconBgColor:e.wireframe?e.colorBgContainer:e.colorFillContent,waitIconBorderColor:e.wireframe?e.colorTextDisabled:"transparent",finishIconBgColor:e.wireframe?e.colorBgContainer:e.controlItemBgActive,finishIconBorderColor:e.wireframe?e.colorPrimary:e.controlItemBgActive}));var T=e.i(876556),w=function(e,t){var l={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(l[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);it.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(l[s[i]]=e[s[i]]);return l};let C=e=>{var a,n;let{percent:r,size:c,className:o,rootClassName:d,direction:m,items:x,responsive:u=!0,current:v=0,children:y,style:N}=e,S=w(e,["percent","size","className","rootClassName","direction","items","responsive","current","children","style"]),{xs:k}=(0,b.default)(u),{getPrefixCls:C,direction:_,className:P,style:M}=(0,p.useComponentConfig)("steps"),I=t.useMemo(()=>u&&k?"vertical":m,[u,k,m]),B=(0,g.default)(c),z=C("steps",e.prefixCls),[O,A,H]=$(z),E="inline"===e.type,F=C("",e.iconPrefix),L=(a=x,n=y,a?a:(0,T.default)(n).map(e=>{if(t.isValidElement(e)){let{props:t}=e;return Object.assign({},t)}return null}).filter(e=>e)),D=E?void 0:r,q=Object.assign(Object.assign({},M),N),R=(0,i.default)(P,{[`${z}-rtl`]:"rtl"===_,[`${z}-with-progress`]:void 0!==D},o,d,A,H),W={finish:t.createElement(l.default,{className:`${z}-finish-icon`}),error:t.createElement(s.default,{className:`${z}-error-icon`})};return O(t.createElement(h,Object.assign({icons:W},S,{style:q,current:v,size:B,items:L,itemRender:E?(e,l)=>e.description?t.createElement(f.default,{title:e.description},l):l:void 0,stepIcon:({node:e,status:l})=>"process"===l&&void 0!==D?t.createElement("div",{className:`${z}-progress-icon`},t.createElement(j.default,{type:"circle",percent:D,size:"small"===B?32:40,strokeWidth:4,format:()=>null}),e):e,direction:I,prefixCls:z,iconPrefix:F,className:R})))};C.Step=h.Step,e.s(["Steps",0,C],280898)},934879,e=>{"use strict";var t=e.i(843476),l=e.i(745434),s=e.i(271645),i=e.i(212931),a=e.i(808613),n=e.i(280898),r=e.i(464571),c=e.i(536916),o=e.i(599724),d=e.i(629569),m=e.i(389083),x=e.i(764205),u=e.i(727749);let{Step:h}=n.Steps,p=({visible:e,onClose:l,accessToken:p,agentHubData:g,onSuccess:b})=>{let[j,f]=(0,s.useState)(0),[v,y]=(0,s.useState)(new Set),[N,S]=(0,s.useState)(!1),[k]=a.Form.useForm(),$=()=>{f(0),y(new Set),k.resetFields(),l()};(0,s.useEffect)(()=>{e&&g.length>0&&y(new Set(g.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[e,g]);let T=async()=>{if(0===v.size)return void u.default.fromBackend("Please select at least one agent to make public");S(!0);try{let e=Array.from(v);await (0,x.makeAgentsPublicCall)(p,e),u.default.success(`Successfully made ${e.length} agent(s) public!`),$(),b()}catch(e){console.error("Error making agents public:",e),u.default.fromBackend("Failed to make agents public. Please try again.")}finally{S(!1)}};return(0,t.jsx)(i.Modal,{title:"Make Agents Public",open:e,onCancel:$,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:k,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:j,className:"mb-6",children:[(0,t.jsx)(h,{title:"Select Agents"}),(0,t.jsx)(h,{title:"Confirm"})]}),(()=>{switch(j){case 0:let e,l;return e=g.length>0&&g.every(e=>v.has(e.agent_id||e.name)),l=v.size>0&&!e,(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select Agents to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(c.Checkbox,{checked:e,indeterminate:l,onChange:e=>{e.target.checked?y(new Set(g.map(e=>e.agent_id||e.name))):y(new Set)},disabled:0===g.length,children:["Select All ",g.length>0&&`(${g.length})`]})})]}),(0,t.jsx)(o.Text,{className:"text-sm text-gray-600",children:"Select the agents you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these agents."}),(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===g.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(o.Text,{children:"No agents available."})}):g.map(e=>{let l=e.agent_id||e.name;return(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(c.Checkbox,{checked:v.has(l),onChange:e=>{var t;let s;return t=e.target.checked,s=new Set(v),void(t?s.add(l):s.delete(l),y(s))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:e.name}),(0,t.jsxs)(m.Badge,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:e.description}),e.skills&&e.skills.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.skills.slice(0,3).map(e=>(0,t.jsx)(m.Badge,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},l)})})}),v.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:v.size})," agent",1!==v.size?"s":""," selected"]})})]});case 1:return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{children:"Confirm Making Agents Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(o.Text,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these agents 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)(o.Text,{className:"font-medium",children:"Agents 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(v).map(e=>{let l=g.find(t=>(t.agent_id||t.name)===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:l?.name||e}),l&&(0,t.jsxs)(m.Badge,{color:"blue",size:"xs",children:["v",l.version]})]}),l?.description&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:l.description})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:v.size})," agent",1!==v.size?"s":""," will be made public"]})})]});default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===j?$:()=>{1===j&&f(0)},children:0===j?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===j&&(0,t.jsx)(r.Button,{onClick:()=>{if(0===j){if(0===v.size)return void u.default.fromBackend("Please select at least one agent to make public");f(1)}},disabled:0===v.size,children:"Next"}),1===j&&(0,t.jsx)(r.Button,{onClick:T,loading:N,children:"Make Public"})]})]})]})})},{Step:g}=n.Steps,b=({visible:e,onClose:l,accessToken:h,mcpHubData:p,onSuccess:b})=>{let[j,f]=(0,s.useState)(0),[v,y]=(0,s.useState)(new Set),[N,S]=(0,s.useState)(!1),[k]=a.Form.useForm(),$=()=>{f(0),y(new Set),k.resetFields(),l()};(0,s.useEffect)(()=>{e&&p.length>0&&y(new Set(p.filter(e=>e.mcp_info?.is_public===!0).map(e=>e.server_id)))},[e]);let T=async()=>{if(0===v.size)return void u.default.fromBackend("Please select at least one MCP server to make public");S(!0);try{let e=Array.from(v);await (0,x.makeMCPPublicCall)(h,e),u.default.success(`Successfully made ${e.length} MCP server(s) public!`),$(),b()}catch(e){console.error("Error making MCP servers public:",e),u.default.fromBackend("Failed to make MCP servers public. Please try again.")}finally{S(!1)}};return(0,t.jsx)(i.Modal,{title:"Make MCP Servers Public",open:e,onCancel:$,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:k,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:j,className:"mb-6",children:[(0,t.jsx)(g,{title:"Select Servers"}),(0,t.jsx)(g,{title:"Confirm"})]}),(()=>{switch(j){case 0:let e,l;return e=p.length>0&&p.every(e=>v.has(e.server_id)),l=v.size>0&&!e,(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select MCP Servers to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(c.Checkbox,{checked:e,indeterminate:l,onChange:e=>{e.target.checked?y(new Set(p.map(e=>e.server_id))):y(new Set)},disabled:0===p.length,children:["Select All ",p.length>0&&`(${p.length})`]})})]}),(0,t.jsx)(o.Text,{className:"text-sm text-gray-600",children:"Select the MCP servers you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these servers."}),(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)(o.Text,{children:"No MCP servers available."})}):p.map(e=>{let l=e.mcp_info?.is_public===!0;return(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(c.Checkbox,{checked:v.has(e.server_id),onChange:t=>{var l,s;let i;return l=e.server_id,s=t.target.checked,i=new Set(v),void(s?i.add(l):i.delete(l),y(i))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:e.server_name}),l&&(0,t.jsx)(m.Badge,{color:"emerald",size:"sm",children:"Public"}),(0,t.jsx)(m.Badge,{color:"blue",size:"sm",children:e.transport}),(0,t.jsx)(m.Badge,{color:"active"===e.status||"healthy"===e.status?"green":"inactive"===e.status||"unhealthy"===e.status?"red":"gray",size:"sm",children:e.status||"unknown"})]}),(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:e.description||e.url}),e.allowed_tools&&e.allowed_tools.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowed_tools.slice(0,3).map((e,l)=>(0,t.jsx)(m.Badge,{color:"purple",size:"xs",children:e},l)),e.allowed_tools.length>3&&(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),v.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:v.size})," MCP server",1!==v.size?"s":""," selected"]})})]});case 1:return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{children:"Confirm Making MCP Servers Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(o.Text,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these MCP servers 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)(o.Text,{className:"font-medium",children:"MCP Servers 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(v).map(e=>{let l=p.find(t=>t.server_id===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:l?.server_name||e}),l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Badge,{color:"blue",size:"xs",children:l.transport}),(0,t.jsx)(m.Badge,{color:"active"===l.status||"healthy"===l.status?"green":"inactive"===l.status||"unhealthy"===l.status?"red":"gray",size:"xs",children:l.status||"unknown"})]})]}),l?.description&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-600 mt-1",children:l.description}),l?.url&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-500 mt-1",children:l.url})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:v.size})," MCP server",1!==v.size?"s":""," will be made public"]})})]});default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===j?$:()=>{1===j&&f(0)},children:0===j?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===j&&(0,t.jsx)(r.Button,{onClick:()=>{if(0===j){if(0===v.size)return void u.default.fromBackend("Please select at least one MCP server to make public");f(1)}},disabled:0===v.size,children:"Next"}),1===j&&(0,t.jsx)(r.Button,{onClick:T,loading:N,children:"Make Public"})]})]})]})})};var j=e.i(304967);let f=({modelHubData:e,onFilteredDataChange:l,showFiltersCard:i=!0,className:a=""})=>{let n,r,c,[d,m]=(0,s.useState)(""),[x,u]=(0,s.useState)(""),[h,p]=(0,s.useState)(""),[g,b]=(0,s.useState)(""),f=(0,s.useRef)([]),v=(0,s.useMemo)(()=>e?.filter(e=>{let t=e.model_group.toLowerCase().includes(d.toLowerCase()),l=""===x||e.providers.includes(x),s=""===h||e.mode===h,i=""===g||Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).some(([e])=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===g);return t&&l&&s&&i})||[],[e,d,x,h,g]);(0,s.useEffect)(()=>{(v.length!==f.current.length||v.some((e,t)=>e.model_group!==f.current[t]?.model_group))&&(f.current=v,l(v))},[v,l]);let y=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:d,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:x,onChange:e=>u(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"}),e&&(n=new Set,e.forEach(e=>{e.providers.forEach(e=>n.add(e))}),Array.from(n)).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)(o.Text,{className:"text-sm font-medium mb-2",children:"Mode:"}),(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-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),e&&(r=new Set,e.forEach(e=>{e.mode&&r.add(e.mode)}),Array.from(r)).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)(o.Text,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:g,onChange:e=>b(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"}),e&&(c=new Set,e.forEach(e=>{Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).forEach(([e])=>{let t=e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");c.add(t)})}),Array.from(c).sort()).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(d||x||h||g)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{m(""),u(""),p(""),b("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return i?(0,t.jsx)(j.Card,{className:`mb-6 ${a}`,children:y}):(0,t.jsx)("div",{className:a,children:y})},{Step:v}=n.Steps,y=({visible:e,onClose:l,accessToken:h,modelHubData:p,onSuccess:g})=>{let[b,j]=(0,s.useState)(0),[y,N]=(0,s.useState)(new Set),[S,k]=(0,s.useState)([]),[$,T]=(0,s.useState)(!1),[w]=a.Form.useForm(),C=()=>{j(0),N(new Set),k([]),w.resetFields(),l()},_=(0,s.useCallback)(e=>{k(e)},[]);(0,s.useEffect)(()=>{e&&p.length>0&&(k(p),N(new Set(p.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[e,p]);let P=async()=>{if(0===y.size)return void u.default.fromBackend("Please select at least one model to make public");T(!0);try{let e=Array.from(y);await (0,x.makeModelGroupPublic)(h,e),u.default.success(`Successfully made ${e.length} model group(s) public!`),C(),g()}catch(e){console.error("Error making model groups public:",e),u.default.fromBackend("Failed to make model groups public. Please try again.")}finally{T(!1)}};return(0,t.jsx)(i.Modal,{title:"Make Models Public",open:e,onCancel:C,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:w,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:b,className:"mb-6",children:[(0,t.jsx)(v,{title:"Select Models"}),(0,t.jsx)(v,{title:"Confirm"})]}),(()=>{switch(b){case 0:let e,l;return e=S.length>0&&S.every(e=>y.has(e.model_group)),l=y.size>0&&!e,(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(c.Checkbox,{checked:e,indeterminate:l,onChange:e=>{e.target.checked?N(new Set(S.map(e=>e.model_group))):N(new Set)},disabled:0===S.length,children:["Select All ",S.length>0&&`(${S.length})`]})})]}),(0,t.jsx)(o.Text,{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 Virtual Key to use these models."}),(0,t.jsx)(f,{modelHubData:p,onFilteredDataChange:_,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===S.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(o.Text,{children:"No models match the current filters."})}):S.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)(c.Checkbox,{checked:y.has(e.model_group),onChange:t=>{var l,s;let i;return l=e.model_group,s=t.target.checked,i=new Set(y),void(s?i.add(l):i.delete(l),N(i))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(m.Badge,{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)(m.Badge,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),y.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:y.size})," model",1!==y.size?"s":""," selected"]})})]});case 1:return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{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)(o.Text,{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)(o.Text,{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(y).map(e=>{let l=p.find(t=>t.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)(o.Text,{className:"font-medium",children:e}),l&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:l.providers.map(e=>(0,t.jsx)(m.Badge,{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)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:y.size})," model",1!==y.size?"s":""," will be made public"]})})]});default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===b?C:()=>{1===b&&j(0)},children:0===b?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===b&&(0,t.jsx)(r.Button,{onClick:()=>{if(0===b){if(0===y.size)return void u.default.fromBackend("Please select at least one model to make public");j(1)}},disabled:0===y.size,children:"Next"}),1===b&&(0,t.jsx)(r.Button,{onClick:P,loading:$,children:"Make Public"})]})]})]})})};var N=e.i(994388),S=e.i(592968),k=e.i(262218),$=e.i(166406),T=e.i(827252);let w=e=>`$${(1e6*e).toFixed(2)}`,C=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString();var _=e.i(902555),P=e.i(708347),M=e.i(871943),I=e.i(502547),B=e.i(434626),z=e.i(250980),O=e.i(269200),A=e.i(942232),H=e.i(977572),E=e.i(427612),F=e.i(64848),L=e.i(496020),D=e.i(522016);let q=({accessToken:e,userRole:l})=>{let[i,a]=(0,s.useState)([]),[n,r]=(0,s.useState)({url:"",displayName:""}),[c,m]=(0,s.useState)(null),[h,p]=(0,s.useState)(!1),[g,b]=(0,s.useState)(!0),[f,v]=(0,s.useState)(!1),[y,N]=(0,s.useState)([]),S=async()=>{if(e)try{p(!0);let e=await (0,x.getPublicModelHubInfo)();if(e&&e.useful_links){let t=e.useful_links||{},l=Object.entries(t).map(([e,t])=>"object"==typeof t&&null!==t&&"url"in t?{id:`${t.index??0}-${e}`,displayName:e,url:t.url,index:t.index??0}:{id:`0-${e}`,displayName:e,url:t,index:0}).sort((e,t)=>(e.index??0)-(t.index??0)).map((e,t)=>({...e,id:`${t}-${e.displayName}`}));a(l)}else a([])}catch(e){console.error("Error fetching useful links:",e),a([])}finally{p(!1)}};if((0,s.useEffect)(()=>{S()},[e]),!(0,P.isAdminRole)(l||""))return null;let k=async t=>{if(!e)return!1;try{let l={};return t.forEach((e,t)=>{l[e.displayName]={url:e.url,index:t}}),await (0,x.updateUsefulLinksCall)(e,l),!0}catch(e){return console.error("Error saving links:",e),u.default.fromBackend(`Failed to save links - ${e}`),!1}},$=async()=>{if(!n.url||!n.displayName)return;try{new URL(n.url)}catch{u.default.fromBackend("Please enter a valid URL");return}if(i.some(e=>e.displayName===n.displayName))return void u.default.fromBackend("A link with this display name already exists");let e=[...i,{id:`${Date.now()}-${n.displayName}`,displayName:n.displayName,url:n.url}];await k(e)&&(a(e),r({url:"",displayName:""}),u.default.success("Link added successfully"))},T=async()=>{if(!c)return;try{new URL(c.url)}catch{u.default.fromBackend("Please enter a valid URL");return}if(i.some(e=>e.id!==c.id&&e.displayName===c.displayName))return void u.default.fromBackend("A link with this display name already exists");let e=i.map(e=>e.id===c.id?c:e);await k(e)&&(a(e),m(null),u.default.success("Link updated successfully"))},w=()=>{m(null)},C=async e=>{let t=i.filter(t=>t.id!==e);await k(t)&&(a(t),u.default.success("Link deleted successfully"))},q=async()=>{await k(i)&&(v(!1),N([]),u.default.success("Link order saved successfully"))};return(0,t.jsxs)(j.Card,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>b(!g),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(d.Title,{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:g?(0,t.jsx)(M.ChevronDownIcon,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(I.ChevronRightIcon,{className:"w-5 h-5 text-gray-500"})})]}),g&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(o.Text,{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:"Display Name"}),(0,t.jsx)("input",{type:"text",value:n.displayName,onChange:e=>r({...n,displayName:e.target.value}),placeholder:"Friendly name",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:"URL"}),(0,t.jsx)("input",{type:"text",value:n.url,onChange:e=>r({...n,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.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:$,disabled:!n.url||!n.displayName,className:`flex items-center px-4 py-2 rounded-md text-sm ${!n.url||!n.displayName?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-green-600 text-white hover:bg-green-700"}`,children:[(0,t.jsx)(z.PlusCircleIcon,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700",children:"Manage Existing Links"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)(D.default,{href:`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`,target:"_blank",rel:"noopener noreferrer",className:"text-xs bg-blue-50 text-blue-600 px-3 py-1.5 rounded hover:bg-blue-100 flex items-center",title:"Open Public Model Hub",children:["Public Model Hub",(0,t.jsx)(B.ExternalLinkIcon,{className:"w-4 h-4 ml-1"})]}),f?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:q,className:"text-xs bg-green-600 text-white px-3 py-1.5 rounded hover:bg-green-700",children:"Save Order"}),(0,t.jsx)("button",{onClick:()=>{a([...y]),v(!1),N([])},className:"text-xs bg-gray-50 text-gray-600 px-3 py-1.5 rounded hover:bg-gray-100",children:"Cancel"})]}):(0,t.jsx)("button",{onClick:()=>{c&&m(null),N([...i]),v(!0)},className:"text-xs bg-purple-50 text-purple-600 px-3 py-1.5 rounded hover:bg-purple-100 flex items-center",children:"Rearrange Order"})]})]}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(O.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(E.TableHead,{children:(0,t.jsxs)(L.TableRow,{children:[(0,t.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(F.TableHeaderCell,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(A.TableBody,{children:[i.map((e,l)=>(0,t.jsx)(L.TableRow,{className:"h-8",children:c&&c.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:c.displayName,onChange:e=>m({...c,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:c.url,onChange:e=>m({...c,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(H.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:T,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:w,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)(H.TableCell,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(H.TableCell,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(H.TableCell,{className:"py-0.5 whitespace-nowrap",children:f?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(_.default,{variant:"Up",onClick:()=>(e=>{if(0===e)return;let t=[...i];[t[e-1],t[e]]=[t[e],t[e-1]],a(t)})(l),tooltipText:"Move up",disabled:0===l,disabledTooltipText:"Already at the top",dataTestId:`move-up-${e.id}`}),(0,t.jsx)(_.default,{variant:"Down",onClick:()=>(e=>{if(e===i.length-1)return;let t=[...i];[t[e],t[e+1]]=[t[e+1],t[e]],a(t)})(l),tooltipText:"Move down",disabled:l===i.length-1,disabledTooltipText:"Already at the bottom",dataTestId:`move-down-${e.id}`})]}):(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(_.default,{variant:"Open",onClick:()=>{var t;return t=e.url,void window.open(t,"_blank")},tooltipText:"Open link",dataTestId:`open-link-${e.id}`}),(0,t.jsx)(_.default,{variant:"Edit",onClick:()=>{m({...e})},tooltipText:"Edit link",dataTestId:`edit-link-${e.id}`}),(0,t.jsx)(_.default,{variant:"Delete",onClick:()=>C(e.id),tooltipText:"Delete link",dataTestId:`delete-link-${e.id}`})]})})]})},e.id)),0===i.length&&(0,t.jsx)(L.TableRow,{children:(0,t.jsx)(H.TableCell,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})};var R=e.i(737033);let{Step:W}=n.Steps,U=({visible:e,onClose:l,accessToken:h,skillsList:p,onSuccess:g})=>{let[b,j]=(0,s.useState)(0),[f,v]=(0,s.useState)(new Set),[y,N]=(0,s.useState)(!1),[S]=a.Form.useForm(),k=()=>{j(0),v(new Set),S.resetFields(),l()};(0,s.useEffect)(()=>{e&&p.length>0&&v(new Set(p.filter(e=>e.enabled).map(e=>e.name)))},[e,p]);let $=async()=>{if(0===f.size)return void u.default.fromBackend("Please select at least one skill");N(!0);try{await Promise.all(p.map(e=>{let t=f.has(e.name);return t&&!e.enabled?(0,x.enableClaudeCodePlugin)(h,e.name):!t&&e.enabled?(0,x.disableClaudeCodePlugin)(h,e.name):Promise.resolve()})),u.default.success(`Skill Hub updated — ${f.size} skill(s) published`),k(),g()}catch(e){console.error("Error publishing skills:",e),u.default.fromBackend("Failed to update skills. Please try again.")}finally{N(!1)}},T=p.length>0&&p.every(e=>f.has(e.name)),w=f.size>0&&!T;return(0,t.jsx)(i.Modal,{title:"Publish to Skill Hub",open:e,onCancel:k,footer:null,width:700,maskClosable:!1,children:(0,t.jsxs)(a.Form,{form:S,layout:"vertical",children:[(0,t.jsxs)(n.Steps,{current:b,className:"mb-6",children:[(0,t.jsx)(W,{title:"Select Skills"}),(0,t.jsx)(W,{title:"Confirm"})]}),0===b?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(d.Title,{children:"Select Skills to Publish"}),(0,t.jsxs)(c.Checkbox,{checked:T,indeterminate:w,onChange:e=>{e.target.checked?v(new Set(p.map(e=>e.name))):v(new Set)},disabled:0===p.length,children:["Select All (",p.length,")"]})]}),(0,t.jsx)(o.Text,{className:"text-sm text-gray-600",children:"Selected skills will be visible to all users in the Skill Hub. Deselected skills will be unpublished."}),(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)(o.Text,{children:"No skills registered yet."})}):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)(c.Checkbox,{checked:f.has(e.name),onChange:t=>{var l,s;let i;return l=e.name,s=t.target.checked,i=new Set(f),void(s?i.add(l):i.delete(l),v(i))}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Text,{className:"font-medium font-mono text-sm",children:e.name}),e.enabled&&(0,t.jsx)(m.Badge,{color:"green",size:"xs",children:"Public"})]}),e.description&&(0,t.jsx)(o.Text,{className:"text-xs text-gray-500 truncate max-w-sm",children:e.description})]}),e.domain&&(0,t.jsx)(m.Badge,{color:"blue",size:"xs",children:e.domain})]},e.name))})}),f.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:f.size})," skill",1!==f.size?"s":""," will be published"]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(d.Title,{children:"Confirm Publish to Skill Hub"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(o.Text,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Note:"})," Published skills will be visible to all users in the Skill Hub tab. Skills not in the list below will be unpublished."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Skills to be published:"}),(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(f).map(e=>{let l=p.find(t=>t.name===e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[(0,t.jsx)(o.Text,{className:"font-mono text-sm",children:e}),l?.domain&&(0,t.jsx)(m.Badge,{color:"blue",size:"xs",children:l.domain})]},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(o.Text,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:f.size})," skill",1!==f.size?"s":""," will be published"]})})]}),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(r.Button,{onClick:0===b?k:()=>j(0),children:0===b?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===b&&(0,t.jsx)(r.Button,{onClick:()=>{0===f.size?u.default.fromBackend("Please select at least one skill"):j(1)},disabled:0===f.size,children:"Next"}),1===b&&(0,t.jsx)(r.Button,{onClick:$,loading:y,children:"Publish to Hub"})]})]})]})})};var K=e.i(798496),X=e.i(976883),G=e.i(197647),V=e.i(653824),Y=e.i(881073),J=e.i(404206),Q=e.i(723731),Z=e.i(174886),ee=e.i(618566),et=e.i(650056),el=e.i(292639),es=e.i(161281),ei=e.i(268004);e.s(["default",0,({accessToken:e,publicPage:a,premiumUser:n,userRole:r})=>{let c,h,g=(0,P.isProxyAdminRole)(r||""),[v,_]=(0,s.useState)(!1),[M,I]=(0,s.useState)(null),[B,z]=(0,s.useState)(!0),[O,A]=(0,s.useState)(!1),[H,E]=(0,s.useState)(!1),[F,L]=(0,s.useState)(null),[D,W]=(0,s.useState)([]),[ea,en]=(0,s.useState)(!1),[er,ec]=(0,s.useState)(null),[eo,ed]=(0,s.useState)(!1),[em,ex]=(0,s.useState)(!0),[eu,eh]=(0,s.useState)(null),[ep,eg]=(0,s.useState)(!1),[eb,ej]=(0,s.useState)(null),[ef,ev]=(0,s.useState)(!0),[ey,eN]=(0,s.useState)(null),[eS,ek]=(0,s.useState)(!1),[e$,eT]=(0,s.useState)(!1),[ew,eC]=(0,s.useState)([]),[e_,eP]=(0,s.useState)(!1),[eM,eI]=(0,s.useState)(!1),eB=(0,ee.useRouter)(),{data:ez,isLoading:eO}=(0,el.useUISettings)();(0,s.useEffect)(()=>{if(!eO&&a&&!0===ez?.values?.require_auth_for_public_ai_hub){let e=(0,ei.getCookie)("token");if(!(0,es.checkTokenValidity)(e))return void eB.replace(`${(0,x.getProxyBaseUrl)()}/ui/login`)}},[eO,a,ez,eB]),(0,s.useEffect)(()=>{let t=async e=>{try{z(!0);let t=await (0,x.modelHubCall)(e);console.log("ModelHubData:",t),I(t.data),(0,x.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log(`data: ${JSON.stringify(e)}`),!0==e.field_value&&_(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{z(!1)}},l=async()=>{try{z(!0),await (0,x.getUiConfig)();let e=await (0,x.modelHubPublicModelsCall)();console.log("ModelHubData:",e),console.log("First model structure:",e[0]),console.log("Model has model_group?",e[0]?.model_group),console.log("Model has providers?",e[0]?.providers),I(e),_(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{z(!1)}};e?t(e):a&&l()},[e,a]),(0,s.useEffect)(()=>{let t=async()=>{if(e)try{ex(!0);let t=await (0,x.getAgentsList)(e);console.log("AgentHubData:",t);let l=t.agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.litellm_params.is_public}));ec(l)}catch(e){console.error("There was an error fetching the agent data",e)}finally{ex(!1)}};a||t()},[a,e]),(0,s.useEffect)(()=>{let t=async()=>{if(e)try{ev(!0);let t=await (0,x.fetchMCPServers)(e);console.log("MCPHubData:",t),ej(t)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ev(!1)}};a||t()},[a,e]),(0,s.useEffect)(()=>{(async()=>{if(e)try{eP(!0);let t=!0===a,l=await (0,x.getClaudeCodePluginsList)(e,t);eC(l.plugins)}catch(e){console.error("Error fetching skill hub data",e)}finally{eP(!1)}})()},[e,a]);let eA=()=>{A(!1),E(!1),L(null),eg(!1),eh(null),ek(!1),eN(null)},eH=()=>{A(!1),E(!1),L(null),eg(!1),eh(null),ek(!1),eN(null)},eE=e=>{navigator.clipboard.writeText(e),u.default.success("Copied to clipboard!")},eF=e=>`$${(1e6*e).toFixed(2)}`,eL=(0,s.useCallback)(e=>{W(e)},[]);return(console.log("publicPage: ",a),console.log("publicPageAllowed: ",v),a&&v)?(0,t.jsx)(X.default,{accessToken:e}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==a?(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)(d.Title,{className:"text-center",children:"AI Hub"}),(0,P.isAdminRole)(r||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models, agents, and MCP servers public for developers to know what's available."}):(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)(o.Text,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(o.Text,{className:"mr-2",children:`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`}),(0,t.jsx)("button",{onClick:()=>eE(`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(Z.Copy,{size:16,className:"text-gray-600"})})]})]})]}),g&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(q,{accessToken:e,userRole:r})}),(0,t.jsxs)(V.TabGroup,{children:[(0,t.jsxs)(Y.TabList,{className:"mb-4",children:[(0,t.jsx)(G.Tab,{children:"Model Hub"}),(0,t.jsx)(G.Tab,{children:"Agent Hub"}),(0,t.jsx)(G.Tab,{children:"MCP Hub"}),(0,t.jsx)(G.Tab,{children:"Skill Hub"})]}),(0,t.jsxs)(Q.TabPanels,{children:[(0,t.jsxs)(J.TabPanel,{children:[(0,t.jsxs)(j.Card,{children:[!1==a&&g&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>void(e&&en(!0)),children:"Select Models to Make Public"})}),(0,t.jsx)(f,{modelHubData:M||[],onFilteredDataChange:eL}),(0,t.jsx)(K.ModelDataTable,{columns:((e,l,s=!1)=>{let i=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let s=e.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)(o.Text,{className:"font-medium text-sm",children:s.model_group}),(0,t.jsx)(S.Tooltip,{title:"Copy model name",children:(0,t.jsx)($.CopyOutlined,{onClick:()=>l(s.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)(o.Text,{className:"text-xs text-gray-600",children:s.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,t)=>{let l=e.original.providers.join(", "),s=t.original.providers.join(", ");return l.localeCompare(s)},cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(k.Tag,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(o.Text,{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:({row:e})=>{let l=e.original;return l.mode?(0,t.jsx)(m.Badge,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(o.Text,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,t)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((t.original.max_input_tokens||0)+(t.original.max_output_tokens||0)),cell:({row:e})=>{let l=e.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(o.Text,{className:"text-xs",children:[l.max_input_tokens?C(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?C(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,t)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((t.original.input_cost_per_token||0)+(t.original.output_cost_per_token||0)),cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(o.Text,{className:"text-xs",children:l.input_cost_per_token?w(l.input_cost_per_token):"-"}),(0,t.jsx)(o.Text,{className:"text-xs text-gray-500",children:l.output_cost_per_token?w(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:({row:e})=>{let l=Object.entries(e.original).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>e),s=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(o.Text,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,l)=>(0,t.jsx)(m.Badge,{color:s[l%s.length],size:"xs",children:e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,t)=>(!0===e.original.is_public_model_group)-(!0===t.original.is_public_model_group),cell:({row:e})=>!0===e.original.is_public_model_group?(0,t.jsx)(m.Badge,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Badge,{color:"gray",size:"xs",children:"No"}),meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:({row:l})=>{let s=l.original;return(0,t.jsxs)(N.Button,{size:"xs",variant:"secondary",onClick:()=>e(s),icon:T.InfoCircleOutlined,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return s?i.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):i})(e=>{L(e),A(!0)},eE,a),data:D,isLoading:B,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(o.Text,{className:"text-sm text-gray-600",children:["Showing ",D.length," of ",M?.length||0," models"]})})]}),(0,t.jsxs)(J.TabPanel,{children:[(0,t.jsxs)(j.Card,{children:[!1==a&&g&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>void(e&&ed(!0)),children:"Select Agents to Make Public"})}),(0,t.jsx)(K.ModelDataTable,{columns:(0,l.getAgentHubTableColumns)(e=>{eh(e),eg(!0)},eE,a),data:er||[],isLoading:em,defaultSorting:[{id:"name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(o.Text,{className:"text-sm text-gray-600",children:["Showing ",er?.length||0," agent",er?.length!==1?"s":""]})})]}),(0,t.jsxs)(J.TabPanel,{children:[(0,t.jsxs)(j.Card,{children:[!1==a&&g&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>void(e&&eT(!0)),children:"Select MCP Servers to Make Public"})}),(0,t.jsx)(K.ModelDataTable,{columns:((e,l,s=!1)=>[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let s=e.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)(o.Text,{className:"font-medium text-sm",children:s.server_name}),(0,t.jsx)(S.Tooltip,{title:"Copy server name",children:(0,t.jsx)($.CopyOutlined,{onClick:()=>l(s.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(o.Text,{className:"text-xs text-gray-600",children:s.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(o.Text,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"URL",accessorKey:"url",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let s=e.original;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"text-xs truncate max-w-xs",children:s.url}),(0,t.jsx)(S.Tooltip,{title:"Copy URL",children:(0,t.jsx)($.CopyOutlined,{onClick:()=>l(s.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs flex-shrink-0"})})]})},meta:{className:"hidden lg:table-cell"}},{header:"Transport",accessorKey:"transport",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(m.Badge,{color:"blue",size:"sm",children:l.transport})},meta:{className:"hidden md:table-cell"}},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original,s="none"===l.auth_type?"gray":"green";return(0,t.jsx)(m.Badge,{color:s,size:"sm",children:l.auth_type})},meta:{className:"hidden md:table-cell"}},{header:"Status",accessorKey:"status",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original,s={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,t.jsx)(m.Badge,{color:s,size:"sm",children:l.status||"unknown"})}},{header:"Tools",accessorKey:"allowed_tools",enableSorting:!1,cell:({row:e})=>{let l=e.original.allowed_tools||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(o.Text,{className:"text-xs font-medium",children:l.length>0?`${l.length} tool${1!==l.length?"s":""}`:"All tools"}),l.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map((e,l)=>(0,t.jsx)(k.Tag,{color:"purple",className:"text-xs",children:e},l)),l.length>2&&(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})},meta:{className:"hidden lg:table-cell"}},{header:"Created By",accessorKey:"created_by",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:e})=>{let l=e.original;return(0,t.jsx)(o.Text,{className:"text-xs",children:l.created_by||"-"})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"mcp_info.is_public",enableSorting:!0,sortingFn:(e,t)=>(e.original.mcp_info?.is_public===!0)-(t.original.mcp_info?.is_public===!0),cell:({row:e})=>{let l=e.original;return l.mcp_info?.is_public===!0?(0,t.jsx)(m.Badge,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(m.Badge,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:({row:l})=>{let s=l.original;return(0,t.jsxs)(N.Button,{size:"xs",variant:"secondary",onClick:()=>e(s),icon:T.InfoCircleOutlined,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}])(e=>{eN(e),ek(!0)},eE,a),data:eb||[],isLoading:ef,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(o.Text,{className:"text-sm text-gray-600",children:["Showing ",eb?.length||0," MCP server",eb?.length!==1?"s":""]})})]}),(0,t.jsxs)(J.TabPanel,{children:[!1==a&&g&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(N.Button,{onClick:()=>eI(!0),children:"Select Skills to Make Public"})}),(0,t.jsx)(R.default,{skills:ew,isLoading:e_,isAdmin:g,accessToken:e,publicPage:a,onPublishSuccess:async()=>{eC((await (0,x.getClaudeCodePluginsList)(e||"",a)).plugins)}})]})]})]})]}):(0,t.jsxs)(j.Card,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(o.Text,{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)(i.Modal,{title:"Public Model Hub",width:600,open:H,footer:null,onOk:eA,onCancel:eH,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)(o.Text,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(o.Text,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:`${(0,x.getProxyBaseUrl)()}/ui/model_hub_table`})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(N.Button,{onClick:()=>{eB.replace(`/model_hub_table?key=${e}`)},children:"See Page"})})]})}),(0,t.jsx)(i.Modal,{title:F?.model_group||"Model Details",width:1e3,open:O,footer:null,onOk:eA,onCancel:eH,children:F&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{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)(o.Text,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(o.Text,{children:F.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(o.Text,{children:F.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:F.providers.map(e=>(0,t.jsx)(m.Badge,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{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)(o.Text,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(o.Text,{children:F.max_input_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(o.Text,{children:F.max_output_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(o.Text,{children:F.input_cost_per_token?eF(F.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(o.Text,{children:F.output_cost_per_token?eF(F.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(c=Object.entries(F).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>e),h=["green","blue","purple","orange","red","yellow"],0===c.length?(0,t.jsx)(o.Text,{className:"text-gray-500",children:"No special capabilities listed"}):c.map((e,l)=>(0,t.jsx)(m.Badge,{color:h[l%h.length],children:e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e)))})]}),(F.tpm||F.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[F.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(o.Text,{children:F.tpm.toLocaleString()})]}),F.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(o.Text,{children:F.rpm.toLocaleString()})]})]})]}),F.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:F.supported_openai_params.map(e=>(0,t.jsx)(m.Badge,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(et.Prism,{language:"python",className:"text-sm",children:`import openai
client = openai.OpenAI(
api_key="your_api_key",
@@ -6,7 +6,7 @@ client = openai.OpenAI(
)
response = client.chat.completions.create(
- model="${E.model_group}",
+ model="${F.model_group}",
messages=[
{
"role": "user",
@@ -15,14 +15,14 @@ response = client.chat.completions.create(
]
)
-print(response.choices[0].message.content)`})]})]})}),(0,t.jsx)(s.Modal,{title:ex?.name||"Agent Details",width:1e3,open:eh,footer:null,onOk:eA,onCancel:eO,children:ex&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Name:"}),(0,t.jsx)(o.Text,{children:ex.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Version:"}),(0,t.jsxs)(m.Badge,{color:"blue",children:["v",ex.version]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Protocol Version:"}),(0,t.jsx)(o.Text,{children:ex.protocolVersion})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"truncate",children:ex.url}),(0,t.jsx)($.CopyOutlined,{onClick:()=>eH(ex.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(o.Text,{className:"mt-1",children:ex.description})]})]}),ex.capabilities&&Object.keys(ex.capabilities).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(ex.capabilities).filter(([e,t])=>!0===t).map(([e])=>(0,t.jsx)(m.Badge,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Input Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:ex.defaultInputModes?.map(e=>(0,t.jsx)(m.Badge,{color:"blue",children:e},e))||(0,t.jsx)(o.Text,{children:"Not specified"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Output Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:ex.defaultOutputModes?.map(e=>(0,t.jsx)(m.Badge,{color:"purple",children:e},e))||(0,t.jsx)(o.Text,{children:"Not specified"})})]})]})]}),ex.skills&&ex.skills.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,t.jsx)("div",{className:"space-y-4",children:ex.skills.map(e=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium text-base",children:e.name}),(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["ID: ",e.id]})]}),e.tags&&e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,t.jsx)(m.Badge,{color:"purple",size:"xs",children:e},e))})]}),(0,t.jsx)(o.Text,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-xs font-medium text-gray-700",children:"Examples:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.examples.map((e,l)=>(0,t.jsx)(m.Badge,{color:"gray",size:"xs",children:e},l))})]})]},e.id))})]}),ex.supportsAuthenticatedExtendedCard&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,t.jsx)(m.Badge,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,t.jsx)(s.Modal,{title:ev?.server_name||"MCP Server Details",width:1e3,open:eN,footer:null,onOk:eA,onCancel:eO,children:ev&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Server Name:"}),(0,t.jsx)(o.Text,{children:ev.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Server ID:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"text-xs truncate",children:ev.server_id}),(0,t.jsx)($.CopyOutlined,{onClick:()=>eH(ev.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),ev.alias&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Alias:"}),(0,t.jsx)(o.Text,{children:ev.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Transport:"}),(0,t.jsx)(m.Badge,{color:"blue",children:ev.transport})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Auth Type:"}),(0,t.jsx)(m.Badge,{color:"none"===ev.auth_type?"gray":"green",children:ev.auth_type})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Status:"}),(0,t.jsx)(m.Badge,{color:"active"===ev.status||"healthy"===ev.status?"green":"inactive"===ev.status||"unhealthy"===ev.status?"red":"gray",children:ev.status||"unknown"})]})]}),ev.description&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(o.Text,{className:"mt-1",children:ev.description})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Connection Details"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,t.jsx)(o.Text,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:ev.url}),(0,t.jsx)($.CopyOutlined,{onClick:()=>eH(ev.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),ev.command&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Command:"}),(0,t.jsx)(o.Text,{className:"text-sm bg-gray-100 p-2 rounded mt-1 font-mono",children:ev.command})]})]})]}),ev.allowed_tools&&ev.allowed_tools.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ev.allowed_tools.map((e,l)=>(0,t.jsx)(m.Badge,{color:"purple",children:e},l))})]}),ev.teams&&ev.teams.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ev.teams.map((e,l)=>(0,t.jsx)(m.Badge,{color:"blue",children:e},l))})]}),ev.mcp_access_groups&&ev.mcp_access_groups.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ev.mcp_access_groups.map((e,l)=>(0,t.jsx)(m.Badge,{color:"green",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Metadata"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Created By:"}),(0,t.jsx)(o.Text,{children:ev.created_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Updated By:"}),(0,t.jsx)(o.Text,{children:ev.updated_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Created At:"}),(0,t.jsx)(o.Text,{className:"text-sm",children:new Date(ev.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Updated At:"}),(0,t.jsx)(o.Text,{className:"text-sm",children:new Date(ev.updated_at).toLocaleString()})]}),ev.last_health_check&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Last Health Check:"}),(0,t.jsx)(o.Text,{className:"text-sm",children:new Date(ev.last_health_check).toLocaleString()})]})]}),ev.health_check_error&&(0,t.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,t.jsx)(o.Text,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,t.jsx)(o.Text,{className:"text-sm text-red-600 mt-1",children:ev.health_check_error})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(et.Prism,{language:"python",className:"text-sm",children:`from fastmcp import Client
+print(response.choices[0].message.content)`})]})]})}),(0,t.jsx)(i.Modal,{title:eu?.name||"Agent Details",width:1e3,open:ep,footer:null,onOk:eA,onCancel:eH,children:eu&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Name:"}),(0,t.jsx)(o.Text,{children:eu.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Version:"}),(0,t.jsxs)(m.Badge,{color:"blue",children:["v",eu.version]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Protocol Version:"}),(0,t.jsx)(o.Text,{children:eu.protocolVersion})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"truncate",children:eu.url}),(0,t.jsx)($.CopyOutlined,{onClick:()=>eE(eu.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(o.Text,{className:"mt-1",children:eu.description})]})]}),eu.capabilities&&Object.keys(eu.capabilities).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(eu.capabilities).filter(([e,t])=>!0===t).map(([e])=>(0,t.jsx)(m.Badge,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Input Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:eu.defaultInputModes?.map(e=>(0,t.jsx)(m.Badge,{color:"blue",children:e},e))||(0,t.jsx)(o.Text,{children:"Not specified"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Output Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:eu.defaultOutputModes?.map(e=>(0,t.jsx)(m.Badge,{color:"purple",children:e},e))||(0,t.jsx)(o.Text,{children:"Not specified"})})]})]})]}),eu.skills&&eu.skills.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,t.jsx)("div",{className:"space-y-4",children:eu.skills.map(e=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium text-base",children:e.name}),(0,t.jsxs)(o.Text,{className:"text-xs text-gray-500",children:["ID: ",e.id]})]}),e.tags&&e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,t.jsx)(m.Badge,{color:"purple",size:"xs",children:e},e))})]}),(0,t.jsx)(o.Text,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-xs font-medium text-gray-700",children:"Examples:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.examples.map((e,l)=>(0,t.jsx)(m.Badge,{color:"gray",size:"xs",children:e},l))})]})]},e.id))})]}),eu.supportsAuthenticatedExtendedCard&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,t.jsx)(m.Badge,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,t.jsx)(i.Modal,{title:ey?.server_name||"MCP Server Details",width:1e3,open:eS,footer:null,onOk:eA,onCancel:eH,children:ey&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Server Name:"}),(0,t.jsx)(o.Text,{children:ey.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Server ID:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.Text,{className:"text-xs truncate",children:ey.server_id}),(0,t.jsx)($.CopyOutlined,{onClick:()=>eE(ey.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),ey.alias&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Alias:"}),(0,t.jsx)(o.Text,{children:ey.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Transport:"}),(0,t.jsx)(m.Badge,{color:"blue",children:ey.transport})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Auth Type:"}),(0,t.jsx)(m.Badge,{color:"none"===ey.auth_type?"gray":"green",children:ey.auth_type})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Status:"}),(0,t.jsx)(m.Badge,{color:"active"===ey.status||"healthy"===ey.status?"green":"inactive"===ey.status||"unhealthy"===ey.status?"red":"gray",children:ey.status||"unknown"})]})]}),ey.description&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(o.Text,{className:"mt-1",children:ey.description})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Connection Details"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,t.jsx)(o.Text,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:ey.url}),(0,t.jsx)($.CopyOutlined,{onClick:()=>eE(ey.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),ey.command&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Command:"}),(0,t.jsx)(o.Text,{className:"text-sm bg-gray-100 p-2 rounded mt-1 font-mono",children:ey.command})]})]})]}),ey.allowed_tools&&ey.allowed_tools.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ey.allowed_tools.map((e,l)=>(0,t.jsx)(m.Badge,{color:"purple",children:e},l))})]}),ey.teams&&ey.teams.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ey.teams.map((e,l)=>(0,t.jsx)(m.Badge,{color:"blue",children:e},l))})]}),ey.mcp_access_groups&&ey.mcp_access_groups.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ey.mcp_access_groups.map((e,l)=>(0,t.jsx)(m.Badge,{color:"green",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Metadata"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Created By:"}),(0,t.jsx)(o.Text,{children:ey.created_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Updated By:"}),(0,t.jsx)(o.Text,{children:ey.updated_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Created At:"}),(0,t.jsx)(o.Text,{className:"text-sm",children:new Date(ey.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Updated At:"}),(0,t.jsx)(o.Text,{className:"text-sm",children:new Date(ey.updated_at).toLocaleString()})]}),ey.last_health_check&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"font-medium",children:"Last Health Check:"}),(0,t.jsx)(o.Text,{className:"text-sm",children:new Date(ey.last_health_check).toLocaleString()})]})]}),ey.health_check_error&&(0,t.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,t.jsx)(o.Text,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,t.jsx)(o.Text,{className:"text-sm text-red-600 mt-1",children:ey.health_check_error})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(et.Prism,{language:"python",className:"text-sm",children:`from fastmcp import Client
import asyncio
# Standard MCP configuration
config = {
"mcpServers": {
- "${ev.server_name}": {
- "url": "${(0,x.getProxyBaseUrl)()}/${ev.server_name}/mcp",
+ "${ey.server_name}": {
+ "url": "${(0,x.getProxyBaseUrl)()}/${ey.server_name}/mcp",
"headers": {
"x-litellm-api-key": "Bearer sk-1234"
}
@@ -47,4 +47,4 @@ async def main():
print(f"Response: {response}")
if __name__ == "__main__":
- asyncio.run(main())`})]})]})}),(0,t.jsx)(y,{visible:W,onClose:()=>ea(!1),accessToken:e||"",modelHubData:_||[],onSuccess:()=>{e&&(async()=>{try{let t=await (0,x.modelHubCall)(e);M(t.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,t.jsx)(p,{visible:ec,onClose:()=>eo(!1),accessToken:e||"",agentHubData:en||[],onSuccess:()=>{e&&(async()=>{try{let t=(await (0,x.getAgentsList)(e)).agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.is_public}));er(t)}catch(e){console.error("Error refreshing agent data:",e)}})()}}),(0,t.jsx)(b,{visible:ek,onClose:()=>e$(!1),accessToken:e||"",mcpHubData:eg||[],onSuccess:()=>{e&&(async()=>{try{let t=await (0,x.fetchMCPServers)(e);eb(t)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}}),(0,t.jsx)(U,{visible:eP,onClose:()=>eM(!1),accessToken:e||"",skillsList:eT,onSuccess:async()=>{ew((await (0,x.getClaudeCodePluginsList)(e||"",!0===a)).plugins)}})]})}],934879)}]);
\ No newline at end of file
+ asyncio.run(main())`})]})]})}),(0,t.jsx)(y,{visible:ea,onClose:()=>en(!1),accessToken:e||"",modelHubData:M||[],onSuccess:()=>{e&&(async()=>{try{let t=await (0,x.modelHubCall)(e);I(t.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,t.jsx)(p,{visible:eo,onClose:()=>ed(!1),accessToken:e||"",agentHubData:er||[],onSuccess:()=>{e&&(async()=>{try{let t=(await (0,x.getAgentsList)(e)).agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.is_public}));ec(t)}catch(e){console.error("Error refreshing agent data:",e)}})()}}),(0,t.jsx)(b,{visible:e$,onClose:()=>eT(!1),accessToken:e||"",mcpHubData:eb||[],onSuccess:()=>{e&&(async()=>{try{let t=await (0,x.fetchMCPServers)(e);ej(t)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}}),(0,t.jsx)(U,{visible:eM,onClose:()=>eI(!1),accessToken:e||"",skillsList:ew,onSuccess:async()=>{eC((await (0,x.getClaudeCodePluginsList)(e||"",!0===a)).plugins)}})]})}],934879)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/eaa9f9b9bb3e054b.js b/litellm/proxy/_experimental/out/_next/static/chunks/0cdfadbcf4b8c9e4.js
similarity index 99%
rename from litellm/proxy/_experimental/out/_next/static/chunks/eaa9f9b9bb3e054b.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/0cdfadbcf4b8c9e4.js
index 90c31ed55e..e3a6771539 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/eaa9f9b9bb3e054b.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/0cdfadbcf4b8c9e4.js
@@ -4,7 +4,7 @@ ${t}`)}return n})(tN);class tE extends tw{list(e={},t){let{betas:s,...r}=e??{};r
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!r.stream&&null==a){let e=t$[r.model]??void 0;a=this._client.calculateNonstreamingTimeout(r.max_tokens,e)}return this._client.post("/v1/messages?beta=true",{body:r,timeout:a??6e5,...t,headers:t_([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}stream(e,t){return tM.createMessage(this,e,t)}countTokens(e,t){let{betas:s,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...t,headers:t_([{"anthropic-beta":[...s??[],"token-counting-2024-11-01"].toString()},t?.headers])})}}tD.Batches=tA;class tB extends tw{constructor(){super(...arguments),this.models=new tC(this._client),this.messages=new tD(this._client),this.files=new tE(this._client)}}tB.Models=tC,tB.Messages=tD,tB.Files=tE;class tq extends tw{create(e,t){let{betas:s,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...t,headers:t_([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}let tW="__json_buf";function tz(e){return"tool_use"===e.type||"server_tool_use"===e.type}class tH{constructor(){P.add(this),this.messages=[],this.receivedMessages=[],O.set(this,void 0),this.controller=new AbortController,R.set(this,void 0),I.set(this,()=>{}),M.set(this,()=>{}),L.set(this,void 0),$.set(this,()=>{}),U.set(this,()=>{}),D.set(this,{}),B.set(this,!1),q.set(this,!1),W.set(this,!1),z.set(this,!1),H.set(this,void 0),F.set(this,void 0),V.set(this,e=>{if(e_(this,q,!0,"f"),eE(e)&&(e=new eP),e instanceof eP)return e_(this,W,!0,"f"),this._emit("abort",e);if(e instanceof eT)return this._emit("error",e);if(e instanceof Error){let t=new eT(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new eT(String(e)))}),e_(this,R,new Promise((e,t)=>{e_(this,I,e,"f"),e_(this,M,t,"f")}),"f"),e_(this,L,new Promise((e,t)=>{e_(this,$,e,"f"),e_(this,U,t,"f")}),"f"),eN(this,R,"f").catch(()=>{}),eN(this,L,"f").catch(()=>{})}get response(){return eN(this,H,"f")}get request_id(){return eN(this,F,"f")}async withResponse(){let e=await eN(this,R,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new tH;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,s){let r=new tH;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},eN(this,V,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,s){let r=s?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),eN(this,P,"m",K).call(this);let{response:a,data:n}=await e.create({...t,stream:!0},{...s,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(a),n))eN(this,P,"m",X).call(this,e);if(n.controller.signal?.aborted)throw new eP;eN(this,P,"m",Y).call(this)}_connected(e){this.ended||(e_(this,H,e,"f"),e_(this,F,e?.headers.get("request-id"),"f"),eN(this,I,"f").call(this,e),this._emit("connect"))}get ended(){return eN(this,B,"f")}get errored(){return eN(this,q,"f")}get aborted(){return eN(this,W,"f")}abort(){this.controller.abort()}on(e,t){return(eN(this,D,"f")[e]||(eN(this,D,"f")[e]=[])).push({listener:t}),this}off(e,t){let s=eN(this,D,"f")[e];if(!s)return this;let r=s.findIndex(e=>e.listener===t);return r>=0&&s.splice(r,1),this}once(e,t){return(eN(this,D,"f")[e]||(eN(this,D,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,s)=>{e_(this,z,!0,"f"),"error"!==e&&this.once("error",s),this.once(e,t)})}async done(){e_(this,z,!0,"f"),await eN(this,L,"f")}get currentMessage(){return eN(this,O,"f")}async finalMessage(){return await this.done(),eN(this,P,"m",J).call(this)}async finalText(){return await this.done(),eN(this,P,"m",G).call(this)}_emit(e,...t){if(eN(this,B,"f"))return;"end"===e&&(e_(this,B,!0,"f"),eN(this,$,"f").call(this));let s=eN(this,D,"f")[e];if(s&&(eN(this,D,"f")[e]=s.filter(e=>!e.once),s.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];eN(this,z,"f")||s?.length||Promise.reject(e),eN(this,M,"f").call(this,e),eN(this,U,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];eN(this,z,"f")||s?.length||Promise.reject(e),eN(this,M,"f").call(this,e),eN(this,U,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",eN(this,P,"m",J).call(this))}async _fromReadableStream(e,t){let s=t?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),eN(this,P,"m",K).call(this),this._connected(null);let r=te.fromReadableStream(e,this.controller);for await(let e of r)eN(this,P,"m",X).call(this,e);if(r.controller.signal?.aborted)throw new eP;eN(this,P,"m",Y).call(this)}[(O=new WeakMap,R=new WeakMap,I=new WeakMap,M=new WeakMap,L=new WeakMap,$=new WeakMap,U=new WeakMap,D=new WeakMap,B=new WeakMap,q=new WeakMap,W=new WeakMap,z=new WeakMap,H=new WeakMap,F=new WeakMap,V=new WeakMap,P=new WeakSet,J=function(){if(0===this.receivedMessages.length)throw new eT("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},G=function(){if(0===this.receivedMessages.length)throw new eT("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(e=>"text"===e.type).map(e=>e.text);if(0===e.length)throw new eT("stream ended without producing a content block with type=text");return e.join(" ")},K=function(){this.ended||e_(this,O,void 0,"f")},X=function(e){if(this.ended)return;let t=eN(this,P,"m",Q).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let s=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===s.type&&this._emit("text",e.delta.text,s.text||"");break;case"citations_delta":"text"===s.type&&this._emit("citation",e.delta.citation,s.citations??[]);break;case"input_json_delta":tz(s)&&s.input&&this._emit("inputJson",e.delta.partial_json,s.input);break;case"thinking_delta":"thinking"===s.type&&this._emit("thinking",e.delta.thinking,s.thinking);break;case"signature_delta":"thinking"===s.type&&this._emit("signature",s.signature);break;default:tF(e.delta)}break}case"message_stop":this._addMessageParam(t),this._addMessage(t,!0);break;case"content_block_stop":this._emit("contentBlock",t.content.at(-1));break;case"message_start":e_(this,O,t,"f")}},Y=function(){if(this.ended)throw new eT("stream has ended, this shouldn't happen");let e=eN(this,O,"f");if(!e)throw new eT("request ended without sending any chunks");return e_(this,O,void 0,"f"),e},Q=function(e){let t=eN(this,O,"f");if("message_start"===e.type){if(t)throw new eT(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new eT(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":case"content_block_stop":return t;case"message_delta":return t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,null!=e.usage.input_tokens&&(t.usage.input_tokens=e.usage.input_tokens),null!=e.usage.cache_creation_input_tokens&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),null!=e.usage.cache_read_input_tokens&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),null!=e.usage.server_tool_use&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case"content_block_start":return t.content.push(e.content_block),t;case"content_block_delta":{let s=t.content.at(e.index);switch(e.delta.type){case"text_delta":s?.type==="text"&&(s.text+=e.delta.text);break;case"citations_delta":s?.type==="text"&&(s.citations??(s.citations=[]),s.citations.push(e.delta.citation));break;case"input_json_delta":if(s&&tz(s)){let t=s[tW]||"";Object.defineProperty(s,tW,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t&&(s.input=tO(t))}break;case"thinking_delta":s?.type==="thinking"&&(s.thinking+=e.delta.thinking);break;case"signature_delta":s?.type==="thinking"&&(s.signature=e.delta.signature);break;default:tF(e.delta)}return t}}},Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("streamEvent",s=>{let r=t.shift();r?r.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(s=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(s=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new te(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function tF(e){}class tJ extends tw{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(tk`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",tc,{query:e,...t})}delete(e,t){return this._client.delete(tk`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(tk`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let s=await this.retrieve(e);if(!s.results_url)throw new eT(`No batch \`results_url\`; Has it finished processing? ${s.processing_status} - ${s.id}`);return this._client.get(s.results_url,{...t,headers:t_([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tT.fromResponse(t.response,t.controller))}}class tG extends tw{constructor(){super(...arguments),this.batches=new tJ(this._client)}create(e,t){e.model in tV&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${tV[e.model]}
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let s=this._client._options.timeout;if(!e.stream&&null==s){let t=t$[e.model]??void 0;s=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}return this._client.post("/v1/messages",{body:e,timeout:s??6e5,...t,stream:e.stream??!1})}stream(e,t){return tH.createMessage(this,e,t)}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}let tV={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};tG.Batches=tJ;class tK extends tw{retrieve(e,t={},s){let{betas:r}=t??{};return this._client.get(tk`/v1/models/${e}`,{...s,headers:t_([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},s?.headers])})}list(e={},t){let{betas:s,...r}=e??{};return this._client.getAPIList("/v1/models",tc,{query:r,...t,headers:t_([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},t?.headers])})}}let tX=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()??void 0:void 0!==globalThis.Deno?globalThis.Deno.env?.get?.(e)?.trim():void 0;class tY{constructor({baseURL:e=tX("ANTHROPIC_BASE_URL"),apiKey:t=tX("ANTHROPIC_API_KEY")??null,authToken:s=tX("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){Z.set(this,void 0);const a={apiKey:t,authToken:s,...r,baseURL:e||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&"u">typeof window&&void 0!==window.document&&"u">typeof navigator)throw new eT("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n");this.baseURL=a.baseURL,this.timeout=a.timeout??tQ.DEFAULT_TIMEOUT,this.logger=a.logger??console;const n="warn";this.logLevel=n,this.logLevel=eJ(a.logLevel,"ClientOptions.logLevel",this)??eJ(tX("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??n,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??function(){if("u">typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),e_(this,Z,e6,"f"),this._options=a,this.apiKey=t,this.authToken=s}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(this.apiKey&&e.get("x-api-key")||t.has("x-api-key")||this.authToken&&e.get("authorization"))&&!t.has("authorization"))throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}authHeaders(e){return t_([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(null!=this.apiKey)return t_([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(null!=this.authToken)return t_([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new eT(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${eZ}`}defaultIdempotencyKey(){return`stainless-node-retry-${ek()}`}makeStatusError(e,t,s,r){return eA.generate(e,t,s,r)}buildURL(e,t){let s=new URL(eW.test(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return!function(e){if(!e)return!0;for(let t in e)return!1;return!0}(r)&&(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(s.search=this.stringifyQuery(t)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new eT("Streaming is strongly recommended for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:t,options:s}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,s){return this.request(Promise.resolve(s).then(s=>({method:e,path:t,...s})))}request(e,t=null){return new ti(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,s){let r=await e,a=r.maxRetries??this.maxRetries;null==t&&(t=a),await this.prepareOptions(r);let{req:n,url:i,timeout:o}=this.buildRequest(r,{retryCount:a-t});await this.prepareRequest(n,{url:i,options:r});let l="log_"+(0x1000000*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===s?"":`, retryOf: ${s}`,d=Date.now();if(eY(this).debug(`[${l}] sending request`,eQ({retryOfRequestLogID:s,method:r.method,url:i,options:r,headers:n.headers})),r.signal?.aborted)throw new eP;let u=new AbortController,h=await this.fetchWithTimeout(i,n,o,u).catch(eC),m=Date.now();if(h instanceof Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new eP;let a=eE(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):""));if(t)return eY(this).info(`[${l}] connection ${a?"timed out":"failed"} - ${e}`),eY(this).debug(`[${l}] connection ${a?"timed out":"failed"} (${e})`,eQ({retryOfRequestLogID:s,url:i,durationMs:m-d,message:h.message})),this.retryRequest(r,t,s??l);if(eY(this).info(`[${l}] connection ${a?"timed out":"failed"} - error; no more retries left`),eY(this).debug(`[${l}] connection ${a?"timed out":"failed"} (error; no more retries left)`,eQ({retryOfRequestLogID:s,url:i,durationMs:m-d,message:h.message})),a)throw new eR;throw new eO({cause:h})}let p=[...h.headers.entries()].filter(([e])=>"request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),f=`[${l}${c}${p}] ${n.method} ${i} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${m-d}ms`;if(!h.ok){let e=this.shouldRetry(h);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await e5(h.body),eY(this).info(`${f} - ${e}`),eY(this).debug(`[${l}] response error (${e})`,eQ({retryOfRequestLogID:s,url:h.url,status:h.status,headers:h.headers,durationMs:m-d})),this.retryRequest(r,t,s??l,h.headers)}let a=e?"error; no more retries left":"error; not retryable";eY(this).info(`${f} - ${a}`);let n=await h.text().catch(e=>eC(e).message),i=eH(n),o=i?void 0:n;throw eY(this).debug(`[${l}] response error (${a})`,eQ({retryOfRequestLogID:s,url:h.url,status:h.status,headers:h.headers,message:o,durationMs:Date.now()-d})),this.makeStatusError(h.status,i,o,h.headers)}return eY(this).info(f),eY(this).debug(`[${l}] response start`,eQ({retryOfRequestLogID:s,url:h.url,status:h.status,headers:h.headers,durationMs:m-d})),{response:h,options:r,controller:u,requestLogID:l,retryOfRequestLogID:s,startTime:d}}getAPIList(e,t,s){return this.requestAPIList(t,{method:"get",path:e,...s})}requestAPIList(e,t){return new tl(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,s,r){let{signal:a,method:n,...i}=t||{};a&&a.addEventListener("abort",()=>r.abort());let o=setTimeout(()=>r.abort(),s),l=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||"object"==typeof i.body&&null!==i.body&&Symbol.asyncIterator in i.body,c={signal:r.signal,...l?{duplex:"half"}:{},method:"GET",...i};n&&(c.method=n.toUpperCase());try{return await this.fetch.call(void 0,e,c)}finally{clearTimeout(o)}}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,s,r){let a,n,i=r?.get("retry-after-ms");if(i){let e=parseFloat(i);Number.isNaN(e)||(a=e)}let o=r?.get("retry-after");if(o&&!a){let e=parseFloat(o);a=Number.isNaN(e)?Date.parse(o)-Date.now():1e3*e}if(!(a&&0<=a&&a<6e4)){let s=e.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(t,s)}return await (n=a,new Promise(e=>setTimeout(e,n))),this.makeRequest(e,t-1,s)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}calculateNonstreamingTimeout(e,t){if(36e5*e/128e3>6e5||null!=t&&e>t)throw new eT("Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}buildRequest(e,{retryCount:t=0}={}){let s={...e},{method:r,path:a,query:n}=s,i=this.buildURL(a,n);"timeout"in s&&((e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new eT(`${e} must be an integer`);if(t<0)throw new eT(`${e} must be a positive integer`)})("timeout",s.timeout),s.timeout=s.timeout??this.timeout;let{bodyHeaders:o,body:l}=this.buildBody({options:s}),c=this.buildHeaders({options:e,method:r,bodyHeaders:o,retryCount:t});return{req:{method:r,headers:c,...s.signal&&{signal:s.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...s.fetchOptions??{}},url:i,timeout:s.timeout}}buildHeaders({options:e,method:t,bodyHeaders:r,retryCount:a}){let n={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),n[this.idempotencyHeader]=e.idempotencyKey);let i=t_([n,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...s??(s=(()=>{let e="u">typeof Deno&&null!=Deno.build?"deno":"u">typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eZ,"X-Stainless-OS":e1(Deno.build.os),"X-Stainless-Arch":e0(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("u">typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eZ,"X-Stainless-OS":e1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":e0(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("u"0&&(g["x-litellm-tags"]=a.join(","));let y=new tQ({apiKey:r,baseURL:f,dangerouslyAllowBrowser:!0,defaultHeaders:g});try{let r=Date.now(),a=!1,m={model:s,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(m.vector_store_ids=d),u&&(m.guardrails=u),h&&(m.policies=h),y.messages.stream(m,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let n=e.delta;if(!a){a=!0;let e=Date.now()-r;console.log("First token received! Time:",e,"ms"),o&&o(e)}"text_delta"===n.type?t("assistant",n.text,s):"reasoning_delta"===n.type&&i&&i(n.text)}if("message_delta"===e.type&&e.usage&&l){let t=e.usage;console.log("Usage data found:",t);let s={completionTokens:t.output_tokens,promptTokens:t.input_tokens,totalTokens:t.input_tokens+t.output_tokens};l(s)}}}catch(e){throw n?.aborted?console.log("Anthropic messages request was cancelled"):t1.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeAnthropicMessagesRequest",()=>t2],434788);var t4=e.i(356449);async function t3(e,t,s,r,a,n,i,o,l,c){console.log=function(){},console.log("isLocal:",!1);let d=c||(0,ev.getProxyBaseUrl)(),u=new t4.default.OpenAI({apiKey:a,baseURL:d,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=await u.audio.speech.create({model:r,input:e,voice:t,...o?{response_format:o}:{},...l?{speed:l}:{}},{signal:i}),n=await a.blob(),c=URL.createObjectURL(n);s(c,r)}catch(e){throw i?.aborted?console.log("Audio speech request was cancelled"):t1.default.fromBackend(`Error occurred while generating speech. Please try again. Error: ${e}`),e}}async function t5(e,t,s,r,a,n,i,o,l,c,d){console.log=function(){},console.log("isLocal:",!1);let u=d||(0,ev.getProxyBaseUrl)(),h=new t4.default.OpenAI({apiKey:r,baseURL:u,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{console.log("Processing audio file for transcription:",e.name);let r=await h.audio.transcriptions.create({model:s,file:e,...i?{language:i}:{},...o?{prompt:o}:{},...l?{response_format:l}:{},...void 0!==c?{temperature:c}:{}},{signal:n});if(console.log("Transcription response:",r),r&&r.text)t(r.text,s),t1.default.success("Audio transcribed successfully");else throw Error("No transcription text in response")}catch(e){if(console.error("Error making audio transcription request:",e),n?.aborted)console.log("Audio transcription request was cancelled");else{let t="Failed to transcribe audio";e?.error?.message?t=e.error.message:e?.message&&(t=e.message),t1.default.fromBackend(`Audio transcription failed: ${t}`)}throw e}}async function t6(e,t,s,r,a,n){if(!r)throw Error("Virtual Key is required");console.log=function(){};let i=n||(0,ev.getProxyBaseUrl)(),o={};a&&a.length>0&&(o["x-litellm-tags"]=a.join(","));try{let a=i.endsWith("/")?i.slice(0,-1):i,n=`${a}/embeddings`,l=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",[(0,ev.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,...o},body:JSON.stringify({model:s,input:e})});if(!l.ok){let e=await l.text();throw Error(e||`Request failed with status ${l.status}`)}let c=await l.json(),d=c?.data?.[0]?.embedding;if(!d)throw Error("No embedding returned from server");t(JSON.stringify(d),c?.model??s)}catch(e){throw t1.default.fromBackend(`Error occurred while making embeddings request. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIAudioSpeechRequest",()=>t3],512882),e.s(["makeOpenAIAudioTranscriptionRequest",()=>t5],584976),e.s(["makeOpenAIEmbeddingsRequest",()=>t6],720762)},488143,(e,t,s)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:s,blurHeight:r,blurDataURL:a,objectFit:n}){let i=s?40*s:e,o=r?40*r:t,l=i&&o?`viewBox='0 0 ${i} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${l}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${l?"none":"contain"===n?"xMidYMid":"cover"===n?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${a}'/%3E%3C/svg%3E`}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},987690,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return n},imageConfigDefault:function(){return i}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let n=["default","imgix","cloudinary","akamai","custom"],i={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},908927,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImgProps",{enumerable:!0,get:function(){return c}}),e.r(233525);let r=e.r(543369),a=e.r(488143),n=e.r(987690),i=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:s=!1,priority:c=!1,preload:d=!1,loading:u,className:h,quality:m,width:p,height:f,fill:g=!1,style:y,overrideSrc:x,onLoad:b,onLoadingComplete:v,placeholder:w="empty",blurDataURL:j,fetchPriority:S,decoding:_="async",layout:N,objectFit:k,objectPosition:E,lazyBoundary:C,lazyRoot:T,...A},P){var O;let R,I,M,{imgConf:L,showAltText:$,blurComplete:U,defaultLoader:D}=P,B=L||n.imageConfigDefault;if("allSizes"in B)R=B;else{let e=[...B.deviceSizes,...B.imageSizes].sort((e,t)=>e-t),t=B.deviceSizes.sort((e,t)=>e-t),s=B.qualities?.sort((e,t)=>e-t);R={...B,allSizes:e,deviceSizes:t,qualities:s}}if(void 0===D)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let q=A.loader||D;delete A.loader,delete A.srcSet;let W="__next_img_default"in q;if(W){if("custom"===R.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=q;q=t=>{let{config:s,...r}=t;return e(r)}}if(N){"fill"===N&&(g=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[N];e&&(y={...y,...e});let s={responsive:"100vw",fill:"100vw"}[N];s&&!t&&(t=s)}let z="",H=l(p),F=l(f);if((O=e)&&"object"==typeof O&&(o(O)||void 0!==O.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(I=t.blurWidth,M=t.blurHeight,j=j||t.blurDataURL,z=t.src,!g)if(H||F){if(H&&!F){let e=H/t.width;F=Math.round(t.height*e)}else if(!H&&F){let e=F/t.height;H=Math.round(t.width*e)}}else H=t.width,F=t.height}let J=!c&&!d&&("lazy"===u||void 0===u);(!(e="string"==typeof e?e:z)||e.startsWith("data:")||e.startsWith("blob:"))&&(s=!0,J=!1),R.unoptimized&&(s=!0),W&&!R.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(s=!0);let G=l(m),V=Object.assign(g?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:k,objectPosition:E}:{},$?{}:{color:"transparent"},y),K=U||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:H,heightInt:F,blurWidth:I,blurHeight:M,blurDataURL:j||"",objectFit:V.objectFit})}")`:`url("${w}")`,X=i.includes(V.objectFit)?"fill"===V.objectFit?"100% 100%":"cover":V.objectFit,Y=K?{backgroundSize:X,backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},Q=function({config:e,src:t,unoptimized:s,width:a,quality:n,sizes:i,loader:o}){if(s){let e=(0,r.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let s=t.includes("?")?"&":"?";t=`${t}${s}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:c}=function({deviceSizes:e,allSizes:t},s,r){if(r){let s=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=s.exec(r);)a.push(parseInt(e[2]));if(a.length){let s=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*s),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof s?{widths:e,kind:"w"}:{widths:[...new Set([s,2*s].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,i),d=l.length-1;return{sizes:i||"w"!==c?i:"100vw",srcSet:l.map((s,r)=>`${o({config:e,src:t,quality:n,width:s})} ${"w"===c?s:r+1}${c}`).join(", "),src:o({config:e,src:t,quality:n,width:l[d]})}}({config:R,src:e,unoptimized:s,width:H,quality:G,sizes:t,loader:q}),Z=J?"lazy":u;return{props:{...A,loading:Z,fetchPriority:S,width:H,height:F,decoding:_,className:h,style:{...V,...Y},sizes:Q.sizes,srcSet:Q.srcSet,src:x||Q.src},meta:{unoptimized:s,preload:d||c,placeholder:w,fill:g}}}},898879,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return o}});let r=e.r(271645),a="u"{}:r.useLayoutEffect,i=a?()=>{}:r.useEffect;function o(e){let{headManager:t,reduceComponentsToState:s}=e;function o(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(s(e))}}return a&&(t?.mountedInstances?.add(e.children),o()),n(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),n(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},325633,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return f},defaultHead:function(){return u}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let n=e.r(563141),i=e.r(151836),o=e.r(843476),l=i._(e.r(271645)),c=n._(e.r(898879)),d=e.r(742732);function u(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(233525);let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,s,r,a;return e.reduce(h,[]).reverse().concat(u().reverse()).filter((t=new Set,s=new Set,r=new Set,a={},e=>{let n=!0,i=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){i=!0;let s=e.key.slice(e.key.indexOf("$")+1);t.has(s)?n=!1:t.add(s)}switch(e.type){case"title":case"base":s.has(e.type)?n=!1:s.add(e.type);break;case"meta":for(let t=0,s=m.length;t{let s=e.key||t;return l.default.cloneElement(e,{key:s})})}let f=function({children:e}){let t=(0,l.useContext)(d.HeadManagerContext);return(0,o.jsx)(c.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},918556,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ImageConfigContext",{enumerable:!0,get:function(){return n}});let r=e.r(563141)._(e.r(271645)),a=e.r(987690),n=r.default.createContext(a.imageConfigDefault)},65856,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(563141)._(e.r(271645)).default.createContext(null)},670965,(e,t,s)=>{"use strict";function r(e,t){let s=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return i}});let r=e.r(670965),a=e.r(543369);function n({config:e,src:t,width:s,quality:n}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
-Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let i=(0,r.findClosestQuality)(n,e),o=(0,a.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${s}&q=${i}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}n.__next_img_default=!0;let i=n},605500,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"Image",{enumerable:!0,get:function(){return v}});let r=e.r(563141),a=e.r(151836),n=e.r(843476),i=a._(e.r(271645)),o=r._(e.r(174080)),l=r._(e.r(325633)),c=e.r(908927),d=e.r(987690),u=e.r(918556);e.r(233525);let h=e.r(65856),m=r._(e.r(1948)),p=e.r(818581),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,s,r,a,n,i){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),s?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,a=!1;s.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function y(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"{let E=(0,i.useCallback)(e=>{e&&(_&&(e.src=e.src),e.complete&&g(e,u,x,b,v,m,j))},[e,u,x,b,v,_,m,j]),C=(0,p.useMergedRef)(k,E);return(0,n.jsx)("img",{...N,...y(d),loading:h,width:a,height:r,decoding:o,"data-nimg":f?"fill":"1",className:l,style:c,sizes:s,srcSet:t,src:e,ref:C,onLoad:e=>{g(e.currentTarget,u,x,b,v,m,j)},onError:e=>{w(!0),"empty"!==u&&v(!0),_&&_(e)}})});function b({isAppRouter:e,imgAttributes:t}){let s={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...y(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,s),null):(0,n.jsx)(l.default,{children:(0,n.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...s},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,i.forwardRef)((e,t)=>{let s=(0,i.useContext)(h.RouterContext),r=(0,i.useContext)(u.ImageConfigContext),a=(0,i.useMemo)(()=>{let e=f||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),s=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:s,qualities:a,localPatterns:"u"{p.current=o},[o]);let g=(0,i.useRef)(l);(0,i.useEffect)(()=>{g.current=l},[l]);let[y,v]=(0,i.useState)(!1),[w,j]=(0,i.useState)(!1),{props:S,meta:_}=(0,c.getImgProps)(e,{defaultLoader:m.default,imgConf:a,blurComplete:y,showAltText:w});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x,{...S,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:v,setShowAltText:j,sizesInput:e.sizes,ref:t}),_.preload?(0,n.jsx)(b,{isAppRouter:!s,imgAttributes:S}):null]})});("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},794909,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return d},getImageProps:function(){return c}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let n=e.r(563141),i=e.r(908927),o=e.r(605500),l=n._(e.r(1948));function c(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let d=o.Image},657688,(e,t,s)=>{t.exports=e.r(794909)},220486,761793,964421,91500,843153,152401,e=>{"use strict";var t=e.i(843476),s=e.i(218129),r=e.i(132104),a=e.i(447593),n=e.i(245094),i=e.i(210612),o=e.i(955135),l=e.i(827252),c=e.i(438957),d=e.i(596239),u=e.i(56456),h=e.i(124608),m=e.i(983561),p=e.i(602073),f=e.i(313603),g=e.i(782273),y=e.i(232164),x=e.i(366308),b=e.i(304967),v=e.i(599724),w=e.i(779241),j=e.i(629569),S=e.i(994388),_=e.i(464571),N=e.i(311451),k=e.i(212931),E=e.i(282786),C=e.i(199133),T=e.i(482725),A=e.i(592968),P=e.i(898586),O=e.i(515831),R=e.i(271645),I=e.i(650056),M=e.i(219470),L=e.i(422233),$=e.i(891547),U=e.i(921511),D=e.i(235267),B=e.i(611052),q=e.i(727749),W=e.i(764205),z=e.i(318059),H=e.i(916940),F=e.i(953860),J=e.i(434788),G=e.i(512882),V=e.i(584976),K=e.i(254530),X=e.i(720762),Y=e.i(921687),Q=e.i(689020);e.i(247167);var Z=e.i(356449);async function ee(e,t,s,r,a,n,i,o){console.log=function(){},console.log("isLocal:",!1);let l=o||(0,W.getProxyBaseUrl)(),c=new Z.default.OpenAI({apiKey:a,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&q.default.success(`Successfully processed ${n.length} images`)}catch(e){if(console.error("Error making image edit request:",e),i?.aborted)console.log("Image edits request was cancelled");else{let t="Failed to edit image(s)";e?.error?.message?t=e.error.message:e?.message&&(t=e.message),q.default.fromBackend(`Image edit failed: ${t}`)}throw e}}async function et(e,t,s,r,a,n,i){console.log=function(){},console.log("isLocal:",!1);let o=i||(0,W.getProxyBaseUrl)(),l=new Z.default.OpenAI({apiKey:r,baseURL:o,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let r=await l.images.generate({model:s,prompt:e},{signal:n});if(console.log(r.data),r.data&&r.data[0])if(r.data[0].url)t(r.data[0].url,s);else if(r.data[0].b64_json){let e=r.data[0].b64_json;t(`data:image/png;base64,${e}`,s)}else throw Error("No image data found in response");else throw Error("Invalid response format")}catch(e){throw n?.aborted?console.log("Image generation request was cancelled"):q.default.fromBackend(`Error occurred while generating image. Please try again. Error: ${e}`),e}}var es=e.i(452598),er=e.i(536916),ea=e.i(28651),en=e.i(850627);let ei=({temperature:e=1,maxTokens:s=2048,useAdvancedParams:r,onTemperatureChange:a,onMaxTokensChange:n,onUseAdvancedParamsChange:i,mockTestFallbacks:o,onMockTestFallbacksChange:c})=>{let[d,u]=(0,R.useState)(!1),h=void 0!==r?r:d,[m,p]=(0,R.useState)(e),[f,g]=(0,R.useState)(s);(0,R.useEffect)(()=>{p(e)},[e]),(0,R.useEffect)(()=>{g(s)},[s]);let y=e=>{let t=e??1;p(t),a?.(t)},x=e=>{let t=e??1e3;g(t),n?.(t)},b=h?"text-gray-700":"text-gray-400";return(0,t.jsxs)("div",{className:"space-y-4 p-4 w-80",children:[(0,t.jsx)(er.Checkbox,{checked:h,onChange:e=>{var t;return t=e.target.checked,void(i?i(t):u(t))},children:(0,t.jsx)("span",{className:"font-medium",children:"Use Advanced Parameters"})}),c&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(er.Checkbox,{checked:o??!1,onChange:e=>c(e.target.checked),children:(0,t.jsx)("span",{className:"font-medium",children:"Simulate failure to test fallbacks"})}),(0,t.jsx)(E.Popover,{trigger:"hover",placement:"right",content:(0,t.jsxs)("div",{style:{maxWidth:340},children:[(0,t.jsx)(P.Typography.Paragraph,{className:"text-sm",style:{marginBottom:8},children:"Causes the first request to fail so the router tries fallbacks (if configured). Use this to verify your fallback setup."}),(0,t.jsxs)(P.Typography.Paragraph,{className:"text-sm",style:{marginBottom:0},children:["Behavior can differ when keys, teams, or router settings are configured."," ",(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/keys_teams_router_settings",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Learn more"})]})]}),children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-xs text-gray-400 cursor-pointer shrink-0 hover:text-gray-600","aria-label":"Help: Simulate failure to test fallbacks"})})]}),(0,t.jsxs)("div",{className:"space-y-4 transition-opacity duration-200",style:{opacity:h?1:.4},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(v.Text,{className:`text-sm ${b}`,children:"Temperature"}),(0,t.jsx)(A.Tooltip,{title:"Controls randomness. Lower values make output more deterministic, higher values more creative.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:`text-xs ${b} cursor-help`})})]}),(0,t.jsx)(ea.InputNumber,{min:0,max:2,step:.1,value:m,onChange:y,disabled:!h,precision:1,className:"w-20"})]}),(0,t.jsx)(en.Slider,{min:0,max:2,step:.1,value:m,onChange:y,disabled:!h,marks:{0:"0",1:"1.0",2:"2.0"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(v.Text,{className:`text-sm ${b}`,children:"Max Tokens"}),(0,t.jsx)(A.Tooltip,{title:"Maximum number of tokens to generate in the response.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:`text-xs ${b} cursor-help`})})]}),(0,t.jsx)(ea.InputNumber,{min:1,max:32768,step:1,value:f,onChange:x,disabled:!h})]}),(0,t.jsx)(en.Slider,{min:1,max:32768,step:1,value:f,onChange:x,disabled:!h,marks:{1:"1",32768:"32768"}})]})]})]})};var eo=e.i(785913);let el={ALLOY:"Alloy - Professional and confident",ASH:"Ash - Casual and relaxed",BALAD:"Ballad - Smooth and melodic",CORAL:"Coral - Warm and engaging",ECHO:"Echo - Friendly and conversational",FABLE:"Fable - Wise and measured",NOVA:"Nova - Friendly and conversational",ONYX:"Onyx - Deep and authoritative",SAGE:"Sage - Wise and measured",SHIMMER:"Shimmer - Bright and cheerful"},ec=Object.entries({ALLOY:"alloy",ASH:"ash",BALAD:"ballad",CORAL:"coral",ECHO:"echo",FABLE:"fable",NOVA:"nova",ONYX:"onyx",SAGE:"sage",SHIMMER:"shimmer"}).map(([e,t])=>({value:t,label:el[e]})),ed=[{value:eo.EndpointType.CHAT,label:"/v1/chat/completions"},{value:eo.EndpointType.RESPONSES,label:"/v1/responses"},{value:eo.EndpointType.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:eo.EndpointType.IMAGE,label:"/v1/images/generations"},{value:eo.EndpointType.IMAGE_EDITS,label:"/v1/images/edits"},{value:eo.EndpointType.EMBEDDINGS,label:"/v1/embeddings"},{value:eo.EndpointType.SPEECH,label:"/v1/audio/speech"},{value:eo.EndpointType.TRANSCRIPTION,label:"/v1/audio/transcriptions"},{value:eo.EndpointType.A2A_AGENTS,label:"/v1/a2a/message/send"},{value:eo.EndpointType.MCP,label:"/mcp-rest/tools/call"},{value:eo.EndpointType.REALTIME,label:"/v1/realtime"}];var eu=e.i(955719),eu=eu;let{Dragger:eh}=O.Upload,em=({chatUploadedImage:e,chatImagePreviewUrl:s,onImageUpload:r,onRemoveImage:a})=>(0,t.jsx)(t.Fragment,{children:!e&&(0,t.jsx)(eh,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,t.jsx)(A.Tooltip,{title:"Attach image or PDF",children:(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,t.jsx)(eu.default,{style:{fontSize:"16px"}})})})})});e.s(["default",0,em],761793);let ep=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await new Promise((e,s)=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.onerror=s,r.readAsDataURL(t)})}}]}),ef=(e,t,s,r)=>{let a="";t&&r&&(a=r.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?`${e} ${a}`:e};return t&&s&&(n.imagePreviewUrl=s),n},eg=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;e.s(["createChatDisplayMessage",0,ef,"createChatMultimodalMessage",0,ep,"shouldShowChatAttachedImage",0,eg],964421);var ey=e.i(790848),ex=e.i(888259),eb=e.i(270377);let ev=({enabled:e,onEnabledChange:s,selectedModel:r,disabled:a=!1})=>{let i=(e=>{if(!e)return!1;let t=e.toLowerCase();return t.startsWith("openai/")||t.startsWith("gpt-")||t.startsWith("o1")||t.startsWith("o3")||t.includes("openai")})(r);return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-3 bg-gradient-to-r from-blue-50 to-purple-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.CodeOutlined,{className:"text-blue-500"}),(0,t.jsx)(v.Text,{className:"font-medium text-gray-700",children:"Code Interpreter"}),(0,t.jsx)(A.Tooltip,{title:"Run Python code to generate files, charts, and analyze data. Container is created automatically.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400 text-xs"})})]}),(0,t.jsx)(ey.Switch,{checked:e&&i,onChange:e=>{e&&!i?ex.default.warning("Code Interpreter is only available for OpenAI models"):s(e)},disabled:a||!i,size:"small",className:e&&i?"bg-blue-500":""})]}),!i&&(0,t.jsx)("div",{className:"mt-2 pt-2 border-t border-gray-200",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eb.ExclamationCircleOutlined,{className:"text-amber-500 mt-0.5"}),(0,t.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,t.jsx)("span",{children:"Code Interpreter is currently only supported for OpenAI models. "}),(0,t.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new?template=feature_request.yml",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Request support for other providers"})]})]})})]})};var ew=e.i(190272);let ej=({endpointType:e,onEndpointChange:s,className:r})=>(0,t.jsx)("div",{className:r,children:(0,t.jsx)(C.Select,{showSearch:!0,value:e,style:{width:"100%"},onChange:s,options:ed,className:"rounded-md",filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())||(t?.value??"").toLowerCase().includes(e.toLowerCase())})});var eS=e.i(931067);let e_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.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 42h216v494z"}}]},name:"file-pdf",theme:"outlined"};var eN=e.i(9583),ek=R.forwardRef(function(e,t){return R.createElement(eN.default,(0,eS.default)({},e,{ref:t,icon:e_}))});e.s(["FilePdfOutlined",0,ek],91500);let eE=function({file:e,previewUrl:s,onRemove:r}){let a=e.name.toLowerCase().endsWith(".pdf");return(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsx)("div",{className:"relative inline-block",children:a?(0,t.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,t.jsx)(ek,{style:{fontSize:"16px",color:"white"}})}):(0,t.jsx)("img",{src:s||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e.name}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:a?"PDF":"Image"})]}),(0,t.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:r,children:(0,t.jsx)(o.DeleteOutlined,{style:{fontSize:"12px"}})})]})})};var eC=e.i(771674),eT=e.i(918789),eA=e.i(245704),eP=e.i(637235),eO=e.i(166406),eR=e.i(755151),eI=e.i(240647),eM=e.i(993914);let eL=(e,t=8)=>e?e.length>t?`${e.substring(0,t)}…`:e:null,e$=e=>{navigator.clipboard.writeText(e)},eU=({a2aMetadata:e,timeToFirstToken:s,totalLatency:r})=>{let[a,n]=(0,R.useState)(!1);if(!e&&!s&&!r)return null;let{taskId:i,contextId:o,status:l,metadata:c}=e||{},h=(e=>{if(!e)return null;try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return e}})(l?.timestamp);return(0,t.jsxs)("div",{className:"a2a-metrics mt-3 pt-2 border-t border-gray-200 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 text-gray-600",children:[(0,t.jsx)(m.RobotOutlined,{className:"mr-1.5 text-blue-500"}),(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"A2A Metadata"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-gray-500 ml-4",children:[l?.state&&(0,t.jsxs)("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${(e=>{switch(e){case"completed":return"bg-green-100 text-green-700";case"working":case"submitted":return"bg-blue-100 text-blue-700";case"failed":case"canceled":return"bg-red-100 text-red-700";default:return"bg-gray-100 text-gray-700"}})(l.state)}`,children:[(e=>{switch(e){case"completed":return(0,t.jsx)(eA.CheckCircleOutlined,{className:"text-green-500"});case"working":case"submitted":return(0,t.jsx)(u.LoadingOutlined,{className:"text-blue-500"});case"failed":case"canceled":return(0,t.jsx)(eb.ExclamationCircleOutlined,{className:"text-red-500"});default:return(0,t.jsx)(eP.ClockCircleOutlined,{className:"text-gray-500"})}})(l.state),(0,t.jsx)("span",{className:"ml-1 capitalize",children:l.state})]}),h&&(0,t.jsx)(A.Tooltip,{title:l?.timestamp,children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)(eP.ClockCircleOutlined,{className:"mr-1"}),h]})}),void 0!==r&&(0,t.jsx)(A.Tooltip,{title:"Total latency",children:(0,t.jsxs)("span",{className:"flex items-center text-blue-600",children:[(0,t.jsx)(eP.ClockCircleOutlined,{className:"mr-1"}),(r/1e3).toFixed(2),"s"]})}),void 0!==s&&(0,t.jsx)(A.Tooltip,{title:"Time to first token",children:(0,t.jsxs)("span",{className:"flex items-center text-green-600",children:["TTFT: ",(s/1e3).toFixed(2),"s"]})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-gray-500 ml-4 mt-1.5",children:[i&&(0,t.jsx)(A.Tooltip,{title:`Click to copy: ${i}`,children:(0,t.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>e$(i),children:[(0,t.jsx)(eM.FileTextOutlined,{className:"mr-1"}),"Task: ",eL(i),(0,t.jsx)(eO.CopyOutlined,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),o&&(0,t.jsx)(A.Tooltip,{title:`Click to copy: ${o}`,children:(0,t.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>e$(o),children:[(0,t.jsx)(d.LinkOutlined,{className:"mr-1"}),"Session: ",eL(o),(0,t.jsx)(eO.CopyOutlined,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),(c||l?.message)&&(0,t.jsxs)(_.Button,{type:"text",size:"small",className:"text-xs text-blue-500 hover:text-blue-700 p-0 h-auto",onClick:()=>n(!a),children:[a?(0,t.jsx)(eR.DownOutlined,{}):(0,t.jsx)(eI.RightOutlined,{}),(0,t.jsx)("span",{className:"ml-1",children:"Details"})]})]}),a&&(0,t.jsxs)("div",{className:"mt-2 ml-4 p-3 bg-gray-50 rounded-md text-gray-600 border border-gray-200",children:[l?.message&&(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Status Message:"}),(0,t.jsx)("span",{className:"ml-2",children:l.message})]}),i&&(0,t.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Task ID:"}),(0,t.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:i}),(0,t.jsx)(eO.CopyOutlined,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>e$(i)})]}),o&&(0,t.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Session ID:"}),(0,t.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:o}),(0,t.jsx)(eO.CopyOutlined,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>e$(o)})]}),c&&Object.keys(c).length>0&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Custom Metadata:"}),(0,t.jsx)("pre",{className:"mt-1.5 p-2 bg-white border border-gray-200 rounded text-xs font-mono overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(c,null,2)})]})]})]})},eD=({message:e})=>e.isAudio&&"string"==typeof e.content?(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsx)("audio",{controls:!0,src:e.content,className:"max-w-full",style:{maxWidth:"500px"},children:"Your browser does not support the audio element."})}):null;var eB=e.i(657688);let eq=({message:e})=>{if(!eg(e))return null;let s="string"==typeof e.content&&e.content.includes("[PDF attached]");return(0,t.jsx)("div",{className:"mb-2",children:s?(0,t.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,t.jsx)(ek,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,t.jsx)(eB.default,{src:e.imagePreviewUrl||"",alt:"User uploaded image",width:256,height:200,className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px",width:"auto",height:"auto"}})})};e.s(["default",0,eq],843153);var eW=e.i(362024),ez=e.i(737434);let eH={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.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 42h216v494z"}}]},name:"file-image",theme:"outlined"};var eF=R.forwardRef(function(e,t){return R.createElement(eN.default,(0,eS.default)({},e,{ref:t,icon:eH}))});let eJ=({code:e,containerId:s,annotations:r=[],accessToken:a})=>{let[i,o]=(0,R.useState)({}),[l,c]=(0,R.useState)({}),d=(0,W.getProxyBaseUrl)();(0,R.useEffect)(()=>{let e=async()=>{for(let e of r)if((e.filename?.toLowerCase().endsWith(".png")||e.filename?.toLowerCase().endsWith(".jpg")||e.filename?.toLowerCase().endsWith(".jpeg")||e.filename?.toLowerCase().endsWith(".gif"))&&e.container_id&&e.file_id){c(t=>({...t,[e.file_id]:!0}));try{let t=await fetch(`${d}/v1/containers/${e.container_id}/files/${e.file_id}/content`,{headers:{[(0,W.getGlobalLitellmHeaderName)()]:`Bearer ${a}`}});if(t.ok){let s=await t.blob(),r=URL.createObjectURL(s);o(t=>({...t,[e.file_id]:r}))}}catch(e){console.error("Error fetching image:",e)}finally{c(t=>({...t,[e.file_id]:!1}))}}};return r.length>0&&a&&e(),()=>{Object.values(i).forEach(e=>URL.revokeObjectURL(e))}},[r,a,d]);let h=async e=>{try{let t=await fetch(`${d}/v1/containers/${e.container_id}/files/${e.file_id}/content`,{headers:{[(0,W.getGlobalLitellmHeaderName)()]:`Bearer ${a}`}});if(t.ok){let s=await t.blob(),r=URL.createObjectURL(s),a=document.createElement("a");a.href=r,a.download=e.filename||`file_${e.file_id}`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}}catch(e){console.error("Error downloading file:",e)}},m=r.filter(e=>e.filename?.toLowerCase().endsWith(".png")||e.filename?.toLowerCase().endsWith(".jpg")||e.filename?.toLowerCase().endsWith(".jpeg")||e.filename?.toLowerCase().endsWith(".gif")),p=r.filter(e=>!e.filename?.toLowerCase().endsWith(".png")&&!e.filename?.toLowerCase().endsWith(".jpg")&&!e.filename?.toLowerCase().endsWith(".jpeg")&&!e.filename?.toLowerCase().endsWith(".gif"));return e||0!==r.length?(0,t.jsxs)("div",{className:"mt-3 space-y-3",children:[e&&(0,t.jsx)(eW.Collapse,{size:"small",items:[{key:"code",label:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-600",children:[(0,t.jsx)(n.CodeOutlined,{})," Python Code Executed"]}),children:(0,t.jsx)(I.Prism,{language:"python",style:M.coy,customStyle:{margin:0,borderRadius:"6px",fontSize:"12px",maxHeight:"300px",overflow:"auto"},children:e})}]}),m.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-gray-200 overflow-hidden",children:l[e.file_id]?(0,t.jsxs)("div",{className:"flex items-center justify-center p-8 bg-gray-50",children:[(0,t.jsx)(T.Spin,{indicator:(0,t.jsx)(u.LoadingOutlined,{spin:!0})}),(0,t.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:"Loading image..."})]}):i[e.file_id]?(0,t.jsxs)("div",{children:[(0,t.jsx)("img",{src:i[e.file_id],alt:e.filename||"Generated chart",className:"max-w-full",style:{maxHeight:"400px"}}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-50 border-t border-gray-200",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,t.jsx)(eF,{})," ",e.filename]}),(0,t.jsxs)("button",{onClick:()=>h(e),className:"text-xs text-blue-500 hover:text-blue-700 flex items-center gap-1",children:[(0,t.jsx)(ez.DownloadOutlined,{})," Download"]})]})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-4 bg-gray-50",children:(0,t.jsx)("span",{className:"text-sm text-gray-400",children:"Image not available"})})},e.file_id)),p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:p.map(e=>(0,t.jsxs)("button",{onClick:()=>h(e),className:"flex items-center gap-2 px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg hover:bg-gray-100 transition-colors",children:[(0,t.jsx)(eM.FileTextOutlined,{className:"text-blue-500"}),(0,t.jsx)("span",{className:"text-sm",children:e.filename}),(0,t.jsx)(ez.DownloadOutlined,{className:"text-gray-400"})]},e.file_id))})]}):null};var eG=e.i(355343),eV=e.i(966988),eK=e.i(989022);let eX=async(e,t)=>{let s=await new Promise((e,s)=>{let r=new FileReader;r.onload=()=>{e(r.result.split(",")[1])},r.onerror=s,r.readAsDataURL(t)}),r=t.type||(t.name.toLowerCase().endsWith(".pdf")?"application/pdf":"image/jpeg");return{role:"user",content:[{type:"input_text",text:e},{type:"input_image",image_url:`data:${r};base64,${s}`}]}},eY=(e,t,s,r)=>{let a="";t&&r&&(a=r.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?`${e} ${a}`:e};return t&&s&&(n.imagePreviewUrl=s),n},eQ=({message:e})=>{if(!("user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&e.imagePreviewUrl))return null;let s="string"==typeof e.content&&e.content.includes("[PDF attached]");return(0,t.jsx)("div",{className:"mb-2",children:s?(0,t.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,t.jsx)(ek,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,t.jsx)("img",{src:e.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})};function eZ({searchResults:e}){let[s,r]=(0,R.useState)(!0),[a,n]=(0,R.useState)({});if(!e||0===e.length)return null;let o=e.reduce((e,t)=>e+t.data.length,0);return(0,t.jsxs)("div",{className:"search-results-content mt-1 mb-2",children:[(0,t.jsxs)(_.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>r(!s),icon:(0,t.jsx)(i.DatabaseOutlined,{}),children:[s?"Hide sources":`Show sources (${o})`,s?(0,t.jsx)(eR.DownOutlined,{className:"ml-1"}):(0,t.jsx)(eI.RightOutlined,{className:"ml-1"})]}),s&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm",children:(0,t.jsx)("div",{className:"space-y-3",children:e.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs text-gray-600 mb-2 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:"Query:"}),(0,t.jsxs)("span",{className:"italic",children:['"',e.search_query,'"']}),(0,t.jsx)("span",{className:"text-gray-400",children:"•"}),(0,t.jsxs)("span",{className:"text-gray-500",children:[e.data.length," result",1!==e.data.length?"s":""]})]}),(0,t.jsx)("div",{className:"space-y-2",children:e.data.map((e,r)=>{let i=a[`${s}-${r}`]||!1;return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-md overflow-hidden bg-white",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-2 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>{let e;return e=`${s}-${r}`,void n(t=>({...t,[e]:!t[e]}))},children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,t.jsx)("svg",{className:`w-4 h-4 text-gray-400 transition-transform flex-shrink-0 ${i?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)(eM.FileTextOutlined,{className:"text-gray-400 flex-shrink-0",style:{fontSize:"12px"}}),(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 truncate",children:e.filename||e.file_id||`Result ${r+1}`}),(0,t.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-blue-100 text-blue-700 font-mono flex-shrink-0",children:e.score.toFixed(3)})]})}),i&&(0,t.jsx)("div",{className:"border-t border-gray-200 bg-white",children:(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[e.content.map((e,s)=>(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:"text-xs font-mono bg-gray-50 p-2 rounded text-gray-800 whitespace-pre-wrap break-words",children:e.text})},s)),e.attributes&&Object.keys(e.attributes).length>0&&(0,t.jsxs)("div",{className:"mt-2 pt-2 border-t border-gray-100",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Metadata:"}),(0,t.jsx)("div",{className:"space-y-1",children:Object.entries(e.attributes).map(([e,s])=>(0,t.jsxs)("div",{className:"text-xs flex gap-2",children:[(0,t.jsxs)("span",{className:"text-gray-500 font-medium",children:[e,":"]}),(0,t.jsx)("span",{className:"text-gray-700 font-mono break-all",children:String(s)})]},e))})]})]})})]},r)})})]},s))})})]})}e.s(["SearchResultsDisplay",()=>eZ],152401);let e0=function({message:e,isLastMessage:s,endpointType:r,mcpEvents:a,codeInterpreterResult:n,accessToken:i}){let o="user"===e.role;return(0,t.jsx)("div",{className:`mb-4 ${o?"text-right":"text-left"}`,children:(0,t.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:o?"#f0f8ff":"#ffffff",border:o?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:o?"#e6f0fa":"#f5f5f5"},children:o?(0,t.jsx)(eC.UserOutlined,{style:{fontSize:"12px",color:"#2563eb"}}):(0,t.jsx)(m.RobotOutlined,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,t.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,t.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,t.jsx)(eV.default,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&s&&a.length>0&&(r===eo.EndpointType.RESPONSES||r===eo.EndpointType.CHAT)&&(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)(eG.default,{events:a})}),"assistant"===e.role&&e.searchResults&&(0,t.jsx)(eZ,{searchResults:e.searchResults}),"assistant"===e.role&&s&&n&&r===eo.EndpointType.RESPONSES&&(0,t.jsx)(eJ,{code:n.code,containerId:n.containerId,annotations:n.annotations,accessToken:i}),(0,t.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,t.jsx)("img",{src:"string"==typeof e.content?e.content:"",alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):e.isAudio?(0,t.jsx)(eD,{message:e}):(0,t.jsxs)(t.Fragment,{children:[r===eo.EndpointType.RESPONSES&&(0,t.jsx)(eQ,{message:e}),r===eo.EndpointType.CHAT&&(0,t.jsx)(eq,{message:e}),(0,t.jsx)(eT.default,{components:{code({node:e,inline:s,className:r,children:a,...n}){let i=/language-(\w+)/.exec(r||"");return!s&&i?(0,t.jsx)(I.Prism,{style:M.coy,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...n,children:String(a).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${r} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,style:{wordBreak:"break-word"},...n,children:a})},pre:({node:e,...s})=>(0,t.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})},children:"string"==typeof e.content?e.content:""}),e.image&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)("img",{src:e.image.url,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}})})]}),"assistant"===e.role&&(e.timeToFirstToken||e.totalLatency||e.usage)&&!e.a2aMetadata&&(0,t.jsx)(eK.default,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage,toolName:e.toolName}),"assistant"===e.role&&e.a2aMetadata&&(0,t.jsx)(eU,{a2aMetadata:e.a2aMetadata,timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency})]})]})})};var eu=eu;let{Dragger:e1}=O.Upload,e2=({responsesUploadedImage:e,responsesImagePreviewUrl:s,onImageUpload:r,onRemoveImage:a})=>(0,t.jsx)(t.Fragment,{children:!e&&(0,t.jsx)(e1,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,t.jsx)(A.Tooltip,{title:"Attach image or PDF",children:(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,t.jsx)(eu.default,{style:{fontSize:"16px"}})})})})}),e4=({endpointType:e,responsesSessionId:s,useApiSessionManagement:r,onToggleSessionManagement:a})=>e!==eo.EndpointType.RESPONSES?null:(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,t.jsx)(A.Tooltip,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,t.jsx)(ey.Switch,{checked:r,onChange:a,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,t.jsxs)("div",{className:`text-xs p-2 rounded-md ${s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(l.InfoCircleOutlined,{style:{fontSize:"12px"}}),(()=>{if(!s)return r?"API Session: Ready":"UI Session: Ready";let e=r?"Response ID":"UI Session",t=s.slice(0,10);return`${e}: ${t}...`})()]}),s&&(0,t.jsx)(A.Tooltip,{title:(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,t.jsx)("div",{className:"bg-gray-800 text-gray-100 p-2 rounded font-mono text-xs whitespace-pre-wrap",children:`curl -X POST "your-proxy-url/v1/responses" \\
+Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let i=(0,r.findClosestQuality)(n,e),o=(0,a.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${s}&q=${i}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}n.__next_img_default=!0;let i=n},605500,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"Image",{enumerable:!0,get:function(){return v}});let r=e.r(563141),a=e.r(151836),n=e.r(843476),i=a._(e.r(271645)),o=r._(e.r(174080)),l=r._(e.r(325633)),c=e.r(908927),d=e.r(987690),u=e.r(918556);e.r(233525);let h=e.r(65856),m=r._(e.r(1948)),p=e.r(818581),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function g(e,t,s,r,a,n,i){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),s?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,a=!1;s.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function y(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"{let E=(0,i.useCallback)(e=>{e&&(_&&(e.src=e.src),e.complete&&g(e,u,x,b,v,m,j))},[e,u,x,b,v,_,m,j]),C=(0,p.useMergedRef)(k,E);return(0,n.jsx)("img",{...N,...y(d),loading:h,width:a,height:r,decoding:o,"data-nimg":f?"fill":"1",className:l,style:c,sizes:s,srcSet:t,src:e,ref:C,onLoad:e=>{g(e.currentTarget,u,x,b,v,m,j)},onError:e=>{w(!0),"empty"!==u&&v(!0),_&&_(e)}})});function b({isAppRouter:e,imgAttributes:t}){let s={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...y(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,s),null):(0,n.jsx)(l.default,{children:(0,n.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...s},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,i.forwardRef)((e,t)=>{let s=(0,i.useContext)(h.RouterContext),r=(0,i.useContext)(u.ImageConfigContext),a=(0,i.useMemo)(()=>{let e=f||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),s=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:s,qualities:a,localPatterns:"u"{p.current=o},[o]);let g=(0,i.useRef)(l);(0,i.useEffect)(()=>{g.current=l},[l]);let[y,v]=(0,i.useState)(!1),[w,j]=(0,i.useState)(!1),{props:S,meta:_}=(0,c.getImgProps)(e,{defaultLoader:m.default,imgConf:a,blurComplete:y,showAltText:w});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x,{...S,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:v,setShowAltText:j,sizesInput:e.sizes,ref:t}),_.preload?(0,n.jsx)(b,{isAppRouter:!s,imgAttributes:S}):null]})});("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},794909,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return d},getImageProps:function(){return c}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let n=e.r(563141),i=e.r(908927),o=e.r(605500),l=n._(e.r(1948));function c(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let d=o.Image},657688,(e,t,s)=>{t.exports=e.r(794909)},220486,761793,964421,91500,843153,152401,e=>{"use strict";var t=e.i(843476),s=e.i(218129),r=e.i(132104),a=e.i(447593),n=e.i(245094),i=e.i(210612),o=e.i(955135),l=e.i(827252),c=e.i(438957),d=e.i(596239),u=e.i(56456),h=e.i(124608),m=e.i(983561),p=e.i(602073),f=e.i(313603),g=e.i(782273),y=e.i(232164),x=e.i(366308),b=e.i(304967),v=e.i(599724),w=e.i(779241),j=e.i(629569),S=e.i(994388),_=e.i(464571),N=e.i(311451),k=e.i(212931),E=e.i(282786),C=e.i(199133),T=e.i(482725),A=e.i(592968),P=e.i(898586),O=e.i(515831),R=e.i(271645),I=e.i(650056),M=e.i(219470),L=e.i(422233),$=e.i(891547),U=e.i(921511),D=e.i(235267),B=e.i(611052),q=e.i(727749),W=e.i(764205),z=e.i(318059),H=e.i(916940),F=e.i(953860),J=e.i(434788),G=e.i(512882),V=e.i(584976),K=e.i(254530),X=e.i(720762),Y=e.i(921687),Q=e.i(689020);e.i(247167);var Z=e.i(356449);async function ee(e,t,s,r,a,n,i,o){console.log=function(){},console.log("isLocal:",!1);let l=o||(0,W.getProxyBaseUrl)(),c=new Z.default.OpenAI({apiKey:a,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&q.default.success(`Successfully processed ${n.length} images`)}catch(e){if(console.error("Error making image edit request:",e),i?.aborted)console.log("Image edits request was cancelled");else{let t="Failed to edit image(s)";e?.error?.message?t=e.error.message:e?.message&&(t=e.message),q.default.fromBackend(`Image edit failed: ${t}`)}throw e}}async function et(e,t,s,r,a,n,i){console.log=function(){},console.log("isLocal:",!1);let o=i||(0,W.getProxyBaseUrl)(),l=new Z.default.OpenAI({apiKey:r,baseURL:o,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let r=await l.images.generate({model:s,prompt:e},{signal:n});if(console.log(r.data),r.data&&r.data[0])if(r.data[0].url)t(r.data[0].url,s);else if(r.data[0].b64_json){let e=r.data[0].b64_json;t(`data:image/png;base64,${e}`,s)}else throw Error("No image data found in response");else throw Error("Invalid response format")}catch(e){throw n?.aborted?console.log("Image generation request was cancelled"):q.default.fromBackend(`Error occurred while generating image. Please try again. Error: ${e}`),e}}var es=e.i(452598),er=e.i(536916),ea=e.i(28651),en=e.i(850627);let ei=({temperature:e=1,maxTokens:s=2048,useAdvancedParams:r,onTemperatureChange:a,onMaxTokensChange:n,onUseAdvancedParamsChange:i,mockTestFallbacks:o,onMockTestFallbacksChange:c})=>{let[d,u]=(0,R.useState)(!1),h=void 0!==r?r:d,[m,p]=(0,R.useState)(e),[f,g]=(0,R.useState)(s);(0,R.useEffect)(()=>{p(e)},[e]),(0,R.useEffect)(()=>{g(s)},[s]);let y=e=>{let t=e??1;p(t),a?.(t)},x=e=>{let t=e??1e3;g(t),n?.(t)},b=h?"text-gray-700":"text-gray-400";return(0,t.jsxs)("div",{className:"space-y-4 p-4 w-80",children:[(0,t.jsx)(er.Checkbox,{checked:h,onChange:e=>{var t;return t=e.target.checked,void(i?i(t):u(t))},children:(0,t.jsx)("span",{className:"font-medium",children:"Use Advanced Parameters"})}),c&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(er.Checkbox,{checked:o??!1,onChange:e=>c(e.target.checked),children:(0,t.jsx)("span",{className:"font-medium",children:"Simulate failure to test fallbacks"})}),(0,t.jsx)(E.Popover,{trigger:"hover",placement:"right",content:(0,t.jsxs)("div",{style:{maxWidth:340},children:[(0,t.jsx)(P.Typography.Paragraph,{className:"text-sm",style:{marginBottom:8},children:"Causes the first request to fail so the router tries fallbacks (if configured). Use this to verify your fallback setup."}),(0,t.jsxs)(P.Typography.Paragraph,{className:"text-sm",style:{marginBottom:0},children:["Behavior can differ when keys, teams, or router settings are configured."," ",(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/keys_teams_router_settings",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Learn more"})]})]}),children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-xs text-gray-400 cursor-pointer shrink-0 hover:text-gray-600","aria-label":"Help: Simulate failure to test fallbacks"})})]}),(0,t.jsxs)("div",{className:"space-y-4 transition-opacity duration-200",style:{opacity:h?1:.4},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(v.Text,{className:`text-sm ${b}`,children:"Temperature"}),(0,t.jsx)(A.Tooltip,{title:"Controls randomness. Lower values make output more deterministic, higher values more creative.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:`text-xs ${b} cursor-help`})})]}),(0,t.jsx)(ea.InputNumber,{min:0,max:2,step:.1,value:m,onChange:y,disabled:!h,precision:1,className:"w-20"})]}),(0,t.jsx)(en.Slider,{min:0,max:2,step:.1,value:m,onChange:y,disabled:!h,marks:{0:"0",1:"1.0",2:"2.0"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(v.Text,{className:`text-sm ${b}`,children:"Max Tokens"}),(0,t.jsx)(A.Tooltip,{title:"Maximum number of tokens to generate in the response.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:`text-xs ${b} cursor-help`})})]}),(0,t.jsx)(ea.InputNumber,{min:1,max:32768,step:1,value:f,onChange:x,disabled:!h})]}),(0,t.jsx)(en.Slider,{min:1,max:32768,step:1,value:f,onChange:x,disabled:!h,marks:{1:"1",32768:"32768"}})]})]})]})};var eo=e.i(785913);let el={ALLOY:"Alloy - Professional and confident",ASH:"Ash - Casual and relaxed",BALAD:"Ballad - Smooth and melodic",CORAL:"Coral - Warm and engaging",ECHO:"Echo - Friendly and conversational",FABLE:"Fable - Wise and measured",NOVA:"Nova - Friendly and conversational",ONYX:"Onyx - Deep and authoritative",SAGE:"Sage - Wise and measured",SHIMMER:"Shimmer - Bright and cheerful"},ec=Object.entries({ALLOY:"alloy",ASH:"ash",BALAD:"ballad",CORAL:"coral",ECHO:"echo",FABLE:"fable",NOVA:"nova",ONYX:"onyx",SAGE:"sage",SHIMMER:"shimmer"}).map(([e,t])=>({value:t,label:el[e]})),ed=[{value:eo.EndpointType.CHAT,label:"/v1/chat/completions"},{value:eo.EndpointType.RESPONSES,label:"/v1/responses"},{value:eo.EndpointType.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:eo.EndpointType.IMAGE,label:"/v1/images/generations"},{value:eo.EndpointType.IMAGE_EDITS,label:"/v1/images/edits"},{value:eo.EndpointType.EMBEDDINGS,label:"/v1/embeddings"},{value:eo.EndpointType.SPEECH,label:"/v1/audio/speech"},{value:eo.EndpointType.TRANSCRIPTION,label:"/v1/audio/transcriptions"},{value:eo.EndpointType.A2A_AGENTS,label:"/v1/a2a/message/send"},{value:eo.EndpointType.MCP,label:"/mcp-rest/tools/call"},{value:eo.EndpointType.REALTIME,label:"/v1/realtime"}];var eu=e.i(955719),eu=eu;let{Dragger:eh}=O.Upload,em=({chatUploadedImage:e,chatImagePreviewUrl:s,onImageUpload:r,onRemoveImage:a})=>(0,t.jsx)(t.Fragment,{children:!e&&(0,t.jsx)(eh,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,t.jsx)(A.Tooltip,{title:"Attach image or PDF",children:(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,t.jsx)(eu.default,{style:{fontSize:"16px"}})})})})});e.s(["default",0,em],761793);let ep=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await new Promise((e,s)=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.onerror=s,r.readAsDataURL(t)})}}]}),ef=(e,t,s,r)=>{let a="";t&&r&&(a=r.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?`${e} ${a}`:e};return t&&s&&(n.imagePreviewUrl=s),n},eg=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;e.s(["createChatDisplayMessage",0,ef,"createChatMultimodalMessage",0,ep,"shouldShowChatAttachedImage",0,eg],964421);var ey=e.i(790848),ex=e.i(888259),eb=e.i(270377);let ev=({enabled:e,onEnabledChange:s,selectedModel:r,disabled:a=!1})=>{let i=(e=>{if(!e)return!1;let t=e.toLowerCase();return t.startsWith("openai/")||t.startsWith("gpt-")||t.startsWith("o1")||t.startsWith("o3")||t.includes("openai")})(r);return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-3 bg-gradient-to-r from-blue-50 to-purple-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.CodeOutlined,{className:"text-blue-500"}),(0,t.jsx)(v.Text,{className:"font-medium text-gray-700",children:"Code Interpreter"}),(0,t.jsx)(A.Tooltip,{title:"Run Python code to generate files, charts, and analyze data. Container is created automatically.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400 text-xs"})})]}),(0,t.jsx)(ey.Switch,{checked:e&&i,onChange:e=>{e&&!i?ex.default.warning("Code Interpreter is only available for OpenAI models"):s(e)},disabled:a||!i,size:"small",className:e&&i?"bg-blue-500":""})]}),!i&&(0,t.jsx)("div",{className:"mt-2 pt-2 border-t border-gray-200",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eb.ExclamationCircleOutlined,{className:"text-amber-500 mt-0.5"}),(0,t.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,t.jsx)("span",{children:"Code Interpreter is currently only supported for OpenAI models. "}),(0,t.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new?template=feature_request.yml",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Request support for other providers"})]})]})})]})};var ew=e.i(190272);let ej=({endpointType:e,onEndpointChange:s,className:r})=>(0,t.jsx)("div",{className:r,children:(0,t.jsx)(C.Select,{showSearch:!0,value:e,style:{width:"100%"},onChange:s,options:ed,className:"rounded-md",filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())||(t?.value??"").toLowerCase().includes(e.toLowerCase())})});var eS=e.i(931067);let e_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.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 42h216v494z"}}]},name:"file-pdf",theme:"outlined"};var eN=e.i(9583),ek=R.forwardRef(function(e,t){return R.createElement(eN.default,(0,eS.default)({},e,{ref:t,icon:e_}))});e.s(["FilePdfOutlined",0,ek],91500);let eE=function({file:e,previewUrl:s,onRemove:r}){let a=e.name.toLowerCase().endsWith(".pdf");return(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsx)("div",{className:"relative inline-block",children:a?(0,t.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,t.jsx)(ek,{style:{fontSize:"16px",color:"white"}})}):(0,t.jsx)("img",{src:s||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:e.name}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:a?"PDF":"Image"})]}),(0,t.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:r,children:(0,t.jsx)(o.DeleteOutlined,{style:{fontSize:"12px"}})})]})})};var eC=e.i(771674),eT=e.i(918789),eA=e.i(245704),eP=e.i(637235),eO=e.i(166406),eR=e.i(755151),eI=e.i(240647),eM=e.i(993914);let eL=(e,t=8)=>e?e.length>t?`${e.substring(0,t)}…`:e:null,e$=e=>{navigator.clipboard.writeText(e)},eU=({a2aMetadata:e,timeToFirstToken:s,totalLatency:r})=>{let[a,n]=(0,R.useState)(!1);if(!e&&!s&&!r)return null;let{taskId:i,contextId:o,status:l,metadata:c}=e||{},h=(e=>{if(!e)return null;try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return e}})(l?.timestamp);return(0,t.jsxs)("div",{className:"a2a-metrics mt-3 pt-2 border-t border-gray-200 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 text-gray-600",children:[(0,t.jsx)(m.RobotOutlined,{className:"mr-1.5 text-blue-500"}),(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"A2A Metadata"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-gray-500 ml-4",children:[l?.state&&(0,t.jsxs)("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${(e=>{switch(e){case"completed":return"bg-green-100 text-green-700";case"working":case"submitted":return"bg-blue-100 text-blue-700";case"failed":case"canceled":return"bg-red-100 text-red-700";default:return"bg-gray-100 text-gray-700"}})(l.state)}`,children:[(e=>{switch(e){case"completed":return(0,t.jsx)(eA.CheckCircleOutlined,{className:"text-green-500"});case"working":case"submitted":return(0,t.jsx)(u.LoadingOutlined,{className:"text-blue-500"});case"failed":case"canceled":return(0,t.jsx)(eb.ExclamationCircleOutlined,{className:"text-red-500"});default:return(0,t.jsx)(eP.ClockCircleOutlined,{className:"text-gray-500"})}})(l.state),(0,t.jsx)("span",{className:"ml-1 capitalize",children:l.state})]}),h&&(0,t.jsx)(A.Tooltip,{title:l?.timestamp,children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)(eP.ClockCircleOutlined,{className:"mr-1"}),h]})}),void 0!==r&&(0,t.jsx)(A.Tooltip,{title:"Total latency",children:(0,t.jsxs)("span",{className:"flex items-center text-blue-600",children:[(0,t.jsx)(eP.ClockCircleOutlined,{className:"mr-1"}),(r/1e3).toFixed(2),"s"]})}),void 0!==s&&(0,t.jsx)(A.Tooltip,{title:"Time to first token",children:(0,t.jsxs)("span",{className:"flex items-center text-green-600",children:["TTFT: ",(s/1e3).toFixed(2),"s"]})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-gray-500 ml-4 mt-1.5",children:[i&&(0,t.jsx)(A.Tooltip,{title:`Click to copy: ${i}`,children:(0,t.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>e$(i),children:[(0,t.jsx)(eM.FileTextOutlined,{className:"mr-1"}),"Task: ",eL(i),(0,t.jsx)(eO.CopyOutlined,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),o&&(0,t.jsx)(A.Tooltip,{title:`Click to copy: ${o}`,children:(0,t.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>e$(o),children:[(0,t.jsx)(d.LinkOutlined,{className:"mr-1"}),"Session: ",eL(o),(0,t.jsx)(eO.CopyOutlined,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),(c||l?.message)&&(0,t.jsxs)(_.Button,{type:"text",size:"small",className:"text-xs text-blue-500 hover:text-blue-700 p-0 h-auto",onClick:()=>n(!a),children:[a?(0,t.jsx)(eR.DownOutlined,{}):(0,t.jsx)(eI.RightOutlined,{}),(0,t.jsx)("span",{className:"ml-1",children:"Details"})]})]}),a&&(0,t.jsxs)("div",{className:"mt-2 ml-4 p-3 bg-gray-50 rounded-md text-gray-600 border border-gray-200",children:[l?.message&&(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Status Message:"}),(0,t.jsx)("span",{className:"ml-2",children:l.message})]}),i&&(0,t.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Task ID:"}),(0,t.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:i}),(0,t.jsx)(eO.CopyOutlined,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>e$(i)})]}),o&&(0,t.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Session ID:"}),(0,t.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:o}),(0,t.jsx)(eO.CopyOutlined,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>e$(o)})]}),c&&Object.keys(c).length>0&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("span",{className:"font-medium text-gray-700",children:"Custom Metadata:"}),(0,t.jsx)("pre",{className:"mt-1.5 p-2 bg-white border border-gray-200 rounded text-xs font-mono overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(c,null,2)})]})]})]})},eD=({message:e})=>e.isAudio&&"string"==typeof e.content?(0,t.jsx)("div",{className:"mb-2",children:(0,t.jsx)("audio",{controls:!0,src:e.content,className:"max-w-full",style:{maxWidth:"500px"},children:"Your browser does not support the audio element."})}):null;var eB=e.i(657688);let eq=({message:e})=>{if(!eg(e))return null;let s="string"==typeof e.content&&e.content.includes("[PDF attached]");return(0,t.jsx)("div",{className:"mb-2",children:s?(0,t.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,t.jsx)(ek,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,t.jsx)(eB.default,{src:e.imagePreviewUrl||"",alt:"User uploaded image",width:256,height:200,className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px",width:"auto",height:"auto"}})})};e.s(["default",0,eq],843153);var eW=e.i(362024),ez=e.i(737434);let eH={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.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 42h216v494z"}}]},name:"file-image",theme:"outlined"};var eF=R.forwardRef(function(e,t){return R.createElement(eN.default,(0,eS.default)({},e,{ref:t,icon:eH}))});let eJ=({code:e,containerId:s,annotations:r=[],accessToken:a})=>{let[i,o]=(0,R.useState)({}),[l,c]=(0,R.useState)({}),d=(0,W.getProxyBaseUrl)();(0,R.useEffect)(()=>{let e=async()=>{for(let e of r)if((e.filename?.toLowerCase().endsWith(".png")||e.filename?.toLowerCase().endsWith(".jpg")||e.filename?.toLowerCase().endsWith(".jpeg")||e.filename?.toLowerCase().endsWith(".gif"))&&e.container_id&&e.file_id){c(t=>({...t,[e.file_id]:!0}));try{let t=await fetch(`${d}/v1/containers/${e.container_id}/files/${e.file_id}/content`,{headers:{[(0,W.getGlobalLitellmHeaderName)()]:`Bearer ${a}`}});if(t.ok){let s=await t.blob(),r=URL.createObjectURL(s);o(t=>({...t,[e.file_id]:r}))}}catch(e){console.error("Error fetching image:",e)}finally{c(t=>({...t,[e.file_id]:!1}))}}};return r.length>0&&a&&e(),()=>{Object.values(i).forEach(e=>URL.revokeObjectURL(e))}},[r,a,d]);let h=async e=>{try{let t=await fetch(`${d}/v1/containers/${e.container_id}/files/${e.file_id}/content`,{headers:{[(0,W.getGlobalLitellmHeaderName)()]:`Bearer ${a}`}});if(t.ok){let s=await t.blob(),r=URL.createObjectURL(s),a=document.createElement("a");a.href=r,a.download=e.filename||`file_${e.file_id}`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}}catch(e){console.error("Error downloading file:",e)}},m=r.filter(e=>e.filename?.toLowerCase().endsWith(".png")||e.filename?.toLowerCase().endsWith(".jpg")||e.filename?.toLowerCase().endsWith(".jpeg")||e.filename?.toLowerCase().endsWith(".gif")),p=r.filter(e=>!e.filename?.toLowerCase().endsWith(".png")&&!e.filename?.toLowerCase().endsWith(".jpg")&&!e.filename?.toLowerCase().endsWith(".jpeg")&&!e.filename?.toLowerCase().endsWith(".gif"));return e||0!==r.length?(0,t.jsxs)("div",{className:"mt-3 space-y-3",children:[e&&(0,t.jsx)(eW.Collapse,{size:"small",items:[{key:"code",label:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-600",children:[(0,t.jsx)(n.CodeOutlined,{})," Python Code Executed"]}),children:(0,t.jsx)(I.Prism,{language:"python",style:M.coy,customStyle:{margin:0,borderRadius:"6px",fontSize:"12px",maxHeight:"300px",overflow:"auto"},children:e})}]}),m.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-gray-200 overflow-hidden",children:l[e.file_id]?(0,t.jsxs)("div",{className:"flex items-center justify-center p-8 bg-gray-50",children:[(0,t.jsx)(T.Spin,{indicator:(0,t.jsx)(u.LoadingOutlined,{spin:!0})}),(0,t.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:"Loading image..."})]}):i[e.file_id]?(0,t.jsxs)("div",{children:[(0,t.jsx)("img",{src:i[e.file_id],alt:e.filename||"Generated chart",className:"max-w-full",style:{maxHeight:"400px"}}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-50 border-t border-gray-200",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,t.jsx)(eF,{})," ",e.filename]}),(0,t.jsxs)("button",{onClick:()=>h(e),className:"text-xs text-blue-500 hover:text-blue-700 flex items-center gap-1",children:[(0,t.jsx)(ez.DownloadOutlined,{})," Download"]})]})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-4 bg-gray-50",children:(0,t.jsx)("span",{className:"text-sm text-gray-400",children:"Image not available"})})},e.file_id)),p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:p.map(e=>(0,t.jsxs)("button",{onClick:()=>h(e),className:"flex items-center gap-2 px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg hover:bg-gray-100 transition-colors",children:[(0,t.jsx)(eM.FileTextOutlined,{className:"text-blue-500"}),(0,t.jsx)("span",{className:"text-sm",children:e.filename}),(0,t.jsx)(ez.DownloadOutlined,{className:"text-gray-400"})]},e.file_id))})]}):null};var eG=e.i(355343),eV=e.i(966988),eK=e.i(989022);let eX=async(e,t)=>{let s=await new Promise((e,s)=>{let r=new FileReader;r.onload=()=>{e(r.result.split(",")[1])},r.onerror=s,r.readAsDataURL(t)}),r=t.type||(t.name.toLowerCase().endsWith(".pdf")?"application/pdf":"image/jpeg");return{role:"user",content:[{type:"input_text",text:e},{type:"input_image",image_url:`data:${r};base64,${s}`}]}},eY=(e,t,s,r)=>{let a="";t&&r&&(a=r.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?`${e} ${a}`:e};return t&&s&&(n.imagePreviewUrl=s),n},eQ=({message:e})=>{if(!("user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&e.imagePreviewUrl))return null;let s="string"==typeof e.content&&e.content.includes("[PDF attached]");return(0,t.jsx)("div",{className:"mb-2",children:s?(0,t.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,t.jsx)(ek,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,t.jsx)("img",{src:e.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})};function eZ({searchResults:e}){let[s,r]=(0,R.useState)(!0),[a,n]=(0,R.useState)({});if(!e||0===e.length)return null;let o=e.reduce((e,t)=>e+t.data.length,0);return(0,t.jsxs)("div",{className:"search-results-content mt-1 mb-2",children:[(0,t.jsxs)(_.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>r(!s),icon:(0,t.jsx)(i.DatabaseOutlined,{}),children:[s?"Hide sources":`Show sources (${o})`,s?(0,t.jsx)(eR.DownOutlined,{className:"ml-1"}):(0,t.jsx)(eI.RightOutlined,{className:"ml-1"})]}),s&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm",children:(0,t.jsx)("div",{className:"space-y-3",children:e.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs text-gray-600 mb-2 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:"Query:"}),(0,t.jsxs)("span",{className:"italic",children:['"',e.search_query,'"']}),(0,t.jsx)("span",{className:"text-gray-400",children:"•"}),(0,t.jsxs)("span",{className:"text-gray-500",children:[e.data.length," result",1!==e.data.length?"s":""]})]}),(0,t.jsx)("div",{className:"space-y-2",children:e.data.map((e,r)=>{let i=a[`${s}-${r}`]||!1;return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-md overflow-hidden bg-white",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-2 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>{let e;return e=`${s}-${r}`,void n(t=>({...t,[e]:!t[e]}))},children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,t.jsx)("svg",{className:`w-4 h-4 text-gray-400 transition-transform flex-shrink-0 ${i?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)(eM.FileTextOutlined,{className:"text-gray-400 flex-shrink-0",style:{fontSize:"12px"}}),(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 truncate",children:e.filename||e.file_id||`Result ${r+1}`}),(0,t.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-blue-100 text-blue-700 font-mono flex-shrink-0",children:e.score.toFixed(3)})]})}),i&&(0,t.jsx)("div",{className:"border-t border-gray-200 bg-white",children:(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[e.content.map((e,s)=>(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:"text-xs font-mono bg-gray-50 p-2 rounded text-gray-800 whitespace-pre-wrap break-words",children:e.text})},s)),e.attributes&&Object.keys(e.attributes).length>0&&(0,t.jsxs)("div",{className:"mt-2 pt-2 border-t border-gray-100",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Metadata:"}),(0,t.jsx)("div",{className:"space-y-1",children:Object.entries(e.attributes).map(([e,s])=>(0,t.jsxs)("div",{className:"text-xs flex gap-2",children:[(0,t.jsxs)("span",{className:"text-gray-500 font-medium",children:[e,":"]}),(0,t.jsx)("span",{className:"text-gray-700 font-mono break-all",children:String(s)})]},e))})]})]})})]},r)})})]},s))})})]})}e.s(["SearchResultsDisplay",()=>eZ],152401);let e0=function({message:e,isLastMessage:s,endpointType:r,mcpEvents:a,codeInterpreterResult:n,accessToken:i}){let o="user"===e.role;return(0,t.jsx)("div",{className:`mb-4 ${o?"text-right":"text-left"}`,children:(0,t.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:o?"#f0f8ff":"#ffffff",border:o?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:o?"#e6f0fa":"#f5f5f5"},children:o?(0,t.jsx)(eC.UserOutlined,{style:{fontSize:"12px",color:"#2563eb"}}):(0,t.jsx)(m.RobotOutlined,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,t.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,t.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,t.jsx)(eV.default,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&s&&a.length>0&&(r===eo.EndpointType.RESPONSES||r===eo.EndpointType.CHAT)&&(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)(eG.default,{events:a})}),"assistant"===e.role&&e.searchResults&&(0,t.jsx)(eZ,{searchResults:e.searchResults}),"assistant"===e.role&&s&&n&&r===eo.EndpointType.RESPONSES&&(0,t.jsx)(eJ,{code:n.code,containerId:n.containerId,annotations:n.annotations,accessToken:i}),(0,t.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,t.jsx)("img",{src:"string"==typeof e.content?e.content:"",alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):e.isAudio?(0,t.jsx)(eD,{message:e}):(0,t.jsxs)(t.Fragment,{children:[r===eo.EndpointType.RESPONSES&&(0,t.jsx)(eQ,{message:e}),r===eo.EndpointType.CHAT&&(0,t.jsx)(eq,{message:e}),(0,t.jsx)(eT.default,{components:{code({node:e,inline:s,className:r,children:a,...n}){let i=/language-(\w+)/.exec(r||"");return!s&&i?(0,t.jsx)(I.Prism,{style:M.coy,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...n,children:String(a).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${r} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,style:{wordBreak:"break-word"},...n,children:a})},pre:({node:e,...s})=>(0,t.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})},children:"string"==typeof e.content?e.content:""}),e.image&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)("img",{src:e.image.url,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}})})]}),"assistant"===e.role&&(e.timeToFirstToken||e.totalLatency||e.usage)&&!e.a2aMetadata&&(0,t.jsx)(eK.default,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage,toolName:e.toolName}),"assistant"===e.role&&e.a2aMetadata&&(0,t.jsx)(eU,{a2aMetadata:e.a2aMetadata,timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency})]})]})})};var eu=eu;let{Dragger:e1}=O.Upload,e2=({responsesUploadedImage:e,responsesImagePreviewUrl:s,onImageUpload:r,onRemoveImage:a})=>(0,t.jsx)(t.Fragment,{children:!e&&(0,t.jsx)(e1,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,t.jsx)(A.Tooltip,{title:"Attach image or PDF",children:(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,t.jsx)(eu.default,{style:{fontSize:"16px"}})})})})}),e4=({endpointType:e,responsesSessionId:s,useApiSessionManagement:r,onToggleSessionManagement:a})=>e!==eo.EndpointType.RESPONSES?null:(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,t.jsx)(A.Tooltip,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,t.jsx)(ey.Switch,{checked:r,onChange:a,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,t.jsxs)("div",{className:`text-xs p-2 rounded-md ${s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(l.InfoCircleOutlined,{style:{fontSize:"12px"}}),(()=>{if(!s)return r?"API Session: Ready":"UI Session: Ready";let e=r?"Response ID":"UI Session",t=s.slice(0,10);return`${e}: ${t}...`})()]}),s&&(0,t.jsx)(A.Tooltip,{title:(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,t.jsx)("div",{className:"bg-gray-800 text-gray-100 p-2 rounded font-mono text-xs whitespace-pre-wrap",children:`curl -X POST "your-proxy-url/v1/responses" \\
-H "Authorization: Bearer your-api-key" \\
-H "Content-Type: application/json" \\
-d '{
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/0e03d69b502b3be9.js b/litellm/proxy/_experimental/out/_next/static/chunks/0e03d69b502b3be9.js
new file mode 100644
index 0000000000..a0cc649bd6
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/0e03d69b502b3be9.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,349356,e=>{e.v({AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"})},137429,e=>{e.v({0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"})},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},94629,e=>{"use strict";var t=e.i(271645);let a=t.forwardRef(function(e,a){return t.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:a},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});e.s(["SwitchVerticalIcon",0,a],94629)},916925,e=>{"use strict";var t,a=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t.ZAI="Z.AI (Zhipu AI)",t);let o={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference",ZAI:"zai"},n="../ui/assets/logos/",r={"A2A Agent":`${n}a2a_agent.png`,Ai21:`${n}ai21.svg`,"Ai21 Chat":`${n}ai21.svg`,"AI/ML API":`${n}aiml_api.svg`,"Aiohttp Openai":`${n}openai_small.svg`,Anthropic:`${n}anthropic.svg`,"Anthropic Text":`${n}anthropic.svg`,AssemblyAI:`${n}assemblyai_small.png`,Azure:`${n}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${n}microsoft_azure.svg`,"Azure Text":`${n}microsoft_azure.svg`,Baseten:`${n}baseten.svg`,"Amazon Bedrock":`${n}bedrock.svg`,"Amazon Bedrock Mantle":`${n}bedrock.svg`,"AWS SageMaker":`${n}bedrock.svg`,Cerebras:`${n}cerebras.svg`,Cloudflare:`${n}cloudflare.svg`,Codestral:`${n}mistral.svg`,Cohere:`${n}cohere.svg`,"Cohere Chat":`${n}cohere.svg`,Cometapi:`${n}cometapi.svg`,Cursor:`${n}cursor.svg`,"Databricks (Qwen API)":`${n}databricks.svg`,Dashscope:`${n}dashscope.svg`,Deepseek:`${n}deepseek.svg`,Deepgram:`${n}deepgram.png`,DeepInfra:`${n}deepinfra.png`,ElevenLabs:`${n}elevenlabs.png`,"Fal AI":`${n}fal_ai.jpg`,"Featherless Ai":`${n}featherless.svg`,"Fireworks AI":`${n}fireworks.svg`,Friendliai:`${n}friendli.svg`,"Github Copilot":`${n}github_copilot.svg`,"Google AI Studio":`${n}google.svg`,GradientAI:`${n}gradientai.svg`,Groq:`${n}groq.svg`,vllm:`${n}vllm.png`,Huggingface:`${n}huggingface.svg`,Hyperbolic:`${n}hyperbolic.svg`,Infinity:`${n}infinity.png`,"Jina AI":`${n}jina.png`,"Lambda Ai":`${n}lambda.svg`,"Lm Studio":`${n}lmstudio.svg`,"Meta Llama":`${n}meta_llama.svg`,MiniMax:`${n}minimax.svg`,"Mistral AI":`${n}mistral.svg`,Moonshot:`${n}moonshot.svg`,Morph:`${n}morph.svg`,Nebius:`${n}nebius.svg`,Novita:`${n}novita.svg`,"Nvidia Nim":`${n}nvidia_nim.svg`,Ollama:`${n}ollama.svg`,"Ollama Chat":`${n}ollama.svg`,Oobabooga:`${n}openai_small.svg`,OpenAI:`${n}openai_small.svg`,"Openai Like":`${n}openai_small.svg`,"OpenAI Text Completion":`${n}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${n}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${n}openai_small.svg`,Openrouter:`${n}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${n}oracle.svg`,Perplexity:`${n}perplexity-ai.svg`,Recraft:`${n}recraft.svg`,Replicate:`${n}replicate.svg`,RunwayML:`${n}runwayml.png`,Sagemaker:`${n}bedrock.svg`,Sambanova:`${n}sambanova.svg`,"SAP Generative AI Hub":`${n}sap.png`,Snowflake:`${n}snowflake.svg`,"Text-Completion-Codestral":`${n}mistral.svg`,TogetherAI:`${n}togetherai.svg`,Topaz:`${n}topaz.svg`,Triton:`${n}nvidia_triton.png`,V0:`${n}v0.svg`,"Vercel Ai Gateway":`${n}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${n}google.svg`,"Vertex Ai Beta":`${n}google.svg`,Vllm:`${n}vllm.png`,VolcEngine:`${n}volcengine.png`,"Voyage AI":`${n}voyage.webp`,Watsonx:`${n}watsonx.svg`,"Watsonx Text":`${n}watsonx.svg`,xAI:`${n}xai.svg`,Xinference:`${n}xinference.svg`};e.s(["Providers",()=>a,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else if("Z.AI (Zhipu AI)"===e)return"zai/glm-4.5";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:r[e],displayName:e}}let t=Object.keys(o).find(t=>o[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let n=a[t];return{logo:r[n],displayName:n}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let a=o[e];console.log(`Provider mapped to: ${a}`);let n=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let o=t.litellm_provider;(o===a||"string"==typeof o&&o.includes(a))&&n.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&n.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&n.push(e)}))),n},"providerLogoMap",0,r,"provider_map",0,o])},599724,936325,e=>{"use strict";var t=e.i(95779),a=e.i(444755),o=e.i(673706),n=e.i(271645);let r=n.default.forwardRef((e,r)=>{let{color:l,className:i,children:s}=e;return n.default.createElement("p",{ref:r,className:(0,a.tremorTwMerge)("text-tremor-default",l?(0,o.getColorClassNames)(l,t.colorPalette.text).textColor:(0,a.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),i)},s)});r.displayName="Text",e.s(["default",()=>r],936325),e.s(["Text",()=>r],599724)},304967,e=>{"use strict";var t=e.i(290571),a=e.i(271645),o=e.i(480731),n=e.i(95779),r=e.i(444755),l=e.i(673706);let i=(0,l.makeClassName)("Card"),s=a.default.forwardRef((e,s)=>{let{decoration:c="",decorationColor:d,children:u,className:m}=e,p=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return a.default.createElement("div",Object.assign({ref:s,className:(0,r.tremorTwMerge)(i("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",d?(0,l.getColorClassNames)(d,n.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case o.HorizontalPositions.Left:return"border-l-4";case o.VerticalPositions.Top:return"border-t-4";case o.HorizontalPositions.Right:return"border-r-4";case o.VerticalPositions.Bottom:return"border-b-4";default:return""}})(c),m)},p),u)});s.displayName="Card",e.s(["Card",()=>s],304967)},629569,e=>{"use strict";var t=e.i(290571),a=e.i(95779),o=e.i(444755),n=e.i(673706),r=e.i(271645);let l=r.default.forwardRef((e,l)=>{let{color:i,children:s,className:c}=e,d=(0,t.__rest)(e,["color","children","className"]);return r.default.createElement("p",Object.assign({ref:l,className:(0,o.tremorTwMerge)("font-medium text-tremor-title",i?(0,n.getColorClassNames)(i,a.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},d),s)});l.displayName="Title",e.s(["Title",()=>l],629569)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},991124,e=>{"use strict";let t=(0,e.i(475254).default)("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"}]]);e.s(["default",()=>t])},678784,678745,e=>{"use strict";let t=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],678745),e.s(["CheckIcon",()=>t],678784)},118366,e=>{"use strict";var t=e.i(991124);e.s(["CopyIcon",()=>t.default])},751904,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default])},440987,e=>{"use strict";var t=e.i(903446);e.s(["SettingsIcon",()=>t.default])},837007,e=>{"use strict";var t=e.i(603908);e.s(["PlusIcon",()=>t.default])},573421,e=>{"use strict";e.i(247167);var t=e.i(8211),a=e.i(271645),o=e.i(343794),n=e.i(887719),r=e.i(908206),l=e.i(242064),i=e.i(721132),s=e.i(517455),c=e.i(264042),d=e.i(150073),u=e.i(165370),m=e.i(244451);let p=a.default.createContext({});p.Consumer;var g=e.i(763731),f=e.i(211576),v=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(a[o[n]]=e[o[n]]);return a};let h=a.default.forwardRef((e,t)=>{let n,{prefixCls:r,children:i,actions:s,extra:c,styles:d,className:u,classNames:m,colStyle:h}=e,b=v(e,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:x,itemLayout:y}=(0,a.useContext)(p),{getPrefixCls:A,list:$}=(0,a.useContext)(l.ConfigContext),O=e=>{var t,a;return(0,o.default)(null==(a=null==(t=null==$?void 0:$.item)?void 0:t.classNames)?void 0:a[e],null==m?void 0:m[e])},C=e=>{var t,a;return Object.assign(Object.assign({},null==(a=null==(t=null==$?void 0:$.item)?void 0:t.styles)?void 0:a[e]),null==d?void 0:d[e])},k=A("list",r),E=s&&s.length>0&&a.default.createElement("ul",{className:(0,o.default)(`${k}-item-action`,O("actions")),key:"actions",style:C("actions")},s.map((e,t)=>a.default.createElement("li",{key:`${k}-item-action-${t}`},e,t!==s.length-1&&a.default.createElement("em",{className:`${k}-item-action-split`})))),I=a.default.createElement(x?"div":"li",Object.assign({},b,x?{}:{ref:t},{className:(0,o.default)(`${k}-item`,{[`${k}-item-no-flex`]:!("vertical"===y?!!c:(n=!1,a.Children.forEach(i,e=>{"string"==typeof e&&(n=!0)}),!(n&&a.Children.count(i)>1)))},u)}),"vertical"===y&&c?[a.default.createElement("div",{className:`${k}-item-main`,key:"content"},i,E),a.default.createElement("div",{className:(0,o.default)(`${k}-item-extra`,O("extra")),key:"extra",style:C("extra")},c)]:[i,E,(0,g.cloneElement)(c,{key:"extra"})]);return x?a.default.createElement(f.Col,{ref:t,flex:1,style:h},I):I});h.Meta=e=>{var{prefixCls:t,className:n,avatar:r,title:i,description:s}=e,c=v(e,["prefixCls","className","avatar","title","description"]);let{getPrefixCls:d}=(0,a.useContext)(l.ConfigContext),u=d("list",t),m=(0,o.default)(`${u}-item-meta`,n),p=a.default.createElement("div",{className:`${u}-item-meta-content`},i&&a.default.createElement("h4",{className:`${u}-item-meta-title`},i),s&&a.default.createElement("div",{className:`${u}-item-meta-description`},s));return a.default.createElement("div",Object.assign({},c,{className:m}),r&&a.default.createElement("div",{className:`${u}-item-meta-avatar`},r),(i||s)&&p)},e.i(296059);var b=e.i(915654),x=e.i(183293),y=e.i(246422),A=e.i(838378);let $=(0,y.genStyleHooks)("List",e=>{let t=(0,A.mergeToken)(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG});return[(e=>{let{componentCls:t,antCls:a,controlHeight:o,minHeight:n,paddingSM:r,marginLG:l,padding:i,itemPadding:s,colorPrimary:c,itemPaddingSM:d,itemPaddingLG:u,paddingXS:m,margin:p,colorText:g,colorTextDescription:f,motionDurationSlow:v,lineWidth:h,headerBg:y,footerBg:A,emptyTextPadding:$,metaMarginBottom:O,avatarMarginRight:C,titleMarginBottom:k,descriptionFontSize:E}=e;return{[t]:Object.assign(Object.assign({},(0,x.resetComponent)(e)),{position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},[`${t}-header`]:{background:y},[`${t}-footer`]:{background:A},[`${t}-header, ${t}-footer`]:{paddingBlock:r},[`${t}-pagination`]:{marginBlockStart:l,[`${a}-pagination-options`]:{textAlign:"start"}},[`${t}-spin`]:{minHeight:n,textAlign:"center"},[`${t}-items`]:{margin:0,padding:0,listStyle:"none"},[`${t}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:s,color:g,[`${t}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${t}-item-meta-avatar`]:{marginInlineEnd:C},[`${t}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${t}-item-meta-title`]:{margin:`0 0 ${(0,b.unit)(e.marginXXS)} 0`,color:g,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:g,transition:`all ${v}`,"&:hover":{color:c}}},[`${t}-item-meta-description`]:{color:f,fontSize:E,lineHeight:e.lineHeight}},[`${t}-item-action`]:{flex:"0 0 auto",marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${(0,b.unit)(m)}`,color:f,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${t}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:h,height:e.calc(e.fontHeight).sub(e.calc(e.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:e.colorSplit}}},[`${t}-empty`]:{padding:`${(0,b.unit)(i)} 0`,color:f,fontSize:e.fontSizeSM,textAlign:"center"},[`${t}-empty-text`]:{padding:$,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:"center"},[`${t}-item-no-flex`]:{display:"block"}}),[`${t}-grid ${a}-col > ${t}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:p,paddingBlock:0,borderBlockEnd:"none"},[`${t}-vertical ${t}-item`]:{alignItems:"initial",[`${t}-item-main`]:{display:"block",flex:1},[`${t}-item-extra`]:{marginInlineStart:l},[`${t}-item-meta`]:{marginBlockEnd:O,[`${t}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:k,color:g,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${t}-item-action`]:{marginBlockStart:i,marginInlineStart:"auto","> li":{padding:`0 ${(0,b.unit)(i)}`,"&:first-child":{paddingInlineStart:0}}}},[`${t}-split ${t}-item`]:{borderBlockEnd:`${(0,b.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${t}-split ${t}-header`]:{borderBlockEnd:`${(0,b.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-split${t}-empty ${t}-footer`]:{borderTop:`${(0,b.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-loading ${t}-spin-nested-loading`]:{minHeight:o},[`${t}-split${t}-something-after-last-item ${a}-spin-container > ${t}-items > ${t}-item:last-child`]:{borderBlockEnd:`${(0,b.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-lg ${t}-item`]:{padding:u},[`${t}-sm ${t}-item`]:{padding:d},[`${t}:not(${t}-vertical)`]:{[`${t}-item-no-flex`]:{[`${t}-item-action`]:{float:"right"}}}}})(t),(e=>{let{listBorderedCls:t,componentCls:a,paddingLG:o,margin:n,itemPaddingSM:r,itemPaddingLG:l,marginLG:i,borderRadiusLG:s}=e,c=(0,b.unit)(e.calc(s).sub(e.lineWidth).equal());return{[t]:{border:`${(0,b.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:s,[`${a}-header`]:{borderRadius:`${c} ${c} 0 0`},[`${a}-footer`]:{borderRadius:`0 0 ${c} ${c}`},[`${a}-header,${a}-footer,${a}-item`]:{paddingInline:o},[`${a}-pagination`]:{margin:`${(0,b.unit)(n)} ${(0,b.unit)(i)}`}},[`${t}${a}-sm`]:{[`${a}-item,${a}-header,${a}-footer`]:{padding:r}},[`${t}${a}-lg`]:{[`${a}-item,${a}-header,${a}-footer`]:{padding:l}}}})(t),(e=>{let{componentCls:t,screenSM:a,screenMD:o,marginLG:n,marginSM:r,margin:l}=e;return{[`@media screen and (max-width:${o}px)`]:{[t]:{[`${t}-item`]:{[`${t}-item-action`]:{marginInlineStart:n}}},[`${t}-vertical`]:{[`${t}-item`]:{[`${t}-item-extra`]:{marginInlineStart:n}}}},[`@media screen and (max-width: ${a}px)`]:{[t]:{[`${t}-item`]:{flexWrap:"wrap",[`${t}-action`]:{marginInlineStart:r}}},[`${t}-vertical`]:{[`${t}-item`]:{flexWrap:"wrap-reverse",[`${t}-item-main`]:{minWidth:e.contentWidth},[`${t}-item-extra`]:{margin:`auto auto ${(0,b.unit)(l)}`}}}}}})(t)]},e=>({contentWidth:220,itemPadding:`${(0,b.unit)(e.paddingContentVertical)} 0`,itemPaddingSM:`${(0,b.unit)(e.paddingContentVerticalSM)} ${(0,b.unit)(e.paddingContentHorizontal)}`,itemPaddingLG:`${(0,b.unit)(e.paddingContentVerticalLG)} ${(0,b.unit)(e.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:e.padding,metaMarginBottom:e.padding,avatarMarginRight:e.padding,titleMarginBottom:e.paddingSM,descriptionFontSize:e.fontSize}));var O=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(a[o[n]]=e[o[n]]);return a};let C=a.forwardRef(function(e,g){let{pagination:f=!1,prefixCls:v,bordered:h=!1,split:b=!0,className:x,rootClassName:y,style:A,children:C,itemLayout:k,loadMore:E,grid:I,dataSource:w=[],size:S,header:T,footer:N,loading:M=!1,rowKey:_,renderItem:L,locale:j}=e,R=O(e,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),z=f&&"object"==typeof f?f:{},[P,D]=a.useState(z.defaultCurrent||1),[H,B]=a.useState(z.defaultPageSize||10),{getPrefixCls:V,direction:W,className:G,style:F}=(0,l.useComponentConfig)("list"),{renderEmpty:U}=a.useContext(l.ConfigContext),X=e=>(t,a)=>{var o;D(t),B(a),f&&(null==(o=null==f?void 0:f[e])||o.call(f,t,a))},K=X("onChange"),Y=X("onShowSizeChange"),q=!!(E||f||N),Z=V("list",v),[J,Q,ee]=$(Z),et=M;"boolean"==typeof et&&(et={spinning:et});let ea=!!(null==et?void 0:et.spinning),eo=(0,s.default)(S),en="";switch(eo){case"large":en="lg";break;case"small":en="sm"}let er=(0,o.default)(Z,{[`${Z}-vertical`]:"vertical"===k,[`${Z}-${en}`]:en,[`${Z}-split`]:b,[`${Z}-bordered`]:h,[`${Z}-loading`]:ea,[`${Z}-grid`]:!!I,[`${Z}-something-after-last-item`]:q,[`${Z}-rtl`]:"rtl"===W},G,x,y,Q,ee),el=(0,n.default)({current:1,total:0,position:"bottom"},{total:w.length,current:P,pageSize:H},f||{}),ei=Math.ceil(el.total/el.pageSize);el.current=Math.min(el.current,ei);let es=f&&a.createElement("div",{className:(0,o.default)(`${Z}-pagination`)},a.createElement(u.default,Object.assign({align:"end"},el,{onChange:K,onShowSizeChange:Y}))),ec=(0,t.default)(w);f&&w.length>(el.current-1)*el.pageSize&&(ec=(0,t.default)(w).splice((el.current-1)*el.pageSize,el.pageSize));let ed=Object.keys(I||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e)),eu=(0,d.default)(ed),em=a.useMemo(()=>{for(let e=0;e{if(!I)return;let e=em&&I[em]?I[em]:I.column;if(e)return{width:`${100/e}%`,maxWidth:`${100/e}%`}},[JSON.stringify(I),em]),eg=ea&&a.createElement("div",{style:{minHeight:53}});if(ec.length>0){let e=ec.map((e,t)=>{let o;return L?((o="function"==typeof _?_(e):_?e[_]:e.key)||(o=`list-item-${t}`),a.createElement(a.Fragment,{key:o},L(e,t))):null});eg=I?a.createElement(c.Row,{gutter:I.gutter},a.Children.map(e,e=>a.createElement("div",{key:null==e?void 0:e.key,style:ep},e))):a.createElement("ul",{className:`${Z}-items`},e)}else C||ea||(eg=a.createElement("div",{className:`${Z}-empty-text`},(null==j?void 0:j.emptyText)||(null==U?void 0:U("List"))||a.createElement(i.default,{componentName:"List"})));let ef=el.position,ev=a.useMemo(()=>({grid:I,itemLayout:k}),[JSON.stringify(I),k]);return J(a.createElement(p.Provider,{value:ev},a.createElement("div",Object.assign({ref:g,style:Object.assign(Object.assign({},F),A),className:er},R),("top"===ef||"both"===ef)&&es,T&&a.createElement("div",{className:`${Z}-header`},T),a.createElement(m.default,Object.assign({},et),eg,C),N&&a.createElement("div",{className:`${Z}-footer`},N),E||("bottom"===ef||"both"===ef)&&es)))});C.Item=h,e.s(["List",0,C],573421)},608856,e=>{"use strict";e.i(247167);var t=e.i(271645),a=e.i(343794),o=e.i(209428),n=e.i(392221),r=e.i(951160),l=e.i(174428),i=t.createContext(null),s=t.createContext({}),c=e.i(211577),d=e.i(931067),u=e.i(361275),m=e.i(404948),p=e.i(244009),g=e.i(703923),f=e.i(611935),v=["prefixCls","className","containerRef"];let h=function(e){var o=e.prefixCls,n=e.className,r=e.containerRef,l=(0,g.default)(e,v),i=t.useContext(s).panel,c=(0,f.useComposeRef)(i,r);return t.createElement("div",(0,d.default)({className:(0,a.default)("".concat(o,"-content"),n),role:"dialog",ref:c},(0,p.default)(e,{aria:!0}),{"aria-modal":"true"},l))};var b=e.i(883110);function x(e){return"string"==typeof e&&String(Number(e))===e?((0,b.default)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}e.i(654310);var y={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"},A=t.forwardRef(function(e,r){var l,s,g,f=e.prefixCls,v=e.open,b=e.placement,A=e.inline,$=e.push,O=e.forceRender,C=e.autoFocus,k=e.keyboard,E=e.classNames,I=e.rootClassName,w=e.rootStyle,S=e.zIndex,T=e.className,N=e.id,M=e.style,_=e.motion,L=e.width,j=e.height,R=e.children,z=e.mask,P=e.maskClosable,D=e.maskMotion,H=e.maskClassName,B=e.maskStyle,V=e.afterOpenChange,W=e.onClose,G=e.onMouseEnter,F=e.onMouseOver,U=e.onMouseLeave,X=e.onClick,K=e.onKeyDown,Y=e.onKeyUp,q=e.styles,Z=e.drawerRender,J=t.useRef(),Q=t.useRef(),ee=t.useRef();t.useImperativeHandle(r,function(){return J.current}),t.useEffect(function(){if(v&&C){var e;null==(e=J.current)||e.focus({preventScroll:!0})}},[v]);var et=t.useState(!1),ea=(0,n.default)(et,2),eo=ea[0],en=ea[1],er=t.useContext(i),el=null!=(l=null!=(s=null==(g="boolean"==typeof $?$?{}:{distance:0}:$||{})?void 0:g.distance)?s:null==er?void 0:er.pushDistance)?l:180,ei=t.useMemo(function(){return{pushDistance:el,push:function(){en(!0)},pull:function(){en(!1)}}},[el]);t.useEffect(function(){var e,t;v?null==er||null==(e=er.push)||e.call(er):null==er||null==(t=er.pull)||t.call(er)},[v]),t.useEffect(function(){return function(){var e;null==er||null==(e=er.pull)||e.call(er)}},[]);var es=t.createElement(u.default,(0,d.default)({key:"mask"},D,{visible:z&&v}),function(e,n){var r=e.className,l=e.style;return t.createElement("div",{className:(0,a.default)("".concat(f,"-mask"),r,null==E?void 0:E.mask,H),style:(0,o.default)((0,o.default)((0,o.default)({},l),B),null==q?void 0:q.mask),onClick:P&&v?W:void 0,ref:n})}),ec="function"==typeof _?_(b):_,ed={};if(eo&&el)switch(b){case"top":ed.transform="translateY(".concat(el,"px)");break;case"bottom":ed.transform="translateY(".concat(-el,"px)");break;case"left":ed.transform="translateX(".concat(el,"px)");break;default:ed.transform="translateX(".concat(-el,"px)")}"left"===b||"right"===b?ed.width=x(L):ed.height=x(j);var eu={onMouseEnter:G,onMouseOver:F,onMouseLeave:U,onClick:X,onKeyDown:K,onKeyUp:Y},em=t.createElement(u.default,(0,d.default)({key:"panel"},ec,{visible:v,forceRender:O,onVisibleChanged:function(e){null==V||V(e)},removeOnLeave:!1,leavedClassName:"".concat(f,"-content-wrapper-hidden")}),function(n,r){var l=n.className,i=n.style,s=t.createElement(h,(0,d.default)({id:N,containerRef:r,prefixCls:f,className:(0,a.default)(T,null==E?void 0:E.content),style:(0,o.default)((0,o.default)({},M),null==q?void 0:q.content)},(0,p.default)(e,{aria:!0}),eu),R);return t.createElement("div",(0,d.default)({className:(0,a.default)("".concat(f,"-content-wrapper"),null==E?void 0:E.wrapper,l),style:(0,o.default)((0,o.default)((0,o.default)({},ed),i),null==q?void 0:q.wrapper)},(0,p.default)(e,{data:!0})),Z?Z(s):s)}),ep=(0,o.default)({},w);return S&&(ep.zIndex=S),t.createElement(i.Provider,{value:ei},t.createElement("div",{className:(0,a.default)(f,"".concat(f,"-").concat(b),I,(0,c.default)((0,c.default)({},"".concat(f,"-open"),v),"".concat(f,"-inline"),A)),style:ep,tabIndex:-1,ref:J,onKeyDown:function(e){var t,a,o=e.keyCode,n=e.shiftKey;switch(o){case m.default.TAB:o===m.default.TAB&&(n||document.activeElement!==ee.current?n&&document.activeElement===Q.current&&(null==(a=ee.current)||a.focus({preventScroll:!0})):null==(t=Q.current)||t.focus({preventScroll:!0}));break;case m.default.ESC:W&&k&&(e.stopPropagation(),W(e))}}},es,t.createElement("div",{tabIndex:0,ref:Q,style:y,"aria-hidden":"true","data-sentinel":"start"}),em,t.createElement("div",{tabIndex:0,ref:ee,style:y,"aria-hidden":"true","data-sentinel":"end"})))});let $=function(e){var a=e.open,i=e.prefixCls,c=e.placement,d=e.autoFocus,u=e.keyboard,m=e.width,p=e.mask,g=void 0===p||p,f=e.maskClosable,v=e.getContainer,h=e.forceRender,b=e.afterOpenChange,x=e.destroyOnClose,y=e.onMouseEnter,$=e.onMouseOver,O=e.onMouseLeave,C=e.onClick,k=e.onKeyDown,E=e.onKeyUp,I=e.panelRef,w=t.useState(!1),S=(0,n.default)(w,2),T=S[0],N=S[1],M=t.useState(!1),_=(0,n.default)(M,2),L=_[0],j=_[1];(0,l.default)(function(){j(!0)},[]);var R=!!L&&void 0!==a&&a,z=t.useRef(),P=t.useRef();(0,l.default)(function(){R&&(P.current=document.activeElement)},[R]);var D=t.useMemo(function(){return{panel:I}},[I]);if(!h&&!T&&!R&&x)return null;var H=(0,o.default)((0,o.default)({},e),{},{open:R,prefixCls:void 0===i?"rc-drawer":i,placement:void 0===c?"right":c,autoFocus:void 0===d||d,keyboard:void 0===u||u,width:void 0===m?378:m,mask:g,maskClosable:void 0===f||f,inline:!1===v,afterOpenChange:function(e){var t,a;N(e),null==b||b(e),e||!P.current||null!=(t=z.current)&&t.contains(P.current)||null==(a=P.current)||a.focus({preventScroll:!0})},ref:z},{onMouseEnter:y,onMouseOver:$,onMouseLeave:O,onClick:C,onKeyDown:k,onKeyUp:E});return t.createElement(s.Provider,{value:D},t.createElement(r.default,{open:R||h||T,autoDestroy:!1,getContainer:v,autoLock:g&&(R||T)},t.createElement(A,H)))};var O=e.i(981444),C=e.i(617206),k=e.i(122767),E=e.i(613541),I=e.i(340010),w=e.i(242064),S=e.i(922611),T=e.i(563113),N=e.i(185793);let M=e=>{var o,n,r,l;let i,{prefixCls:s,ariaId:c,title:d,footer:u,extra:m,closable:p,loading:g,onClose:f,headerStyle:v,bodyStyle:h,footerStyle:b,children:x,classNames:y,styles:A}=e,$=(0,w.useComponentConfig)("drawer");i=!1===p?void 0:void 0===p||!0===p?"start":(null==p?void 0:p.placement)==="end"?"end":"start";let O=t.useCallback(e=>t.createElement("button",{type:"button",onClick:f,className:(0,a.default)(`${s}-close`,{[`${s}-close-${i}`]:"end"===i})},e),[f,s,i]),[C,k]=(0,T.useClosable)((0,T.pickClosable)(e),(0,T.pickClosable)($),{closable:!0,closeIconRender:O});return t.createElement(t.Fragment,null,d||C?t.createElement("div",{style:Object.assign(Object.assign(Object.assign({},null==(r=$.styles)?void 0:r.header),v),null==A?void 0:A.header),className:(0,a.default)(`${s}-header`,{[`${s}-header-close-only`]:C&&!d&&!m},null==(l=$.classNames)?void 0:l.header,null==y?void 0:y.header)},t.createElement("div",{className:`${s}-header-title`},"start"===i&&k,d&&t.createElement("div",{className:`${s}-title`,id:c},d)),m&&t.createElement("div",{className:`${s}-extra`},m),"end"===i&&k):null,t.createElement("div",{className:(0,a.default)(`${s}-body`,null==y?void 0:y.body,null==(o=$.classNames)?void 0:o.body),style:Object.assign(Object.assign(Object.assign({},null==(n=$.styles)?void 0:n.body),h),null==A?void 0:A.body)},g?t.createElement(N.default,{active:!0,title:!1,paragraph:{rows:5},className:`${s}-body-skeleton`}):x),(()=>{var e,o;if(!u)return null;let n=`${s}-footer`;return t.createElement("div",{className:(0,a.default)(n,null==(e=$.classNames)?void 0:e.footer,null==y?void 0:y.footer),style:Object.assign(Object.assign(Object.assign({},null==(o=$.styles)?void 0:o.footer),b),null==A?void 0:A.footer)},u)})())};e.i(296059);var _=e.i(915654),L=e.i(183293),j=e.i(246422),R=e.i(838378);let z=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),P=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},z({opacity:e},{opacity:1})),D=(0,j.genStyleHooks)("Drawer",e=>{let t=(0,R.mergeToken)(e,{});return[(e=>{let{borderRadiusSM:t,componentCls:a,zIndexPopup:o,colorBgMask:n,colorBgElevated:r,motionDurationSlow:l,motionDurationMid:i,paddingXS:s,padding:c,paddingLG:d,fontSizeLG:u,lineHeightLG:m,lineWidth:p,lineType:g,colorSplit:f,marginXS:v,colorIcon:h,colorIconHover:b,colorBgTextHover:x,colorBgTextActive:y,colorText:A,fontWeightStrong:$,footerPaddingBlock:O,footerPaddingInline:C,calc:k}=e,E=`${a}-content-wrapper`;return{[a]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none",color:A,"&-pure":{position:"relative",background:r,display:"flex",flexDirection:"column",[`&${a}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${a}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${a}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${a}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${a}-mask`]:{position:"absolute",inset:0,zIndex:o,background:n,pointerEvents:"auto"},[E]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${l}`,"&-hidden":{display:"none"}},[`&-left > ${E}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${E}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${E}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${E}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${a}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:r,pointerEvents:"auto"},[`${a}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${(0,_.unit)(c)} ${(0,_.unit)(d)}`,fontSize:u,lineHeight:m,borderBottom:`${(0,_.unit)(p)} ${g} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${a}-extra`]:{flex:"none"},[`${a}-close`]:Object.assign({display:"inline-flex",width:k(u).add(s).equal(),height:k(u).add(s).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",color:h,fontWeight:$,fontSize:u,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${i}`,textRendering:"auto",[`&${a}-close-end`]:{marginInlineStart:v},[`&:not(${a}-close-end)`]:{marginInlineEnd:v},"&:hover":{color:b,backgroundColor:x,textDecoration:"none"},"&:active":{backgroundColor:y}},(0,L.genFocusStyle)(e)),[`${a}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:u,lineHeight:m},[`${a}-body`]:{flex:1,minWidth:0,minHeight:0,padding:d,overflow:"auto",[`${a}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${a}-footer`]:{flexShrink:0,padding:`${(0,_.unit)(O)} ${(0,_.unit)(C)}`,borderTop:`${(0,_.unit)(p)} ${g} ${f}`},"&-rtl":{direction:"rtl"}}}})(t),(e=>{let{componentCls:t,motionDurationSlow:a}=e;return{[t]:{[`${t}-mask-motion`]:P(0,a),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((e,t)=>{let o;return Object.assign(Object.assign({},e),{[`&-${t}`]:[P(.7,a),z({transform:(o="100%",({left:`translateX(-${o})`,right:`translateX(${o})`,top:`translateY(-${o})`,bottom:`translateY(${o})`})[t])},{transform:"none"})]})},{})}}})(t)]},e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding}));var H=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(a[o[n]]=e[o[n]]);return a};let B={distance:180},V=e=>{let{rootClassName:o,width:n,height:r,size:l="default",mask:i=!0,push:s=B,open:c,afterOpenChange:d,onClose:u,prefixCls:m,getContainer:p,panelRef:g=null,style:v,className:h,"aria-labelledby":b,visible:x,afterVisibleChange:y,maskStyle:A,drawerStyle:T,contentWrapperStyle:N,destroyOnClose:_,destroyOnHidden:L}=e,j=H(e,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),R=(0,O.default)(),z=j.title?R:void 0,{getPopupContainer:P,getPrefixCls:V,direction:W,className:G,style:F,classNames:U,styles:X}=(0,w.useComponentConfig)("drawer"),K=V("drawer",m),[Y,q,Z]=D(K),J=void 0===p&&P?()=>P(document.body):p,Q=(0,a.default)({"no-mask":!i,[`${K}-rtl`]:"rtl"===W},o,q,Z),ee=t.useMemo(()=>null!=n?n:"large"===l?736:378,[n,l]),et=t.useMemo(()=>null!=r?r:"large"===l?736:378,[r,l]),ea={motionName:(0,E.getTransitionName)(K,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},eo=(0,S.usePanelRef)(),en=(0,f.composeRef)(g,eo),[er,el]=(0,k.useZIndex)("Drawer",j.zIndex),{classNames:ei={},styles:es={}}=j;return Y(t.createElement(C.default,{form:!0,space:!0},t.createElement(I.default.Provider,{value:el},t.createElement($,Object.assign({prefixCls:K,onClose:u,maskMotion:ea,motion:e=>({motionName:(0,E.getTransitionName)(K,`panel-motion-${e}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},j,{classNames:{mask:(0,a.default)(ei.mask,U.mask),content:(0,a.default)(ei.content,U.content),wrapper:(0,a.default)(ei.wrapper,U.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},es.mask),A),X.mask),content:Object.assign(Object.assign(Object.assign({},es.content),T),X.content),wrapper:Object.assign(Object.assign(Object.assign({},es.wrapper),N),X.wrapper)},open:null!=c?c:x,mask:i,push:s,width:ee,height:et,style:Object.assign(Object.assign({},F),v),className:(0,a.default)(G,h),rootClassName:Q,getContainer:J,afterOpenChange:null!=d?d:y,panelRef:en,zIndex:er,"aria-labelledby":null!=b?b:z,destroyOnClose:null!=L?L:_}),t.createElement(M,Object.assign({prefixCls:K},j,{ariaId:z,onClose:u}))))))};V._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:o,style:n,className:r,placement:l="right"}=e,i=H(e,["prefixCls","style","className","placement"]),{getPrefixCls:s}=t.useContext(w.ConfigContext),c=s("drawer",o),[d,u,m]=D(c),p=(0,a.default)(c,`${c}-pure`,`${c}-${l}`,u,m,r);return d(t.createElement("div",{className:p,style:n},t.createElement(M,Object.assign({prefixCls:c},i))))},e.s(["Drawer",0,V],608856)},903446,e=>{"use strict";let t=(0,e.i(475254).default)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["default",()=>t])},447593,989022,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645),o={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"},n=e.i(9583),r=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:o}))});e.s(["ClearOutlined",0,r],447593);var l=e.i(843476),i=e.i(592968),s=e.i(637235);let c={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"};var d=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:c}))});let u={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"};var m=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:u}))}),p=e.i(872934),g=e.i(812618),f=e.i(366308),v=e.i(458505);e.s(["default",0,({timeToFirstToken:e,totalLatency:t,usage:a,toolName:o})=>e||t||a?(0,l.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==e&&(0,l.jsx)(i.Tooltip,{title:"Time to first token",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(s.ClockCircleOutlined,{className:"mr-1"}),(0,l.jsxs)("span",{children:["TTFT: ",(e/1e3).toFixed(2),"s"]})]})}),void 0!==t&&(0,l.jsx)(i.Tooltip,{title:"Total latency",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(s.ClockCircleOutlined,{className:"mr-1"}),(0,l.jsxs)("span",{children:["Total Latency: ",(t/1e3).toFixed(2),"s"]})]})}),a?.promptTokens!==void 0&&(0,l.jsx)(i.Tooltip,{title:"Prompt tokens",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(m,{className:"mr-1"}),(0,l.jsxs)("span",{children:["In: ",a.promptTokens]})]})}),a?.completionTokens!==void 0&&(0,l.jsx)(i.Tooltip,{title:"Completion tokens",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(p.ExportOutlined,{className:"mr-1"}),(0,l.jsxs)("span",{children:["Out: ",a.completionTokens]})]})}),a?.reasoningTokens!==void 0&&(0,l.jsx)(i.Tooltip,{title:"Reasoning tokens",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(g.BulbOutlined,{className:"mr-1"}),(0,l.jsxs)("span",{children:["Reasoning: ",a.reasoningTokens]})]})}),a?.totalTokens!==void 0&&(0,l.jsx)(i.Tooltip,{title:"Total tokens",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(d,{className:"mr-1"}),(0,l.jsxs)("span",{children:["Total: ",a.totalTokens]})]})}),a?.cost!==void 0&&(0,l.jsx)(i.Tooltip,{title:"Cost",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(v.DollarOutlined,{className:"mr-1"}),(0,l.jsxs)("span",{children:["$",a.cost.toFixed(6)]})]})}),o&&(0,l.jsx)(i.Tooltip,{title:"Tool used",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(f.ToolOutlined,{className:"mr-1"}),(0,l.jsxs)("span",{children:["Tool: ",o]})]})})]}):null],989022)},132104,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"};var n=e.i(9583),r=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:o}))});e.s(["ArrowUpOutlined",0,r],132104)},245094,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let o={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"};var n=e.i(9583),r=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:o}))});e.s(["CodeOutlined",0,r],245094)},458505,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let o={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"};var n=e.i(9583),r=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:o}))});e.s(["DollarOutlined",0,r],458505)},829672,836938,310730,e=>{"use strict";e.i(247167);var t=e.i(271645),a=e.i(343794),o=e.i(914949),n=e.i(404948);let r=e=>e?"function"==typeof e?e():e:null;e.s(["getRenderPropValue",0,r],836938);var l=e.i(613541),i=e.i(763731),s=e.i(242064),c=e.i(491816);e.i(793154);var d=e.i(880476),u=e.i(183293),m=e.i(717356),p=e.i(320560),g=e.i(307358),f=e.i(246422),v=e.i(838378),h=e.i(617933);let b=(0,f.genStyleHooks)("Popover",e=>{let{colorBgElevated:t,colorText:a}=e,o=(0,v.mergeToken)(e,{popoverBg:t,popoverColor:a});return[(e=>{let{componentCls:t,popoverColor:a,titleMinWidth:o,fontWeightStrong:n,innerPadding:r,boxShadowSecondary:l,colorTextHeading:i,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:d,colorBgElevated:m,popoverBg:g,titleBorderBottom:f,innerContentPadding:v,titlePadding:h}=e;return[{[t]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:g,backgroundClip:"padding-box",borderRadius:s,boxShadow:l,padding:r},[`${t}-title`]:{minWidth:o,marginBottom:d,color:i,fontWeight:n,borderBottom:f,padding:h},[`${t}-inner-content`]:{color:a,padding:v}})},(0,p.default)(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]})(o),(e=>{let{componentCls:t}=e;return{[t]:h.PresetColors.map(a=>{let o=e[`${a}6`];return{[`&${t}-${a}`]:{"--antd-arrow-background-color":o,[`${t}-inner`]:{backgroundColor:o},[`${t}-arrow`]:{background:"transparent"}}}})}})(o),(0,m.initZoomMotion)(o,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:a,fontHeight:o,padding:n,wireframe:r,zIndexPopupBase:l,borderRadiusLG:i,marginXS:s,lineType:c,colorSplit:d,paddingSM:u}=e,m=a-o;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:l+30},(0,g.getArrowToken)(e)),(0,p.getArrowOffsetToken)({contentRadius:i,limitVerticalRadius:!0})),{innerPadding:12*!r,titleMarginBottom:r?0:s,titlePadding:r?`${m/2}px ${n}px ${m/2-t}px`:0,titleBorderBottom:r?`${t}px ${c} ${d}`:"none",innerContentPadding:r?`${u}px ${n}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var x=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(a[o[n]]=e[o[n]]);return a};let y=({title:e,content:a,prefixCls:o})=>e||a?t.createElement(t.Fragment,null,e&&t.createElement("div",{className:`${o}-title`},e),a&&t.createElement("div",{className:`${o}-inner-content`},a)):null,A=e=>{let{hashId:o,prefixCls:n,className:l,style:i,placement:s="top",title:c,content:u,children:m}=e,p=r(c),g=r(u),f=(0,a.default)(o,n,`${n}-pure`,`${n}-placement-${s}`,l);return t.createElement("div",{className:f,style:i},t.createElement("div",{className:`${n}-arrow`}),t.createElement(d.Popup,Object.assign({},e,{className:o,prefixCls:n}),m||t.createElement(y,{prefixCls:n,title:p,content:g})))},$=e=>{let{prefixCls:o,className:n}=e,r=x(e,["prefixCls","className"]),{getPrefixCls:l}=t.useContext(s.ConfigContext),i=l("popover",o),[c,d,u]=b(i);return c(t.createElement(A,Object.assign({},r,{prefixCls:i,hashId:d,className:(0,a.default)(n,u)})))};e.s(["Overlay",0,y,"default",0,$],310730);var O=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(a[o[n]]=e[o[n]]);return a};let C=t.forwardRef((e,d)=>{var u,m;let{prefixCls:p,title:g,content:f,overlayClassName:v,placement:h="top",trigger:x="hover",children:A,mouseEnterDelay:$=.1,mouseLeaveDelay:C=.1,onOpenChange:k,overlayStyle:E={},styles:I,classNames:w}=e,S=O(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:T,className:N,style:M,classNames:_,styles:L}=(0,s.useComponentConfig)("popover"),j=T("popover",p),[R,z,P]=b(j),D=T(),H=(0,a.default)(v,z,P,N,_.root,null==w?void 0:w.root),B=(0,a.default)(_.body,null==w?void 0:w.body),[V,W]=(0,o.default)(!1,{value:null!=(u=e.open)?u:e.visible,defaultValue:null!=(m=e.defaultOpen)?m:e.defaultVisible}),G=(e,t)=>{W(e,!0),null==k||k(e,t)},F=r(g),U=r(f);return R(t.createElement(c.default,Object.assign({placement:h,trigger:x,mouseEnterDelay:$,mouseLeaveDelay:C},S,{prefixCls:j,classNames:{root:H,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},L.root),M),E),null==I?void 0:I.root),body:Object.assign(Object.assign({},L.body),null==I?void 0:I.body)},ref:d,open:V,onOpenChange:e=>{G(e)},overlay:F||U?t.createElement(y,{prefixCls:j,title:F,content:U}):null,transitionName:(0,l.getTransitionName)(D,"zoom-big",S.transitionName),"data-popover-inject":!0}),(0,i.cloneElement)(A,{onKeyDown:e=>{var a,o;(0,t.isValidElement)(A)&&(null==(o=null==A?void 0:(a=A.props).onKeyDown)||o.call(a,e)),e.keyCode===n.default.ESC&&G(!1,e)}})))});C._InternalPanelDoNotUseOrYouWillBeFired=$,e.s(["default",0,C],829672)},282786,e=>{"use strict";var t=e.i(829672);e.s(["Popover",()=>t.default])},219470,812618,e=>{"use strict";e.s(["coy",0,{'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}],219470),e.i(247167);var t=e.i(931067),a=e.i(271645);let o={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"};var n=e.i(9583),r=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:o}))});e.s(["BulbOutlined",0,r],812618)},675879,e=>{"use strict";var t=e.i(843476),a=e.i(191403),o=e.i(135214);e.s(["default",0,()=>{let{accessToken:e}=(0,o.default)();return(0,t.jsx)(a.default,{accessToken:e})}])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/0e6dadb6a51341b5.js b/litellm/proxy/_experimental/out/_next/static/chunks/0e6dadb6a51341b5.js
deleted file mode 100644
index 3fc4e79aa8..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/0e6dadb6a51341b5.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,233525,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},906579,e=>{"use strict";e.i(247167);var t=e.i(271645),a=e.i(343794),r=e.i(361275),n=e.i(702779),o=e.i(763731),l=e.i(242064);e.i(296059);var i=e.i(915654),s=e.i(694758),c=e.i(183293),u=e.i(403541),d=e.i(246422),f=e.i(838378);let m=new s.Keyframes("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new s.Keyframes("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new s.Keyframes("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),h=new s.Keyframes("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),b=new s.Keyframes("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),p=new s.Keyframes("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),w=e=>{let{fontHeight:t,lineWidth:a,marginXS:r,colorBorderBg:n}=e,o=e.colorTextLightSolid,l=e.colorError,i=e.colorErrorHover;return(0,f.mergeToken)(e,{badgeFontHeight:t,badgeShadowSize:a,badgeTextColor:o,badgeColor:l,badgeColorHover:i,badgeShadowColor:n,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},y=e=>{let{fontSize:t,lineHeight:a,fontSizeSM:r,lineWidth:n}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*a)-2*n,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}},S=(0,d.genStyleHooks)("Badge",e=>(e=>{let{componentCls:t,iconCls:a,antCls:r,badgeShadowSize:n,textFontSize:o,textFontSizeSM:l,statusSize:s,dotSize:d,textFontWeight:f,indicatorHeight:w,indicatorHeightSM:y,marginXS:S,calc:O}=e,x=`${r}-scroll-number`,E=(0,u.genPresetColor)(e,(e,{darkColor:a})=>({[`&${t} ${t}-color-${e}`]:{background:a,[`&:not(${t}-count)`]:{color:a},"a:hover &":{background:a}}}));return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,c.resetComponent)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${t}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:w,height:w,color:e.badgeTextColor,fontWeight:f,fontSize:o,lineHeight:(0,i.unit)(w),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:O(w).div(2).equal(),boxShadow:`0 0 0 ${(0,i.unit)(n)} ${e.badgeShadowColor}`,transition:`background ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:y,height:y,fontSize:l,lineHeight:(0,i.unit)(y),borderRadius:O(y).div(2).equal()},[`${t}-multiple-words`]:{padding:`0 ${(0,i.unit)(e.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${t}-dot`]:{zIndex:e.indicatorZIndex,width:d,minWidth:d,height:d,background:e.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${(0,i.unit)(n)} ${e.badgeShadowColor}`},[`${t}-count, ${t}-dot, ${x}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${a}-spin`]:{animationName:p,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${t}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${t}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:"visible",color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:n,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:m,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:S,color:e.colorText,fontSize:e.fontSize}}}),E),{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`${t}-zoom-leave`]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:b,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:"middle"},[`${x}-custom-component, ${t}-count`]:{transform:"none"},[`${x}-custom-component, ${x}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[x]:{overflow:"hidden",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack}`,[`${x}-only`]:{position:"relative",display:"inline-block",height:w,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${x}-only-unit`]:{height:w,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${x}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${t}-count, ${t}-dot, ${x}-custom-component`]:{transform:"translate(-50%, -50%)"}}})}})(w(e)),y),O=(0,d.genStyleHooks)(["Badge","Ribbon"],e=>(e=>{let{antCls:t,badgeFontHeight:a,marginXS:r,badgeRibbonOffset:n,calc:o}=e,l=`${t}-ribbon`,s=`${t}-ribbon-wrapper`,d=(0,u.genPresetColor)(e,(e,{darkColor:t})=>({[`&${l}-color-${e}`]:{background:t,color:t}}));return{[s]:{position:"relative"},[l]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,c.resetComponent)(e)),{position:"absolute",top:r,padding:`0 ${(0,i.unit)(e.paddingXS)}`,color:e.colorPrimary,lineHeight:(0,i.unit)(a),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${l}-text`]:{color:e.badgeTextColor},[`${l}-corner`]:{position:"absolute",top:"100%",width:n,height:n,color:"currentcolor",border:`${(0,i.unit)(o(n).div(2).equal())} solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),d),{[`&${l}-placement-end`]:{insetInlineEnd:o(n).mul(-1).equal(),borderEndEndRadius:0,[`${l}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${l}-placement-start`]:{insetInlineStart:o(n).mul(-1).equal(),borderEndStartRadius:0,[`${l}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}})(w(e)),y),x=e=>{let r,{prefixCls:n,value:o,current:l,offset:i=0}=e;return i&&(r={position:"absolute",top:`${i}00%`,left:0}),t.createElement("span",{style:r,className:(0,a.default)(`${n}-only-unit`,{current:l})},o)},E=e=>{let a,r,{prefixCls:n,count:o,value:l}=e,i=Number(l),s=Math.abs(o),[c,u]=t.useState(i),[d,f]=t.useState(s),m=()=>{u(i),f(s)};if(t.useEffect(()=>{let e=setTimeout(m,1e3);return()=>clearTimeout(e)},[i]),c===i||Number.isNaN(i)||Number.isNaN(c))a=[t.createElement(x,Object.assign({},e,{key:i,current:!0}))],r={transition:"none"};else{a=[];let n=i+10,o=[];for(let e=i;e<=n;e+=1)o.push(e);let l=de%10===c);a=(l<0?o.slice(0,u+1):o.slice(u)).map((a,r)=>t.createElement(x,Object.assign({},e,{key:a,value:a%10,offset:l<0?r-u:r,current:r===u}))),r={transform:`translateY(${-function(e,t,a){let r=e,n=0;for(;(r+10)%10!==t;)r+=a,n+=a;return n}(c,i,l)}00%)`}}return t.createElement("span",{className:`${n}-only`,style:r,onTransitionEnd:m},a)};var $=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a};let z=t.forwardRef((e,r)=>{let{prefixCls:n,count:i,className:s,motionClassName:c,style:u,title:d,show:f,component:m="sup",children:g}=e,v=$(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:h}=t.useContext(l.ConfigContext),b=h("scroll-number",n),p=Object.assign(Object.assign({},v),{"data-show":f,style:u,className:(0,a.default)(b,s,c),title:d}),w=i;if(i&&Number(i)%1==0){let e=String(i).split("");w=t.createElement("bdi",null,e.map((a,r)=>t.createElement(E,{prefixCls:b,count:Number(i),value:a,key:e.length-r})))}return((null==u?void 0:u.borderColor)&&(p.style=Object.assign(Object.assign({},u),{boxShadow:`0 0 0 1px ${u.borderColor} inset`})),g)?(0,o.cloneElement)(g,e=>({className:(0,a.default)(`${b}-custom-component`,null==e?void 0:e.className,c)})):t.createElement(m,Object.assign({},p,{ref:r}),w)});var _=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a};let C=t.forwardRef((e,i)=>{var s,c,u,d,f;let{prefixCls:m,scrollNumberPrefixCls:g,children:v,status:h,text:b,color:p,count:w=null,overflowCount:y=99,dot:O=!1,size:x="default",title:E,offset:$,style:C,className:j,rootClassName:k,classNames:L,styles:N,showZero:M=!1}=e,T=_(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:I,direction:R,badge:B}=t.useContext(l.ConfigContext),P=I("badge",m),[H,V,A]=S(P),D=w>y?`${y}+`:w,U="0"===D||0===D||"0"===b||0===b,F=null===w||U&&!M,W=(null!=h||null!=p)&&F,K=null!=h||!U,G=O&&!U,Z=G?"":D,q=(0,t.useMemo)(()=>((null==Z||""===Z)&&(null==b||""===b)||U&&!M)&&!G,[Z,U,M,G,b]),X=(0,t.useRef)(w);q||(X.current=w);let Y=X.current,J=(0,t.useRef)(Z);q||(J.current=Z);let Q=J.current,ee=(0,t.useRef)(G);q||(ee.current=G);let et=(0,t.useMemo)(()=>{if(!$)return Object.assign(Object.assign({},null==B?void 0:B.style),C);let e={marginTop:$[1]};return"rtl"===R?e.left=Number.parseInt($[0],10):e.right=-Number.parseInt($[0],10),Object.assign(Object.assign(Object.assign({},e),null==B?void 0:B.style),C)},[R,$,C,null==B?void 0:B.style]),ea=null!=E?E:"string"==typeof Y||"number"==typeof Y?Y:void 0,er=!q&&(0===b?M:!!b&&!0!==b),en=er?t.createElement("span",{className:`${P}-status-text`},b):null,eo=Y&&"object"==typeof Y?(0,o.cloneElement)(Y,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,el=(0,n.isPresetColor)(p,!1),ei=(0,a.default)(null==L?void 0:L.indicator,null==(s=null==B?void 0:B.classNames)?void 0:s.indicator,{[`${P}-status-dot`]:W,[`${P}-status-${h}`]:!!h,[`${P}-color-${p}`]:el}),es={};p&&!el&&(es.color=p,es.background=p);let ec=(0,a.default)(P,{[`${P}-status`]:W,[`${P}-not-a-wrapper`]:!v,[`${P}-rtl`]:"rtl"===R},j,k,null==B?void 0:B.className,null==(c=null==B?void 0:B.classNames)?void 0:c.root,null==L?void 0:L.root,V,A);if(!v&&W&&(b||K||!F)){let e=et.color;return H(t.createElement("span",Object.assign({},T,{className:ec,style:Object.assign(Object.assign(Object.assign({},null==N?void 0:N.root),null==(u=null==B?void 0:B.styles)?void 0:u.root),et)}),t.createElement("span",{className:ei,style:Object.assign(Object.assign(Object.assign({},null==N?void 0:N.indicator),null==(d=null==B?void 0:B.styles)?void 0:d.indicator),es)}),er&&t.createElement("span",{style:{color:e},className:`${P}-status-text`},b)))}return H(t.createElement("span",Object.assign({ref:i},T,{className:ec,style:Object.assign(Object.assign({},null==(f=null==B?void 0:B.styles)?void 0:f.root),null==N?void 0:N.root)}),v,t.createElement(r.default,{visible:!q,motionName:`${P}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:e})=>{var r,n;let o=I("scroll-number",g),l=ee.current,i=(0,a.default)(null==L?void 0:L.indicator,null==(r=null==B?void 0:B.classNames)?void 0:r.indicator,{[`${P}-dot`]:l,[`${P}-count`]:!l,[`${P}-count-sm`]:"small"===x,[`${P}-multiple-words`]:!l&&Q&&Q.toString().length>1,[`${P}-status-${h}`]:!!h,[`${P}-color-${p}`]:el}),s=Object.assign(Object.assign(Object.assign({},null==N?void 0:N.indicator),null==(n=null==B?void 0:B.styles)?void 0:n.indicator),et);return p&&!el&&((s=s||{}).background=p),t.createElement(z,{prefixCls:o,show:!q,motionClassName:e,className:i,count:Q,title:ea,style:s,key:"scrollNumber"},eo)}),en))});C.Ribbon=e=>{let{className:r,prefixCls:o,style:i,color:s,children:c,text:u,placement:d="end",rootClassName:f}=e,{getPrefixCls:m,direction:g}=t.useContext(l.ConfigContext),v=m("ribbon",o),h=`${v}-wrapper`,[b,p,w]=O(v,h),y=(0,n.isPresetColor)(s,!1),S=(0,a.default)(v,`${v}-placement-${d}`,{[`${v}-rtl`]:"rtl"===g,[`${v}-color-${s}`]:y},r),x={},E={};return s&&!y&&(x.background=s,E.color=s),b(t.createElement("div",{className:(0,a.default)(h,f,p,w)},c,t.createElement("div",{className:(0,a.default)(S,p),style:Object.assign(Object.assign({},x),i)},t.createElement("span",{className:`${v}-text`},u),t.createElement("div",{className:`${v}-corner`,style:E}))))},e.s(["Badge",0,C],906579)},44121,186515,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["MenuFoldOutlined",0,o],44121);let l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"};var i=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:l}))});e.s(["MenuUnfoldOutlined",0,i],186515)},295320,283713,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M704 446H320c-4.4 0-8 3.6-8 8v402c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8V454c0-4.4-3.6-8-8-8zm-328 64h272v117H376V510zm272 290H376V683h272v117z"}},{tag:"path",attrs:{d:"M424 748a32 32 0 1064 0 32 32 0 10-64 0zm0-178a32 32 0 1064 0 32 32 0 10-64 0z"}},{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}}]},name:"cloud-server",theme:"outlined"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["CloudServerOutlined",0,o],295320);var l=e.i(764205),i=e.i(612256);let s="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,i.useUIConfig)(),t=e?.is_control_plane??!1,r=e?.workers??[],[n,o]=(0,a.useState)(()=>localStorage.getItem(s));(0,a.useEffect)(()=>{if(!n||0===r.length)return;let e=r.find(e=>e.worker_id===n);e&&(0,l.switchToWorkerUrl)(e.url)},[n,r]);let c=r.find(e=>e.worker_id===n)??null,u=(0,a.useCallback)(e=>{let t=r.find(t=>t.worker_id===e);t&&(o(e),localStorage.setItem(s,e),(0,l.switchToWorkerUrl)(t.url))},[r]);return{isControlPlane:t,workers:r,selectedWorkerId:n,selectedWorker:c,selectWorker:u,disconnectFromWorker:(0,a.useCallback)(()=>{o(null),localStorage.removeItem(s),(0,l.switchToWorkerUrl)(null)},[])}}],283713)},755151,e=>{"use strict";var t=e.i(247153);e.s(["DownOutlined",()=>t.default])},326373,e=>{"use strict";var t=e.i(21539);e.s(["Dropdown",()=>t.default])},818581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return n}});let r=e.r(271645);function n(e,t){let a=(0,r.useRef)(null),n=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=a.current;e&&(a.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(a.current=o(e,r)),t&&(n.current=o(t,r))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},62478,e=>{"use strict";var t=e.i(764205);let a=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,a])},602073,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["SafetyOutlined",0,o],602073)},100486,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["CrownOutlined",0,o],100486)},275144,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(764205);let n=(0,a.createContext)(void 0);e.s(["ThemeProvider",0,({children:e,accessToken:o})=>{let[l,i]=(0,a.useState)(null),[s,c]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{try{let e=(0,r.getProxyBaseUrl)(),t=e?`${e}/get/ui_theme_settings`:"/get/ui_theme_settings",a=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(a.ok){let e=await a.json();e.values?.logo_url&&i(e.values.logo_url),e.values?.favicon_url&&c(e.values.favicon_url)}}catch(e){console.warn("Failed to load theme settings from backend:",e)}})()},[]),(0,a.useEffect)(()=>{if(s){let e=document.querySelectorAll("link[rel*='icon']");if(e.length>0)e.forEach(e=>{e.href=s});else{let e=document.createElement("link");e.rel="icon",e.href=s,document.head.appendChild(e)}}},[s]),(0,t.jsx)(n.Provider,{value:{logoUrl:l,setLogoUrl:i,faviconUrl:s,setFaviconUrl:c},children:e})},"useTheme",0,()=>{let e=(0,a.useContext)(n);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e}])},928685,e=>{"use strict";var t=e.i(38953);e.s(["SearchOutlined",()=>t.default])},115571,e=>{"use strict";let t="local-storage-change";function a(e){window.dispatchEvent(new CustomEvent(t,{detail:{key:e}}))}function r(e){try{return window.localStorage.getItem(e)}catch(t){return console.warn(`Error reading localStorage key "${e}":`,t),null}}function n(e,t){try{window.localStorage.setItem(e,t)}catch(t){console.warn(`Error setting localStorage key "${e}":`,t)}}function o(e){try{window.localStorage.removeItem(e)}catch(t){console.warn(`Error removing localStorage key "${e}":`,t)}}e.s(["LOCAL_STORAGE_EVENT",0,t,"emitLocalStorageChange",()=>a,"getLocalStorageItem",()=>r,"removeLocalStorageItem",()=>o,"setLocalStorageItem",()=>n])},371401,e=>{"use strict";var t=e.i(115571),a=e.i(271645);function r(e){let a=t=>{"disableUsageIndicator"===t.key&&e()},r=t=>{let{key:a}=t.detail;"disableUsageIndicator"===a&&e()};return window.addEventListener("storage",a),window.addEventListener(t.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",a),window.removeEventListener(t.LOCAL_STORAGE_EVENT,r)}}function n(){return"true"===(0,t.getLocalStorageItem)("disableUsageIndicator")}function o(){return(0,a.useSyncExternalStore)(r,n)}e.s(["useDisableUsageIndicator",()=>o])},19732,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["ExperimentOutlined",0,o],19732)},788191,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["PlayCircleOutlined",0,o],788191)},399219,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["default",()=>t])},299251,153702,777579,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["BankOutlined",0,o],299251);let l={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"};var i=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:l}))});e.s(["BarChartOutlined",0,i],153702);let s={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"};var c=a.forwardRef(function(e,r){return a.createElement(n.default,(0,t.default)({},e,{ref:r,icon:s}))});e.s(["LineChartOutlined",0,c],777579)},878894,664659,531278,e=>{"use strict";var t=e.i(582458);e.s(["AlertTriangle",()=>t.default],878894);var a=e.i(631171);e.s(["ChevronDown",()=>a.default],664659);let r=(0,e.i(475254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",()=>r],531278)},582458,e=>{"use strict";let t=(0,e.i(475254).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",()=>t])},438957,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["KeyOutlined",0,o],438957)},366308,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["ToolOutlined",0,o],366308)},313603,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["SettingOutlined",0,o],313603)},872934,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["ExportOutlined",0,o],872934)},232164,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["TagsOutlined",0,o],232164)},210612,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["DatabaseOutlined",0,o],210612)},218129,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["ApiOutlined",0,o],218129)},844444,e=>{"use strict";var t=e.i(843476),a=e.i(906579),r=e.i(271645),n=e.i(115571);function o(e){let t=t=>{"disableShowNewBadge"===t.key&&e()},a=t=>{let{key:a}=t.detail;"disableShowNewBadge"===a&&e()};return window.addEventListener("storage",t),window.addEventListener(n.LOCAL_STORAGE_EVENT,a),()=>{window.removeEventListener("storage",t),window.removeEventListener(n.LOCAL_STORAGE_EVENT,a)}}function l(){return"true"===(0,n.getLocalStorageItem)("disableShowNewBadge")}function i({children:e,dot:n=!1}){return(0,r.useSyncExternalStore)(o,l)?e?(0,t.jsx)(t.Fragment,{children:e}):null:e?(0,t.jsx)(a.Badge,{color:"blue",count:n?void 0:"New",dot:n,children:e}):(0,t.jsx)(a.Badge,{color:"blue",count:n?void 0:"New",dot:n})}e.s(["default",()=>i],844444)},477189,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let r={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"};var n=e.i(9583),o=a.forwardRef(function(e,o){return a.createElement(n.default,(0,t.default)({},e,{ref:o,icon:r}))});e.s(["AppstoreOutlined",0,o],477189)},902739,e=>{"use strict";var t=e.i(843476),a=e.i(111672),r=e.i(764205),n=e.i(135214),o=e.i(271645);e.s(["default",0,({setPage:e,defaultSelectedKey:l,sidebarCollapsed:i})=>{let{accessToken:s}=(0,n.default)(),[c,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(!1),[m,g]=(0,o.useState)(!1),[v,h]=(0,o.useState)(!1),[b,p]=(0,o.useState)(!1),[w,y]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{(async()=>{if(!s)return console.log("[SidebarProvider] No access token, skipping UI settings fetch");try{console.log("[SidebarProvider] Fetching UI settings from /get/ui_settings");let e=await (0,r.getUISettings)(s);console.log("[SidebarProvider] UI settings response:",e),e?.values?.enabled_ui_pages_internal_users!==void 0?(console.log("[SidebarProvider] Setting enabled pages:",e.values.enabled_ui_pages_internal_users),u(e.values.enabled_ui_pages_internal_users)):console.log("[SidebarProvider] No enabled_ui_pages_internal_users in response (all pages visible by default)"),e?.values?.enable_projects_ui!==void 0&&f(!!e.values.enable_projects_ui),e?.values?.disable_agents_for_internal_users!==void 0&&g(!!e.values.disable_agents_for_internal_users),e?.values?.allow_agents_for_team_admins!==void 0&&h(!!e.values.allow_agents_for_team_admins),e?.values?.disable_vector_stores_for_internal_users!==void 0&&p(!!e.values.disable_vector_stores_for_internal_users),e?.values?.allow_vector_stores_for_team_admins!==void 0&&y(!!e.values.allow_vector_stores_for_team_admins)}catch(e){console.error("[SidebarProvider] Failed to fetch UI settings:",e)}})()},[s]),(0,t.jsx)(a.default,{setPage:e,defaultSelectedKey:l,collapsed:i,enabledPagesInternalUsers:c,enableProjectsUI:d,disableAgentsForInternalUsers:m,allowAgentsForTeamAdmins:v,disableVectorStoresForInternalUsers:b,allowVectorStoresForTeamAdmins:w})}])},216370,e=>{"use strict";var t=e.i(247167),a=e.i(843476),r=e.i(271645),n=e.i(402874),o=e.i(275144),l=e.i(902739),i=e.i(135214),s=e.i(618566),c=e.i(560445),u=e.i(521323);let d=()=>{let{data:e}=(0,u.useHealthReadiness)();return e?.is_detailed_debug?(0,a.jsx)(c.Alert,{message:"Performance Warning: Detailed Debug Mode Active",description:(0,a.jsxs)(a.Fragment,{children:["Detailed debug logging (",(0,a.jsx)("code",{children:"LITELLM_LOG=DEBUG"}),") is currently enabled. This mode logs extensive diagnostic information and will significantly degrade performance. It should only be used for troubleshooting and disabled in production environments."]}),type:"warning",showIcon:!0,banner:!0,style:{marginBottom:0,borderRadius:0}}):null},f=function(e){let t=(e??"").trim();if(!t)return"";let a=t.replace(/^\/+/,"").replace(/\/+$/,"");return a?`/${a}/`:"/"}(t.default.env.NEXT_PUBLIC_BASE_URL);function m(e){let t=e.startsWith("/")?e.slice(1):e,a=`${f}${t}`;return a.startsWith("/")?a:`/${a}`}let g={"api-reference":"api-reference"};function v({children:e}){let t=(0,s.useRouter)(),c=(0,s.useSearchParams)(),{accessToken:u,userRole:f,userId:v,userEmail:h,premiumUser:b}=(0,i.default)(),[p,w]=r.default.useState(!1),[y,S]=(0,r.useState)(()=>c.get("page")||"api-keys");return(0,r.useEffect)(()=>{S(c.get("page")||"api-keys")},[c]),(0,a.jsx)(o.ThemeProvider,{accessToken:"",children:(0,a.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,a.jsx)(n.default,{isPublicPage:!1,sidebarCollapsed:p,onToggleSidebar:()=>w(e=>!e),userID:v,userEmail:h,userRole:f,premiumUser:b,proxySettings:void 0,setProxySettings:()=>{},accessToken:u,isDarkMode:!1,toggleDarkMode:()=>{}}),(0,a.jsx)(d,{}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(l.default,{setPage:e=>{let a=g[e];if(a){t.push(m(a)),S(e);return}t.push(m(`?page=${e}`)),S(e)},defaultSelectedKey:y,sidebarCollapsed:p})}),(0,a.jsx)("main",{className:"flex-1",children:e})]})]})})}function h({children:e}){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}),children:(0,a.jsx)(v,{children:e})})}e.s(["default",()=>h],216370)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/0f59b35ee0664fe0.js b/litellm/proxy/_experimental/out/_next/static/chunks/0f59b35ee0664fe0.js
deleted file mode 100644
index 3f1d0dc953..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/0f59b35ee0664fe0.js
+++ /dev/null
@@ -1,7 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),o=e.i(673706),n=e.i(271645);let a=n.default.forwardRef((e,a)=>{let{color:i,className:l,children:s}=e;return n.default.createElement("p",{ref:a,className:(0,r.tremorTwMerge)("text-tremor-default",i?(0,o.getColorClassNames)(i,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),l)},s)});a.displayName="Text",e.s(["default",()=>a],936325),e.s(["Text",()=>a],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),o=e.i(480731),n=e.i(95779),a=e.i(444755),i=e.i(673706);let l=(0,i.makeClassName)("Card"),s=r.default.forwardRef((e,s)=>{let{decoration:c="",decorationColor:u,children:d,className:f}=e,p=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:s,className:(0,a.tremorTwMerge)(l("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",u?(0,i.getColorClassNames)(u,n.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case o.HorizontalPositions.Left:return"border-l-4";case o.VerticalPositions.Top:return"border-t-4";case o.HorizontalPositions.Right:return"border-r-4";case o.VerticalPositions.Bottom:return"border-b-4";default:return""}})(c),f)},p),d)});s.displayName="Card",e.s(["Card",()=>s],304967)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),o=e.i(444755),n=e.i(673706),a=e.i(271645);let i=a.default.forwardRef((e,i)=>{let{color:l,children:s,className:c}=e,u=(0,t.__rest)(e,["color","children","className"]);return a.default.createElement("p",Object.assign({ref:i,className:(0,o.tremorTwMerge)("font-medium text-tremor-title",l?(0,n.getColorClassNames)(l,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},u),s)});i.displayName="Title",e.s(["Title",()=>i],629569)},91874,e=>{"use strict";var t=e.i(931067),r=e.i(209428),o=e.i(211577),n=e.i(392221),a=e.i(703923),i=e.i(343794),l=e.i(914949),s=e.i(271645),c=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],u=(0,s.forwardRef)(function(e,u){var d=e.prefixCls,f=void 0===d?"rc-checkbox":d,p=e.className,m=e.style,g=e.checked,b=e.disabled,h=e.defaultChecked,v=e.type,y=void 0===v?"checkbox":v,$=e.title,C=e.onChange,k=(0,a.default)(e,c),x=(0,s.useRef)(null),S=(0,s.useRef)(null),w=(0,l.default)(void 0!==h&&h,{value:g}),O=(0,n.default)(w,2),E=O[0],j=O[1];(0,s.useImperativeHandle)(u,function(){return{focus:function(e){var t;null==(t=x.current)||t.focus(e)},blur:function(){var e;null==(e=x.current)||e.blur()},input:x.current,nativeElement:S.current}});var N=(0,i.default)(f,p,(0,o.default)((0,o.default)({},"".concat(f,"-checked"),E),"".concat(f,"-disabled"),b));return s.createElement("span",{className:N,title:$,style:m,ref:S},s.createElement("input",(0,t.default)({},k,{className:"".concat(f,"-input"),ref:x,onChange:function(t){b||("checked"in e||j(t.target.checked),null==C||C({target:(0,r.default)((0,r.default)({},e),{},{type:y,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:b,checked:!!E,type:y})),s.createElement("span",{className:"".concat(f,"-inner")}))});e.s(["default",0,u])},421512,236836,e=>{"use strict";let t=e.i(271645).default.createContext(null);e.s(["default",0,t],421512),e.i(296059);var r=e.i(915654),o=e.i(183293),n=e.i(246422),a=e.i(838378);function i(e,t){return(e=>{let{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:Object.assign(Object.assign({},(0,o.resetComponent)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[n]:Object.assign(Object.assign({},(0,o.resetComponent)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},(0,o.resetComponent)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:(0,o.genFocusOutline)(e)},[`${t}-inner`]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${(0,r.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:`${(0,r.unit)(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`
- ${n}:not(${n}-disabled),
- ${t}:not(${t}-disabled)
- `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`
- ${n}-checked:not(${n}-disabled),
- ${t}-checked:not(${t}-disabled)
- `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]})((0,a.mergeToken)(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}let l=(0,n.genStyleHooks)("Checkbox",(e,{prefixCls:t})=>[i(t,e)]);e.s(["default",0,l,"getStyle",()=>i],236836)},681216,e=>{"use strict";var t=e.i(271645),r=e.i(963188);function o(e){let o=t.default.useRef(null),n=()=>{r.default.cancel(o.current),o.current=null};return[()=>{n(),o.current=(0,r.default)(()=>{o.current=null})},t=>{o.current&&(t.stopPropagation(),n()),null==e||e(t)}]}e.s(["default",()=>o])},374276,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),o=e.i(91874),n=e.i(611935),a=e.i(121872),i=e.i(26905),l=e.i(242064),s=e.i(937328),c=e.i(321883),u=e.i(62139),d=e.i(421512),f=e.i(236836),p=e.i(681216),m=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r};let g=t.forwardRef((e,g)=>{var b;let{prefixCls:h,className:v,rootClassName:y,children:$,indeterminate:C=!1,style:k,onMouseEnter:x,onMouseLeave:S,skipGroup:w=!1,disabled:O}=e,E=m(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:j,direction:N,checkbox:P}=t.useContext(l.ConfigContext),I=t.useContext(d.default),{isFormItemInput:T}=t.useContext(u.FormItemInputContext),R=t.useContext(s.default),D=null!=(b=(null==I?void 0:I.disabled)||O)?b:R,z=t.useRef(E.value),M=t.useRef(null),A=(0,n.composeRef)(g,M);t.useEffect(()=>{null==I||I.registerValue(E.value)},[]),t.useEffect(()=>{if(!w)return E.value!==z.current&&(null==I||I.cancelValue(z.current),null==I||I.registerValue(E.value),z.current=E.value),()=>null==I?void 0:I.cancelValue(E.value)},[E.value]),t.useEffect(()=>{var e;(null==(e=M.current)?void 0:e.input)&&(M.current.input.indeterminate=C)},[C]);let W=j("checkbox",h),B=(0,c.default)(W),[F,L,X]=(0,f.default)(W,B),_=Object.assign({},E);I&&!w&&(_.onChange=(...e)=>{E.onChange&&E.onChange.apply(E,e),I.toggleOption&&I.toggleOption({label:$,value:E.value})},_.name=I.name,_.checked=I.value.includes(E.value));let H=(0,r.default)(`${W}-wrapper`,{[`${W}-rtl`]:"rtl"===N,[`${W}-wrapper-checked`]:_.checked,[`${W}-wrapper-disabled`]:D,[`${W}-wrapper-in-form-item`]:T},null==P?void 0:P.className,v,y,X,B,L),q=(0,r.default)({[`${W}-indeterminate`]:C},i.TARGET_CLS,L),[V,G]=(0,p.default)(_.onClick);return F(t.createElement(a.default,{component:"Checkbox",disabled:D},t.createElement("label",{className:H,style:Object.assign(Object.assign({},null==P?void 0:P.style),k),onMouseEnter:x,onMouseLeave:S,onClick:V},t.createElement(o.default,Object.assign({},_,{onClick:G,prefixCls:W,className:q,disabled:D,ref:A})),null!=$&&t.createElement("span",{className:`${W}-label`},$))))});var b=e.i(8211),h=e.i(529681),v=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r};let y=t.forwardRef((e,o)=>{let{defaultValue:n,children:a,options:i=[],prefixCls:s,className:u,rootClassName:p,style:m,onChange:y}=e,$=v(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:C,direction:k}=t.useContext(l.ConfigContext),[x,S]=t.useState($.value||n||[]),[w,O]=t.useState([]);t.useEffect(()=>{"value"in $&&S($.value||[])},[$.value]);let E=t.useMemo(()=>i.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[i]),j=e=>{O(t=>t.filter(t=>t!==e))},N=e=>{O(t=>[].concat((0,b.default)(t),[e]))},P=e=>{let t=x.indexOf(e.value),r=(0,b.default)(x);-1===t?r.push(e.value):r.splice(t,1),"value"in $||S(r),null==y||y(r.filter(e=>w.includes(e)).sort((e,t)=>E.findIndex(t=>t.value===e)-E.findIndex(e=>e.value===t)))},I=C("checkbox",s),T=`${I}-group`,R=(0,c.default)(I),[D,z,M]=(0,f.default)(I,R),A=(0,h.default)($,["value","disabled"]),W=i.length?E.map(e=>t.createElement(g,{prefixCls:I,key:e.value.toString(),disabled:"disabled"in e?e.disabled:$.disabled,value:e.value,checked:x.includes(e.value),onChange:e.onChange,className:(0,r.default)(`${T}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,B=t.useMemo(()=>({toggleOption:P,value:x,disabled:$.disabled,name:$.name,registerValue:N,cancelValue:j}),[P,x,$.disabled,$.name,N,j]),F=(0,r.default)(T,{[`${T}-rtl`]:"rtl"===k},u,p,M,R,z);return D(t.createElement("div",Object.assign({className:F,style:m},A,{ref:o}),t.createElement(d.default.Provider,{value:B},W)))});g.Group=y,g.__ANT_CHECKBOX=!0,e.s(["default",0,g],374276)},309821,e=>{"use strict";e.i(247167);var t=e.i(271645);e.i(262370);var r=e.i(135551),o=e.i(201072),n=e.i(121229),a=e.i(726289),i=e.i(864517),l=e.i(343794),s=e.i(529681),c=e.i(242064),u=e.i(931067),d=e.i(209428),f=e.i(703923),p={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},m=function(){var e=(0,t.useRef)([]),r=(0,t.useRef)(null);return(0,t.useEffect)(function(){var t=Date.now(),o=!1;e.current.forEach(function(e){if(e){o=!0;var n=e.style;n.transitionDuration=".3s, .3s, .3s, .06s",r.current&&t-r.current<100&&(n.transitionDuration="0s, 0s")}}),o&&(r.current=Date.now())}),e.current},g=e.i(410160),b=e.i(392221),h=e.i(654310),v=0,y=(0,h.default)();let $=function(e){var r=t.useState(),o=(0,b.default)(r,2),n=o[0],a=o[1];return t.useEffect(function(){var e;a("rc_progress_".concat((y?(e=v,v+=1):e="TEST_OR_SSR",e)))},[]),e||n};var C=function(e){var r=e.bg,o=e.children;return t.createElement("div",{style:{width:"100%",height:"100%",background:r}},o)};function k(e,t){return Object.keys(e).map(function(r){var o=parseFloat(r),n="".concat(Math.floor(o*t),"%");return"".concat(e[r]," ").concat(n)})}var x=t.forwardRef(function(e,r){var o=e.prefixCls,n=e.color,a=e.gradientId,i=e.radius,l=e.style,s=e.ptg,c=e.strokeLinecap,u=e.strokeWidth,d=e.size,f=e.gapDegree,p=n&&"object"===(0,g.default)(n),m=d/2,b=t.createElement("circle",{className:"".concat(o,"-circle-path"),r:i,cx:m,cy:m,stroke:p?"#FFF":void 0,strokeLinecap:c,strokeWidth:u,opacity:+(0!==s),style:l,ref:r});if(!p)return b;var h="".concat(a,"-conic"),v=k(n,(360-f)/360),y=k(n,1),$="conic-gradient(from ".concat(f?"".concat(180+f/2,"deg"):"0deg",", ").concat(v.join(", "),")"),x="linear-gradient(to ".concat(f?"bottom":"top",", ").concat(y.join(", "),")");return t.createElement(t.Fragment,null,t.createElement("mask",{id:h},b),t.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(h,")")},t.createElement(C,{bg:x},t.createElement(C,{bg:$}))))}),S=function(e,t,r,o,n,a,i,l,s,c){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=(100-o)/100*t;return"round"===s&&100!==o&&(d+=c/2)>=t&&(d=t-.01),{stroke:"string"==typeof l?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(n+r/100*360*((360-a)/360)+(0===a?0:({bottom:0,top:180,left:90,right:-90})[i]),"deg)"),transformOrigin:"".concat(50,"px ").concat(50,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},w=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function O(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}let E=function(e){var r,o,n,a,i=(0,d.default)((0,d.default)({},p),e),s=i.id,c=i.prefixCls,b=i.steps,h=i.strokeWidth,v=i.trailWidth,y=i.gapDegree,C=void 0===y?0:y,k=i.gapPosition,E=i.trailColor,j=i.strokeLinecap,N=i.style,P=i.className,I=i.strokeColor,T=i.percent,R=(0,f.default)(i,w),D=$(s),z="".concat(D,"-gradient"),M=50-h/2,A=2*Math.PI*M,W=C>0?90+C/2:-90,B=(360-C)/360*A,F="object"===(0,g.default)(b)?b:{count:b,gap:2},L=F.count,X=F.gap,_=O(T),H=O(I),q=H.find(function(e){return e&&"object"===(0,g.default)(e)}),V=q&&"object"===(0,g.default)(q)?"butt":j,G=S(A,B,0,100,W,C,k,E,V,h),K=m();return t.createElement("svg",(0,u.default)({className:(0,l.default)("".concat(c,"-circle"),P),viewBox:"0 0 ".concat(100," ").concat(100),style:N,id:s,role:"presentation"},R),!L&&t.createElement("circle",{className:"".concat(c,"-circle-trail"),r:M,cx:50,cy:50,stroke:E,strokeLinecap:V,strokeWidth:v||h,style:G}),L?(r=Math.round(L*(_[0]/100)),o=100/L,n=0,Array(L).fill(null).map(function(e,a){var i=a<=r-1?H[0]:E,l=i&&"object"===(0,g.default)(i)?"url(#".concat(z,")"):void 0,s=S(A,B,n,o,W,C,k,i,"butt",h,X);return n+=(B-s.strokeDashoffset+X)*100/B,t.createElement("circle",{key:a,className:"".concat(c,"-circle-path"),r:M,cx:50,cy:50,stroke:l,strokeWidth:h,opacity:1,style:s,ref:function(e){K[a]=e}})})):(a=0,_.map(function(e,r){var o=H[r]||H[H.length-1],n=S(A,B,a,e,W,C,k,o,V,h);return a+=e,t.createElement(x,{key:r,color:o,ptg:e,radius:M,prefixCls:c,gradientId:z,style:n,strokeLinecap:V,strokeWidth:h,gapDegree:C,ref:function(e){K[r]=e},size:100})}).reverse()))};var j=e.i(491816);e.i(765846);var N=e.i(896091);function P(e){return!e||e<0?0:e>100?100:e}function I({success:e,successPercent:t}){let r=t;return e&&"progress"in e&&(r=e.progress),e&&"percent"in e&&(r=e.percent),r}let T=(e,t,r)=>{var o,n,a,i;let l=-1,s=-1;if("step"===t){let t=r.steps,o=r.strokeWidth;"string"==typeof e||void 0===e?(l="small"===e?2:14,s=null!=o?o:8):"number"==typeof e?[l,s]=[e,e]:[l=14,s=8]=Array.isArray(e)?e:[e.width,e.height],l*=t}else if("line"===t){let t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?s=t||("small"===e?6:8):"number"==typeof e?[l,s]=[e,e]:[l=-1,s=8]=Array.isArray(e)?e:[e.width,e.height]}else("circle"===t||"dashboard"===t)&&("string"==typeof e||void 0===e?[l,s]="small"===e?[60,60]:[120,120]:"number"==typeof e?[l,s]=[e,e]:Array.isArray(e)&&(l=null!=(n=null!=(o=e[0])?o:e[1])?n:120,s=null!=(i=null!=(a=e[0])?a:e[1])?i:120));return[l,s]},R=e=>{let{prefixCls:r,trailColor:o=null,strokeLinecap:n="round",gapPosition:a,gapDegree:i,width:s=120,type:c,children:u,success:d,size:f=s,steps:p}=e,[m,g]=T(f,"circle"),{strokeWidth:b}=e;void 0===b&&(b=Math.max(3/m*100,6));let h=t.useMemo(()=>i||0===i?i:"dashboard"===c?75:void 0,[i,c]),v=(({percent:e,success:t,successPercent:r})=>{let o=P(I({success:t,successPercent:r}));return[o,P(P(e)-o)]})(e),y="[object Object]"===Object.prototype.toString.call(e.strokeColor),$=(({success:e={},strokeColor:t})=>{let{strokeColor:r}=e;return[r||N.presetPrimaryColors.green,t||null]})({success:d,strokeColor:e.strokeColor}),C=(0,l.default)(`${r}-inner`,{[`${r}-circle-gradient`]:y}),k=t.createElement(E,{steps:p,percent:p?v[1]:v,strokeWidth:b,trailWidth:b,strokeColor:p?$[1]:$,strokeLinecap:n,trailColor:o,prefixCls:r,gapDegree:h,gapPosition:a||"dashboard"===c&&"bottom"||void 0}),x=m<=20,S=t.createElement("div",{className:C,style:{width:m,height:g,fontSize:.15*m+6}},k,!x&&u);return x?t.createElement(j.default,{title:u},S):S};e.i(296059);var D=e.i(694758),z=e.i(915654),M=e.i(183293),A=e.i(246422),W=e.i(838378);let B="--progress-line-stroke-color",F="--progress-percent",L=e=>{let t=e?"100%":"-100%";return new D.Keyframes(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},X=(0,A.genStyleHooks)("Progress",e=>{let t=e.calc(e.marginXXS).div(2).equal(),r=(0,W.mergeToken)(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,M.resetComponent)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${B})`]},height:"100%",width:`calc(1 / var(${F}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${(0,z.unit)(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:L(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:L(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}})(r),(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}})(r),(e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}})(r),(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}})(r)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}));var _=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r};let H=e=>{let{prefixCls:r,direction:o,percent:n,size:a,strokeWidth:i,strokeColor:s,strokeLinecap:c="round",children:u,trailColor:d=null,percentPosition:f,success:p}=e,{align:m,type:g}=f,b=s&&"string"!=typeof s?((e,t)=>{let{from:r=N.presetPrimaryColors.blue,to:o=N.presetPrimaryColors.blue,direction:n="rtl"===t?"to left":"to right"}=e,a=_(e,["from","to","direction"]);if(0!==Object.keys(a).length){let e,t=(e=[],Object.keys(a).forEach(t=>{let r=Number.parseFloat(t.replace(/%/g,""));Number.isNaN(r)||e.push({key:r,value:a[t]})}),(e=e.sort((e,t)=>e.key-t.key)).map(({key:e,value:t})=>`${t} ${e}%`).join(", ")),r=`linear-gradient(${n}, ${t})`;return{background:r,[B]:r}}let i=`linear-gradient(${n}, ${r}, ${o})`;return{background:i,[B]:i}})(s,o):{[B]:s,background:s},h="square"===c||"butt"===c?0:void 0,[v,y]=T(null!=a?a:[-1,i||("small"===a?6:8)],"line",{strokeWidth:i}),$=Object.assign(Object.assign({width:`${P(n)}%`,height:y,borderRadius:h},b),{[F]:P(n)/100}),C=I(e),k={width:`${P(C)}%`,height:y,borderRadius:h,backgroundColor:null==p?void 0:p.strokeColor},x=t.createElement("div",{className:`${r}-inner`,style:{backgroundColor:d||void 0,borderRadius:h}},t.createElement("div",{className:(0,l.default)(`${r}-bg`,`${r}-bg-${g}`),style:$},"inner"===g&&u),void 0!==C&&t.createElement("div",{className:`${r}-success-bg`,style:k})),S="outer"===g&&"start"===m,w="outer"===g&&"end"===m;return"outer"===g&&"center"===m?t.createElement("div",{className:`${r}-layout-bottom`},x,u):t.createElement("div",{className:`${r}-outer`,style:{width:v<0?"100%":v}},S&&u,x,w&&u)},q=e=>{let{size:r,steps:o,rounding:n=Math.round,percent:a=0,strokeWidth:i=8,strokeColor:s,trailColor:c=null,prefixCls:u,children:d}=e,f=n(a/100*o),[p,m]=T(null!=r?r:["small"===r?2:14,i],"step",{steps:o,strokeWidth:i}),g=p/o,b=Array.from({length:o});for(let e=0;et.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nt.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r};let G=["normal","exception","active","success"],K=t.forwardRef((e,u)=>{let d,{prefixCls:f,className:p,rootClassName:m,steps:g,strokeColor:b,percent:h=0,size:v="default",showInfo:y=!0,type:$="line",status:C,format:k,style:x,percentPosition:S={}}=e,w=V(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:O="end",type:E="outer"}=S,j=Array.isArray(b)?b[0]:b,N="string"==typeof b||Array.isArray(b)?b:void 0,D=t.useMemo(()=>{if(j){let e="string"==typeof j?j:Object.values(j)[0];return new r.FastColor(e).isLight()}return!1},[b]),z=t.useMemo(()=>{var t,r;let o=I(e);return Number.parseInt(void 0!==o?null==(t=null!=o?o:0)?void 0:t.toString():null==(r=null!=h?h:0)?void 0:r.toString(),10)},[h,e.success,e.successPercent]),M=t.useMemo(()=>!G.includes(C)&&z>=100?"success":C||"normal",[C,z]),{getPrefixCls:A,direction:W,progress:B}=t.useContext(c.ConfigContext),F=A("progress",f),[L,_,K]=X(F),U="line"===$,Q=U&&!g,Y=t.useMemo(()=>{let r;if(!y)return null;let s=I(e),c=k||(e=>`${e}%`),u=U&&D&&"inner"===E;return"inner"===E||k||"exception"!==M&&"success"!==M?r=c(P(h),P(s)):"exception"===M?r=U?t.createElement(a.default,null):t.createElement(i.default,null):"success"===M&&(r=U?t.createElement(o.default,null):t.createElement(n.default,null)),t.createElement("span",{className:(0,l.default)(`${F}-text`,{[`${F}-text-bright`]:u,[`${F}-text-${O}`]:Q,[`${F}-text-${E}`]:Q}),title:"string"==typeof r?r:void 0},r)},[y,h,z,M,$,F,k]);"line"===$?d=g?t.createElement(q,Object.assign({},e,{strokeColor:N,prefixCls:F,steps:"object"==typeof g?g.count:g}),Y):t.createElement(H,Object.assign({},e,{strokeColor:j,prefixCls:F,direction:W,percentPosition:{align:O,type:E}}),Y):("circle"===$||"dashboard"===$)&&(d=t.createElement(R,Object.assign({},e,{strokeColor:j,prefixCls:F,progressStatus:M}),Y));let J=(0,l.default)(F,`${F}-status-${M}`,{[`${F}-${"dashboard"===$&&"circle"||$}`]:"line"!==$,[`${F}-inline-circle`]:"circle"===$&&T(v,"circle")[0]<=20,[`${F}-line`]:Q,[`${F}-line-align-${O}`]:Q,[`${F}-line-position-${E}`]:Q,[`${F}-steps`]:g,[`${F}-show-info`]:y,[`${F}-${v}`]:"string"==typeof v,[`${F}-rtl`]:"rtl"===W},null==B?void 0:B.className,p,m,_,K);return L(t.createElement("div",Object.assign({ref:u,style:Object.assign(Object.assign({},null==B?void 0:B.style),x),className:J,role:"progressbar","aria-valuenow":z,"aria-valuemin":0,"aria-valuemax":100},(0,s.default)(w,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),d))});e.s(["default",0,K],309821)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7e830ceee904c386.js b/litellm/proxy/_experimental/out/_next/static/chunks/102e659fcec2585e.js
similarity index 73%
rename from litellm/proxy/_experimental/out/_next/static/chunks/7e830ceee904c386.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/102e659fcec2585e.js
index a035f7a268..5fc4f1c677 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/7e830ceee904c386.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/102e659fcec2585e.js
@@ -1,8 +1,8 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,751904,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default])},91979,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["ReloadOutlined",0,l],91979)},752978,e=>{"use strict";var t=e.i(728889);e.s(["Icon",()=>t.default])},68155,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});e.s(["TrashIcon",0,r],68155)},959013,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["default",0,l],959013)},185793,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),a=e.i(242064),o=e.i(529681);let l=e=>{let{prefixCls:a,className:o,style:l,size:i,shape:n}=e,s=(0,r.default)({[`${a}-lg`]:"large"===i,[`${a}-sm`]:"small"===i}),d=(0,r.default)({[`${a}-circle`]:"circle"===n,[`${a}-square`]:"square"===n,[`${a}-round`]:"round"===n}),c=t.useMemo(()=>"number"==typeof i?{width:i,height:i,lineHeight:`${i}px`}:{},[i]);return t.createElement("span",{className:(0,r.default)(a,s,d,o),style:Object.assign(Object.assign({},c),l)})};e.i(296059);var i=e.i(694758),n=e.i(915654),s=e.i(246422),d=e.i(838378);let c=new i.Keyframes("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),g=e=>({height:e,lineHeight:(0,n.unit)(e)}),m=e=>Object.assign({width:e},g(e)),u=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},g(e)),b=e=>Object.assign({width:e},g(e)),h=(e,t,r)=>{let{skeletonButtonCls:a}=e;return{[`${r}${a}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${r}${a}-round`]:{borderRadius:t}}},f=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},g(e)),p=(0,s.genStyleHooks)("Skeleton",e=>{let{componentCls:t,calc:r}=e;return(e=>{let{componentCls:t,skeletonAvatarCls:r,skeletonTitleCls:a,skeletonParagraphCls:o,skeletonButtonCls:l,skeletonInputCls:i,skeletonImageCls:n,controlHeight:s,controlHeightLG:d,controlHeightSM:g,gradientFromColor:p,padding:C,marginSM:k,borderRadius:x,titleHeight:w,blockRadius:v,paragraphLiHeight:N,controlHeightXS:$,paragraphMarginTop:y}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:C,verticalAlign:"top",[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:p},m(s)),[`${r}-circle`]:{borderRadius:"50%"},[`${r}-lg`]:Object.assign({},m(d)),[`${r}-sm`]:Object.assign({},m(g))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[a]:{width:"100%",height:w,background:p,borderRadius:v,[`+ ${o}`]:{marginBlockStart:g}},[o]:{padding:0,"> li":{width:"100%",height:N,listStyle:"none",background:p,borderRadius:v,"+ li":{marginBlockStart:$}}},[`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${a}, ${o} > li`]:{borderRadius:x}}},[`${t}-with-avatar ${t}-content`]:{[a]:{marginBlockStart:k,[`+ ${o}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},(e=>{let{borderRadiusSM:t,skeletonButtonCls:r,controlHeight:a,controlHeightLG:o,controlHeightSM:l,gradientFromColor:i,calc:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:n(a).mul(2).equal(),minWidth:n(a).mul(2).equal()},f(a,n))},h(e,a,r)),{[`${r}-lg`]:Object.assign({},f(o,n))}),h(e,o,`${r}-lg`)),{[`${r}-sm`]:Object.assign({},f(l,n))}),h(e,l,`${r}-sm`))})(e)),(e=>{let{skeletonAvatarCls:t,gradientFromColor:r,controlHeight:a,controlHeightLG:o,controlHeightSM:l}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:r},m(a)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},m(o)),[`${t}${t}-sm`]:Object.assign({},m(l))}})(e)),(e=>{let{controlHeight:t,borderRadiusSM:r,skeletonInputCls:a,controlHeightLG:o,controlHeightSM:l,gradientFromColor:i,calc:n}=e;return{[a]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:r},u(t,n)),[`${a}-lg`]:Object.assign({},u(o,n)),[`${a}-sm`]:Object.assign({},u(l,n))}})(e)),(e=>{let{skeletonImageCls:t,imageSizeBase:r,gradientFromColor:a,borderRadiusSM:o,calc:l}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:a,borderRadius:o},b(l(r).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},b(r)),{maxWidth:l(r).mul(4).equal(),maxHeight:l(r).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}})(e)),[`${t}${t}-block`]:{width:"100%",[l]:{width:"100%"},[i]:{width:"100%"}},[`${t}${t}-active`]:{[`
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,564897,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["MinusCircleOutlined",0,l],564897)},752978,e=>{"use strict";var t=e.i(728889);e.s(["Icon",()=>t.default])},68155,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});e.s(["TrashIcon",0,r],68155)},959013,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["default",0,l],959013)},185793,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),a=e.i(242064),o=e.i(529681);let l=e=>{let{prefixCls:a,className:o,style:l,size:i,shape:n}=e,s=(0,r.default)({[`${a}-lg`]:"large"===i,[`${a}-sm`]:"small"===i}),d=(0,r.default)({[`${a}-circle`]:"circle"===n,[`${a}-square`]:"square"===n,[`${a}-round`]:"round"===n}),c=t.useMemo(()=>"number"==typeof i?{width:i,height:i,lineHeight:`${i}px`}:{},[i]);return t.createElement("span",{className:(0,r.default)(a,s,d,o),style:Object.assign(Object.assign({},c),l)})};e.i(296059);var i=e.i(694758),n=e.i(915654),s=e.i(246422),d=e.i(838378);let c=new i.Keyframes("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),g=e=>({height:e,lineHeight:(0,n.unit)(e)}),m=e=>Object.assign({width:e},g(e)),u=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},g(e)),b=e=>Object.assign({width:e},g(e)),h=(e,t,r)=>{let{skeletonButtonCls:a}=e;return{[`${r}${a}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${r}${a}-round`]:{borderRadius:t}}},f=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},g(e)),p=(0,s.genStyleHooks)("Skeleton",e=>{let{componentCls:t,calc:r}=e;return(e=>{let{componentCls:t,skeletonAvatarCls:r,skeletonTitleCls:a,skeletonParagraphCls:o,skeletonButtonCls:l,skeletonInputCls:i,skeletonImageCls:n,controlHeight:s,controlHeightLG:d,controlHeightSM:g,gradientFromColor:p,padding:C,marginSM:k,borderRadius:x,titleHeight:w,blockRadius:v,paragraphLiHeight:N,controlHeightXS:$,paragraphMarginTop:y}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:C,verticalAlign:"top",[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:p},m(s)),[`${r}-circle`]:{borderRadius:"50%"},[`${r}-lg`]:Object.assign({},m(d)),[`${r}-sm`]:Object.assign({},m(g))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[a]:{width:"100%",height:w,background:p,borderRadius:v,[`+ ${o}`]:{marginBlockStart:g}},[o]:{padding:0,"> li":{width:"100%",height:N,listStyle:"none",background:p,borderRadius:v,"+ li":{marginBlockStart:$}}},[`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${a}, ${o} > li`]:{borderRadius:x}}},[`${t}-with-avatar ${t}-content`]:{[a]:{marginBlockStart:k,[`+ ${o}`]:{marginBlockStart:y}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},(e=>{let{borderRadiusSM:t,skeletonButtonCls:r,controlHeight:a,controlHeightLG:o,controlHeightSM:l,gradientFromColor:i,calc:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:n(a).mul(2).equal(),minWidth:n(a).mul(2).equal()},f(a,n))},h(e,a,r)),{[`${r}-lg`]:Object.assign({},f(o,n))}),h(e,o,`${r}-lg`)),{[`${r}-sm`]:Object.assign({},f(l,n))}),h(e,l,`${r}-sm`))})(e)),(e=>{let{skeletonAvatarCls:t,gradientFromColor:r,controlHeight:a,controlHeightLG:o,controlHeightSM:l}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:r},m(a)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},m(o)),[`${t}${t}-sm`]:Object.assign({},m(l))}})(e)),(e=>{let{controlHeight:t,borderRadiusSM:r,skeletonInputCls:a,controlHeightLG:o,controlHeightSM:l,gradientFromColor:i,calc:n}=e;return{[a]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:r},u(t,n)),[`${a}-lg`]:Object.assign({},u(o,n)),[`${a}-sm`]:Object.assign({},u(l,n))}})(e)),(e=>{let{skeletonImageCls:t,imageSizeBase:r,gradientFromColor:a,borderRadiusSM:o,calc:l}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:a,borderRadius:o},b(l(r).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},b(r)),{maxWidth:l(r).mul(4).equal(),maxHeight:l(r).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}})(e)),[`${t}${t}-block`]:{width:"100%",[l]:{width:"100%"},[i]:{width:"100%"}},[`${t}${t}-active`]:{[`
${a},
${o} > li,
${r},
${l},
${i},
${n}
- `]:Object.assign({},{background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:c,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"})}}})((0,d.mergeToken)(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:r(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"}))},e=>{let{colorFillContent:t,colorFill:r}=e;return{color:t,colorGradientEnd:r,gradientFromColor:t,gradientToColor:r,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),C=e=>{let{prefixCls:a,className:o,style:l,rows:i=0}=e,n=Array.from({length:i}).map((r,a)=>t.createElement("li",{key:a,style:{width:((e,t)=>{let{width:r,rows:a=2}=t;return Array.isArray(r)?r[e]:a-1===e?r:void 0})(a,e)}}));return t.createElement("ul",{className:(0,r.default)(a,o),style:l},n)},k=({prefixCls:e,className:a,width:o,style:l})=>t.createElement("h3",{className:(0,r.default)(e,a),style:Object.assign({width:o},l)});function x(e){return e&&"object"==typeof e?e:{}}let w=e=>{let{prefixCls:o,loading:i,className:n,rootClassName:s,style:d,children:c,avatar:g=!1,title:m=!0,paragraph:u=!0,active:b,round:h}=e,{getPrefixCls:f,direction:w,className:v,style:N}=(0,a.useComponentConfig)("skeleton"),$=f("skeleton",o),[y,T,j]=p($);if(i||!("loading"in e)){let e,a,o=!!g,i=!!m,c=!!u;if(o){let r=Object.assign(Object.assign({prefixCls:`${$}-avatar`},i&&!c?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),x(g));e=t.createElement("div",{className:`${$}-header`},t.createElement(l,Object.assign({},r)))}if(i||c){let e,r;if(i){let r=Object.assign(Object.assign({prefixCls:`${$}-title`},!o&&c?{width:"38%"}:o&&c?{width:"50%"}:{}),x(m));e=t.createElement(k,Object.assign({},r))}if(c){let e,a=Object.assign(Object.assign({prefixCls:`${$}-paragraph`},(e={},o&&i||(e.width="61%"),!o&&i?e.rows=3:e.rows=2,e)),x(u));r=t.createElement(C,Object.assign({},a))}a=t.createElement("div",{className:`${$}-content`},e,r)}let f=(0,r.default)($,{[`${$}-with-avatar`]:o,[`${$}-active`]:b,[`${$}-rtl`]:"rtl"===w,[`${$}-round`]:h},v,n,s,T,j);return y(t.createElement("div",{className:f,style:Object.assign(Object.assign({},N),d)},e,a))}return null!=c?c:null};w.Button=e=>{let{prefixCls:i,className:n,rootClassName:s,active:d,block:c=!1,size:g="default"}=e,{getPrefixCls:m}=t.useContext(a.ConfigContext),u=m("skeleton",i),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d,[`${u}-block`]:c},n,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-button`,size:g},C))))},w.Avatar=e=>{let{prefixCls:i,className:n,rootClassName:s,active:d,shape:c="circle",size:g="default"}=e,{getPrefixCls:m}=t.useContext(a.ConfigContext),u=m("skeleton",i),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls","className"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d},n,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-avatar`,shape:c,size:g},C))))},w.Input=e=>{let{prefixCls:i,className:n,rootClassName:s,active:d,block:c,size:g="default"}=e,{getPrefixCls:m}=t.useContext(a.ConfigContext),u=m("skeleton",i),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d,[`${u}-block`]:c},n,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-input`,size:g},C))))},w.Image=e=>{let{prefixCls:o,className:l,rootClassName:i,style:n,active:s}=e,{getPrefixCls:d}=t.useContext(a.ConfigContext),c=d("skeleton",o),[g,m,u]=p(c),b=(0,r.default)(c,`${c}-element`,{[`${c}-active`]:s},l,i,m,u);return g(t.createElement("div",{className:b},t.createElement("div",{className:(0,r.default)(`${c}-image`,l),style:n},t.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${c}-image-svg`},t.createElement("title",null,"Image placeholder"),t.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${c}-image-path`})))))},w.Node=e=>{let{prefixCls:o,className:l,rootClassName:i,style:n,active:s,children:d}=e,{getPrefixCls:c}=t.useContext(a.ConfigContext),g=c("skeleton",o),[m,u,b]=p(g),h=(0,r.default)(g,`${g}-element`,{[`${g}-active`]:s},u,l,i,b);return m(t.createElement("div",{className:h},t.createElement("div",{className:(0,r.default)(`${g}-image`,l),style:n},d)))},e.s(["default",0,w],185793)},994388,e=>{"use strict";var t=e.i(290571),r=e.i(829087),a=e.i(271645);let o=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],l=e=>({_s:e,status:o[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),i=e=>e?6:5,n=(e,t,r,a,o)=>{clearTimeout(a.current);let i=l(e);t(i),r.current=i,o&&o({current:i})};var s=e.i(480731),d=e.i(444755),c=e.i(673706);let g=e=>{var r=(0,t.__rest)(e,[]);return a.default.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),a.default.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),a.default.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var m=e.i(95779);let u={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},b=(e,t)=>{switch(e){case"primary":return{textColor:t?(0,c.getColorClassNames)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?(0,c.getColorClassNames)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,c.getColorClassNames)(t,m.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?(0,c.getColorClassNames)(t,m.colorPalette.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?(0,c.getColorClassNames)(t,m.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?(0,c.getColorClassNames)(t,m.colorPalette.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?(0,c.getColorClassNames)(t,m.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,c.getColorClassNames)(t,m.colorPalette.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,c.getColorClassNames)("transparent").bgColor,hoverBgColor:t?(0,d.tremorTwMerge)((0,c.getColorClassNames)(t,m.colorPalette.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?(0,c.getColorClassNames)(t,m.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?(0,c.getColorClassNames)(t,m.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,c.getColorClassNames)(t,m.colorPalette.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,c.getColorClassNames)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},h=(0,c.makeClassName)("Button"),f=({loading:e,iconSize:t,iconPosition:r,Icon:o,needMargin:l,transitionStatus:i})=>{let n=l?r===s.HorizontalPositions.Left?(0,d.tremorTwMerge)("-ml-1","mr-1.5"):(0,d.tremorTwMerge)("-mr-1","ml-1.5"):"",c=(0,d.tremorTwMerge)("w-0 h-0"),m={default:c,entering:c,entered:t,exiting:t,exited:c};return e?a.default.createElement(g,{className:(0,d.tremorTwMerge)(h("icon"),"animate-spin shrink-0",n,m.default,m[i]),style:{transition:"width 150ms"}}):a.default.createElement(o,{className:(0,d.tremorTwMerge)(h("icon"),"shrink-0",t,n)})},p=a.default.forwardRef((e,o)=>{let{icon:g,iconPosition:m=s.HorizontalPositions.Left,size:p=s.Sizes.SM,color:C,variant:k="primary",disabled:x,loading:w=!1,loadingText:v,children:N,tooltip:$,className:y}=e,T=(0,t.__rest)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),j=w||x,O=void 0!==g||w,E=w&&v,M=!(!N&&!E),z=(0,d.tremorTwMerge)(u[p].height,u[p].width),R="light"!==k?(0,d.tremorTwMerge)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",P=b(k,C),B=("light"!==k?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}})[p],{tooltipProps:S,getReferenceProps:q}=(0,r.useTooltip)(300),[H,_]=(({enter:e=!0,exit:t=!0,preEnter:r,preExit:o,timeout:s,initialEntered:d,mountOnEnter:c,unmountOnExit:g,onStateChange:m}={})=>{let[u,b]=(0,a.useState)(()=>l(d?2:i(c))),h=(0,a.useRef)(u),f=(0,a.useRef)(0),[p,C]="object"==typeof s?[s.enter,s.exit]:[s,s],k=(0,a.useCallback)(()=>{let e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return i(t)}})(h.current._s,g);e&&n(e,b,h,f,m)},[m,g]);return[u,(0,a.useCallback)(a=>{let l=e=>{switch(n(e,b,h,f,m),e){case 1:p>=0&&(f.current=((...e)=>setTimeout(...e))(k,p));break;case 4:C>=0&&(f.current=((...e)=>setTimeout(...e))(k,C));break;case 0:case 3:f.current=((...e)=>setTimeout(...e))(()=>{isNaN(document.body.offsetTop)||l(e+1)},0)}},s=h.current.isEnter;"boolean"!=typeof a&&(a=!s),a?s||l(e?+!r:2):s&&l(t?o?3:4:i(g))},[k,m,e,t,r,o,p,C,g]),k]})({timeout:50});return(0,a.useEffect)(()=>{_(w)},[w]),a.default.createElement("button",Object.assign({ref:(0,c.mergeRefs)([o,S.refs.setReference]),className:(0,d.tremorTwMerge)(h("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",R,B.paddingX,B.paddingY,B.fontSize,P.textColor,P.bgColor,P.borderColor,P.hoverBorderColor,j?"opacity-50 cursor-not-allowed":(0,d.tremorTwMerge)(b(k,C).hoverTextColor,b(k,C).hoverBgColor,b(k,C).hoverBorderColor),y),disabled:j},q,T),a.default.createElement(r.default,Object.assign({text:$},S)),O&&m!==s.HorizontalPositions.Right?a.default.createElement(f,{loading:w,iconSize:z,iconPosition:m,Icon:g,transitionStatus:H.status,needMargin:M}):null,E||N?a.default.createElement("span",{className:(0,d.tremorTwMerge)(h("text"),"text-tremor-default whitespace-nowrap")},E?v:N):null,O&&m===s.HorizontalPositions.Right?a.default.createElement(f,{loading:w,iconSize:z,iconPosition:m,Icon:g,transitionStatus:H.status,needMargin:M}):null)});p.displayName="Button",e.s(["Button",()=>p],994388)},269200,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("Table"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement("div",{className:(0,a.tremorTwMerge)(o("root"),"overflow-auto",n)},r.default.createElement("table",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},s),i))});l.displayName="Table",e.s(["Table",()=>l],269200)},427612,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableHead"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("thead",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",n)},s),i))});l.displayName="TableHead",e.s(["TableHead",()=>l],427612)},64848,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableHeaderCell"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("th",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",n)},s),i))});l.displayName="TableHeaderCell",e.s(["TableHeaderCell",()=>l],64848)},942232,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableBody"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("tbody",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",n)},s),i))});l.displayName="TableBody",e.s(["TableBody",()=>l],942232)},496020,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableRow"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("tr",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("row"),n)},s),i))});l.displayName="TableRow",e.s(["TableRow",()=>l],496020)},977572,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableCell"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("td",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"align-middle whitespace-nowrap text-left p-4",n)},s),i))});l.displayName="TableCell",e.s(["TableCell",()=>l],977572)},728889,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(829087),o=e.i(480731),l=e.i(444755),i=e.i(673706),n=e.i(95779);let s={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"}},c={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:""}},g=(0,i.makeClassName)("Icon"),m=r.default.forwardRef((e,m)=>{let{icon:u,variant:b="simple",tooltip:h,size:f=o.Sizes.SM,color:p,className:C}=e,k=(0,t.__rest)(e,["icon","variant","tooltip","size","color","className"]),x=((e,t)=>{switch(e){case"simple":return{textColor:t?(0,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.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,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.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,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,i.getColorClassNames)(t,n.colorPalette.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}})(b,p),{tooltipProps:w,getReferenceProps:v}=(0,a.useTooltip)();return r.default.createElement("span",Object.assign({ref:(0,i.mergeRefs)([m,w.refs.setReference]),className:(0,l.tremorTwMerge)(g("root"),"inline-flex shrink-0 items-center justify-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,c[b].rounded,c[b].border,c[b].shadow,c[b].ring,s[f].paddingX,s[f].paddingY,C)},v,k),r.default.createElement(a.default,Object.assign({text:h},w)),r.default.createElement(u,{className:(0,l.tremorTwMerge)(g("icon"),"shrink-0",d[f].height,d[f].width)}))});m.displayName="Icon",e.s(["default",()=>m],728889)},591935,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});e.s(["PencilAltIcon",0,r],591935)},118366,e=>{"use strict";var t=e.i(991124);e.s(["CopyIcon",()=>t.default])},991124,e=>{"use strict";let t=(0,e.i(475254).default)("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"}]]);e.s(["default",()=>t])},678784,678745,e=>{"use strict";let t=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],678745),e.s(["CheckIcon",()=>t],678784)},564897,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["MinusCircleOutlined",0,l],564897)}]);
\ No newline at end of file
+ `]:Object.assign({},{background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:c,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"})}}})((0,d.mergeToken)(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:r(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"}))},e=>{let{colorFillContent:t,colorFill:r}=e;return{color:t,colorGradientEnd:r,gradientFromColor:t,gradientToColor:r,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),C=e=>{let{prefixCls:a,className:o,style:l,rows:i=0}=e,n=Array.from({length:i}).map((r,a)=>t.createElement("li",{key:a,style:{width:((e,t)=>{let{width:r,rows:a=2}=t;return Array.isArray(r)?r[e]:a-1===e?r:void 0})(a,e)}}));return t.createElement("ul",{className:(0,r.default)(a,o),style:l},n)},k=({prefixCls:e,className:a,width:o,style:l})=>t.createElement("h3",{className:(0,r.default)(e,a),style:Object.assign({width:o},l)});function x(e){return e&&"object"==typeof e?e:{}}let w=e=>{let{prefixCls:o,loading:i,className:n,rootClassName:s,style:d,children:c,avatar:g=!1,title:m=!0,paragraph:u=!0,active:b,round:h}=e,{getPrefixCls:f,direction:w,className:v,style:N}=(0,a.useComponentConfig)("skeleton"),$=f("skeleton",o),[y,T,j]=p($);if(i||!("loading"in e)){let e,a,o=!!g,i=!!m,c=!!u;if(o){let r=Object.assign(Object.assign({prefixCls:`${$}-avatar`},i&&!c?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),x(g));e=t.createElement("div",{className:`${$}-header`},t.createElement(l,Object.assign({},r)))}if(i||c){let e,r;if(i){let r=Object.assign(Object.assign({prefixCls:`${$}-title`},!o&&c?{width:"38%"}:o&&c?{width:"50%"}:{}),x(m));e=t.createElement(k,Object.assign({},r))}if(c){let e,a=Object.assign(Object.assign({prefixCls:`${$}-paragraph`},(e={},o&&i||(e.width="61%"),!o&&i?e.rows=3:e.rows=2,e)),x(u));r=t.createElement(C,Object.assign({},a))}a=t.createElement("div",{className:`${$}-content`},e,r)}let f=(0,r.default)($,{[`${$}-with-avatar`]:o,[`${$}-active`]:b,[`${$}-rtl`]:"rtl"===w,[`${$}-round`]:h},v,n,s,T,j);return y(t.createElement("div",{className:f,style:Object.assign(Object.assign({},N),d)},e,a))}return null!=c?c:null};w.Button=e=>{let{prefixCls:i,className:n,rootClassName:s,active:d,block:c=!1,size:g="default"}=e,{getPrefixCls:m}=t.useContext(a.ConfigContext),u=m("skeleton",i),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d,[`${u}-block`]:c},n,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-button`,size:g},C))))},w.Avatar=e=>{let{prefixCls:i,className:n,rootClassName:s,active:d,shape:c="circle",size:g="default"}=e,{getPrefixCls:m}=t.useContext(a.ConfigContext),u=m("skeleton",i),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls","className"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d},n,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-avatar`,shape:c,size:g},C))))},w.Input=e=>{let{prefixCls:i,className:n,rootClassName:s,active:d,block:c,size:g="default"}=e,{getPrefixCls:m}=t.useContext(a.ConfigContext),u=m("skeleton",i),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d,[`${u}-block`]:c},n,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-input`,size:g},C))))},w.Image=e=>{let{prefixCls:o,className:l,rootClassName:i,style:n,active:s}=e,{getPrefixCls:d}=t.useContext(a.ConfigContext),c=d("skeleton",o),[g,m,u]=p(c),b=(0,r.default)(c,`${c}-element`,{[`${c}-active`]:s},l,i,m,u);return g(t.createElement("div",{className:b},t.createElement("div",{className:(0,r.default)(`${c}-image`,l),style:n},t.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${c}-image-svg`},t.createElement("title",null,"Image placeholder"),t.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${c}-image-path`})))))},w.Node=e=>{let{prefixCls:o,className:l,rootClassName:i,style:n,active:s,children:d}=e,{getPrefixCls:c}=t.useContext(a.ConfigContext),g=c("skeleton",o),[m,u,b]=p(g),h=(0,r.default)(g,`${g}-element`,{[`${g}-active`]:s},u,l,i,b);return m(t.createElement("div",{className:h},t.createElement("div",{className:(0,r.default)(`${g}-image`,l),style:n},d)))},e.s(["default",0,w],185793)},994388,e=>{"use strict";var t=e.i(290571),r=e.i(829087),a=e.i(271645);let o=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],l=e=>({_s:e,status:o[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),i=e=>e?6:5,n=(e,t,r,a,o)=>{clearTimeout(a.current);let i=l(e);t(i),r.current=i,o&&o({current:i})};var s=e.i(480731),d=e.i(444755),c=e.i(673706);let g=e=>{var r=(0,t.__rest)(e,[]);return a.default.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),a.default.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),a.default.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var m=e.i(95779);let u={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},b=(e,t)=>{switch(e){case"primary":return{textColor:t?(0,c.getColorClassNames)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?(0,c.getColorClassNames)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,c.getColorClassNames)(t,m.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?(0,c.getColorClassNames)(t,m.colorPalette.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?(0,c.getColorClassNames)(t,m.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?(0,c.getColorClassNames)(t,m.colorPalette.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?(0,c.getColorClassNames)(t,m.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,c.getColorClassNames)(t,m.colorPalette.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,c.getColorClassNames)("transparent").bgColor,hoverBgColor:t?(0,d.tremorTwMerge)((0,c.getColorClassNames)(t,m.colorPalette.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?(0,c.getColorClassNames)(t,m.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?(0,c.getColorClassNames)(t,m.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,c.getColorClassNames)(t,m.colorPalette.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,c.getColorClassNames)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},h=(0,c.makeClassName)("Button"),f=({loading:e,iconSize:t,iconPosition:r,Icon:o,needMargin:l,transitionStatus:i})=>{let n=l?r===s.HorizontalPositions.Left?(0,d.tremorTwMerge)("-ml-1","mr-1.5"):(0,d.tremorTwMerge)("-mr-1","ml-1.5"):"",c=(0,d.tremorTwMerge)("w-0 h-0"),m={default:c,entering:c,entered:t,exiting:t,exited:c};return e?a.default.createElement(g,{className:(0,d.tremorTwMerge)(h("icon"),"animate-spin shrink-0",n,m.default,m[i]),style:{transition:"width 150ms"}}):a.default.createElement(o,{className:(0,d.tremorTwMerge)(h("icon"),"shrink-0",t,n)})},p=a.default.forwardRef((e,o)=>{let{icon:g,iconPosition:m=s.HorizontalPositions.Left,size:p=s.Sizes.SM,color:C,variant:k="primary",disabled:x,loading:w=!1,loadingText:v,children:N,tooltip:$,className:y}=e,T=(0,t.__rest)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),j=w||x,O=void 0!==g||w,E=w&&v,M=!(!N&&!E),z=(0,d.tremorTwMerge)(u[p].height,u[p].width),R="light"!==k?(0,d.tremorTwMerge)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",P=b(k,C),B=("light"!==k?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}})[p],{tooltipProps:S,getReferenceProps:q}=(0,r.useTooltip)(300),[H,_]=(({enter:e=!0,exit:t=!0,preEnter:r,preExit:o,timeout:s,initialEntered:d,mountOnEnter:c,unmountOnExit:g,onStateChange:m}={})=>{let[u,b]=(0,a.useState)(()=>l(d?2:i(c))),h=(0,a.useRef)(u),f=(0,a.useRef)(0),[p,C]="object"==typeof s?[s.enter,s.exit]:[s,s],k=(0,a.useCallback)(()=>{let e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return i(t)}})(h.current._s,g);e&&n(e,b,h,f,m)},[m,g]);return[u,(0,a.useCallback)(a=>{let l=e=>{switch(n(e,b,h,f,m),e){case 1:p>=0&&(f.current=((...e)=>setTimeout(...e))(k,p));break;case 4:C>=0&&(f.current=((...e)=>setTimeout(...e))(k,C));break;case 0:case 3:f.current=((...e)=>setTimeout(...e))(()=>{isNaN(document.body.offsetTop)||l(e+1)},0)}},s=h.current.isEnter;"boolean"!=typeof a&&(a=!s),a?s||l(e?+!r:2):s&&l(t?o?3:4:i(g))},[k,m,e,t,r,o,p,C,g]),k]})({timeout:50});return(0,a.useEffect)(()=>{_(w)},[w]),a.default.createElement("button",Object.assign({ref:(0,c.mergeRefs)([o,S.refs.setReference]),className:(0,d.tremorTwMerge)(h("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",R,B.paddingX,B.paddingY,B.fontSize,P.textColor,P.bgColor,P.borderColor,P.hoverBorderColor,j?"opacity-50 cursor-not-allowed":(0,d.tremorTwMerge)(b(k,C).hoverTextColor,b(k,C).hoverBgColor,b(k,C).hoverBorderColor),y),disabled:j},q,T),a.default.createElement(r.default,Object.assign({text:$},S)),O&&m!==s.HorizontalPositions.Right?a.default.createElement(f,{loading:w,iconSize:z,iconPosition:m,Icon:g,transitionStatus:H.status,needMargin:M}):null,E||N?a.default.createElement("span",{className:(0,d.tremorTwMerge)(h("text"),"text-tremor-default whitespace-nowrap")},E?v:N):null,O&&m===s.HorizontalPositions.Right?a.default.createElement(f,{loading:w,iconSize:z,iconPosition:m,Icon:g,transitionStatus:H.status,needMargin:M}):null)});p.displayName="Button",e.s(["Button",()=>p],994388)},269200,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("Table"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement("div",{className:(0,a.tremorTwMerge)(o("root"),"overflow-auto",n)},r.default.createElement("table",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},s),i))});l.displayName="Table",e.s(["Table",()=>l],269200)},427612,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableHead"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("thead",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",n)},s),i))});l.displayName="TableHead",e.s(["TableHead",()=>l],427612)},64848,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableHeaderCell"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("th",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",n)},s),i))});l.displayName="TableHeaderCell",e.s(["TableHeaderCell",()=>l],64848)},942232,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableBody"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("tbody",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",n)},s),i))});l.displayName="TableBody",e.s(["TableBody",()=>l],942232)},496020,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableRow"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("tr",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("row"),n)},s),i))});l.displayName="TableRow",e.s(["TableRow",()=>l],496020)},977572,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableCell"),l=r.default.forwardRef((e,l)=>{let{children:i,className:n}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("td",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"align-middle whitespace-nowrap text-left p-4",n)},s),i))});l.displayName="TableCell",e.s(["TableCell",()=>l],977572)},728889,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(829087),o=e.i(480731),l=e.i(444755),i=e.i(673706),n=e.i(95779);let s={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"}},c={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:""}},g=(0,i.makeClassName)("Icon"),m=r.default.forwardRef((e,m)=>{let{icon:u,variant:b="simple",tooltip:h,size:f=o.Sizes.SM,color:p,className:C}=e,k=(0,t.__rest)(e,["icon","variant","tooltip","size","color","className"]),x=((e,t)=>{switch(e){case"simple":return{textColor:t?(0,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.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,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.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,i.getColorClassNames)(t,n.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,i.getColorClassNames)(t,n.colorPalette.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.tremorTwMerge)((0,i.getColorClassNames)(t,n.colorPalette.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}})(b,p),{tooltipProps:w,getReferenceProps:v}=(0,a.useTooltip)();return r.default.createElement("span",Object.assign({ref:(0,i.mergeRefs)([m,w.refs.setReference]),className:(0,l.tremorTwMerge)(g("root"),"inline-flex shrink-0 items-center justify-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,c[b].rounded,c[b].border,c[b].shadow,c[b].ring,s[f].paddingX,s[f].paddingY,C)},v,k),r.default.createElement(a.default,Object.assign({text:h},w)),r.default.createElement(u,{className:(0,l.tremorTwMerge)(g("icon"),"shrink-0",d[f].height,d[f].width)}))});m.displayName="Icon",e.s(["default",()=>m],728889)},591935,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});e.s(["PencilAltIcon",0,r],591935)},118366,e=>{"use strict";var t=e.i(991124);e.s(["CopyIcon",()=>t.default])},991124,e=>{"use strict";let t=(0,e.i(475254).default)("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"}]]);e.s(["default",()=>t])},678784,678745,e=>{"use strict";let t=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],678745),e.s(["CheckIcon",()=>t],678784)},751904,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default])},91979,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["ReloadOutlined",0,l],91979)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/10dc4591ef08a91f.js b/litellm/proxy/_experimental/out/_next/static/chunks/10dc4591ef08a91f.js
new file mode 100644
index 0000000000..9feb9cf14e
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/10dc4591ef08a91f.js
@@ -0,0 +1,598 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,818581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return r}});let s=e.r(271645);function r(e,t){let a=(0,s.useRef)(null),r=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=a.current;e&&(a.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(a.current=i(e,s)),t&&(r.current=i(t,s))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},62478,e=>{"use strict";var t=e.i(764205);let a=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,a])},602073,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let s={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"};var r=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(r.default,(0,t.default)({},e,{ref:i,icon:s}))});e.s(["SafetyOutlined",0,i],602073)},190272,785913,e=>{"use strict";var t,a,s=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),r=((a={}).IMAGE="image",a.VIDEO="video",a.CHAT="chat",a.RESPONSES="responses",a.IMAGE_EDITS="image_edits",a.ANTHROPIC_MESSAGES="anthropic_messages",a.EMBEDDINGS="embeddings",a.SPEECH="speech",a.TRANSCRIPTION="transcription",a.A2A_AGENTS="a2a_agents",a.MCP="mcp",a.REALTIME="realtime",a);let i={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>r,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(s).includes(e)){let t=i[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:a,accessToken:s,apiKey:i,inputMessage:l,chatHistory:n,selectedTags:o,selectedVectorStores:c,selectedGuardrails:d,selectedPolicies:m,selectedMCPServers:p,mcpServers:u,mcpServerToolRestrictions:g,selectedVoice:x,endpointType:h,selectedModel:f,selectedSdk:_,proxySettings:b}=e,y="session"===a?s:i,v=window.location.origin,j=b?.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?v=j:b?.PROXY_BASE_URL&&(v=b.PROXY_BASE_URL);let A=l||"Your prompt here",N=A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),T=n.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),S={};o.length>0&&(S.tags=o),c.length>0&&(S.vector_stores=c),d.length>0&&(S.guardrails=d),m.length>0&&(S.policies=m);let C=f||"your-model-name",w="azure"===_?`import openai
+
+client = openai.AzureOpenAI(
+ api_key="${y||"YOUR_LITELLM_API_KEY"}",
+ azure_endpoint="${v}",
+ api_version="2024-02-01"
+)`:`import openai
+
+client = openai.OpenAI(
+ api_key="${y||"YOUR_LITELLM_API_KEY"}",
+ base_url="${v}"
+)`;switch(h){case r.CHAT:{let e=Object.keys(S).length>0,a="";if(e){let e=JSON.stringify({metadata:S},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();a=`,
+ extra_body=${e}`}let s=T.length>0?T:[{role:"user",content:A}];t=`
+import base64
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Example with text only
+response = client.chat.completions.create(
+ model="${C}",
+ messages=${JSON.stringify(s,null,4)}${a}
+)
+
+print(response)
+
+# Example with image or PDF (uncomment and provide file path to use)
+# base64_file = encode_image("path/to/your/file.jpg") # or .pdf
+# response_with_file = client.chat.completions.create(
+# model="${C}",
+# messages=[
+# {
+# "role": "user",
+# "content": [
+# {
+# "type": "text",
+# "text": "${N}"
+# },
+# {
+# "type": "image_url",
+# "image_url": {
+# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}
+# }
+# }
+# ]
+# }
+# ]${a}
+# )
+# print(response_with_file)
+`;break}case r.RESPONSES:{let e=Object.keys(S).length>0,a="";if(e){let e=JSON.stringify({metadata:S},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();a=`,
+ extra_body=${e}`}let s=T.length>0?T:[{role:"user",content:A}];t=`
+import base64
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Example with text only
+response = client.responses.create(
+ model="${C}",
+ input=${JSON.stringify(s,null,4)}${a}
+)
+
+print(response.output_text)
+
+# Example with image or PDF (uncomment and provide file path to use)
+# base64_file = encode_image("path/to/your/file.jpg") # or .pdf
+# response_with_file = client.responses.create(
+# model="${C}",
+# input=[
+# {
+# "role": "user",
+# "content": [
+# {"type": "input_text", "text": "${N}"},
+# {
+# "type": "input_image",
+# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}
+# },
+# ],
+# }
+# ]${a}
+# )
+# print(response_with_file.output_text)
+`;break}case r.IMAGE:t="azure"===_?`
+# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.
+# This snippet uses 'client.images.generate' and will create a new image based on your prompt.
+# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.
+import os
+import requests
+import json
+import time
+from PIL import Image
+
+result = client.images.generate(
+ model="${C}",
+ prompt="${l}",
+ n=1
+)
+
+json_response = json.loads(result.model_dump_json())
+
+# Set the directory for the stored image
+image_dir = os.path.join(os.curdir, 'images')
+
+# If the directory doesn't exist, create it
+if not os.path.isdir(image_dir):
+ os.mkdir(image_dir)
+
+# Initialize the image path
+image_filename = f"generated_image_{int(time.time())}.png"
+image_path = os.path.join(image_dir, image_filename)
+
+try:
+ # Retrieve the generated image
+ if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):
+ image_url = json_response["data"][0]["url"]
+ generated_image = requests.get(image_url).content
+ with open(image_path, "wb") as image_file:
+ image_file.write(generated_image)
+
+ print(f"Image saved to {image_path}")
+ # Display the image
+ image = Image.open(image_path)
+ image.show()
+ else:
+ print("Could not find image URL in response.")
+ print("Full response:", json_response)
+except Exception as e:
+ print(f"An error occurred: {e}")
+ print("Full response:", json_response)
+`:`
+import base64
+import os
+import time
+import json
+from PIL import Image
+import requests
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Helper function to create a file (simplified for this example)
+def create_file(image_path):
+ # In a real implementation, this would upload the file to OpenAI
+ # For this example, we'll just return a placeholder ID
+ return f"file_{os.path.basename(image_path).replace('.', '_')}"
+
+# The prompt entered by the user
+prompt = "${N}"
+
+# Encode images to base64
+base64_image1 = encode_image("body-lotion.png")
+base64_image2 = encode_image("soap.png")
+
+# Create file IDs
+file_id1 = create_file("body-lotion.png")
+file_id2 = create_file("incense-kit.png")
+
+response = client.responses.create(
+ model="${C}",
+ input=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": prompt},
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image1}",
+ },
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image2}",
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id1,
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id2,
+ }
+ ],
+ }
+ ],
+ tools=[{"type": "image_generation"}],
+)
+
+# Process the response
+image_generation_calls = [
+ output
+ for output in response.output
+ if output.type == "image_generation_call"
+]
+
+image_data = [output.result for output in image_generation_calls]
+
+if image_data:
+ image_base64 = image_data[0]
+ image_filename = f"edited_image_{int(time.time())}.png"
+ with open(image_filename, "wb") as f:
+ f.write(base64.b64decode(image_base64))
+ print(f"Image saved to {image_filename}")
+else:
+ # If no image is generated, there might be a text response with an explanation
+ text_response = [output.text for output in response.output if hasattr(output, 'text')]
+ if text_response:
+ print("No image generated. Model response:")
+ print("\\n".join(text_response))
+ else:
+ print("No image data found in response.")
+ print("Full response for debugging:")
+ print(response)
+`;break;case r.IMAGE_EDITS:t="azure"===_?`
+import base64
+import os
+import time
+import json
+from PIL import Image
+import requests
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# The prompt entered by the user
+prompt = "${N}"
+
+# Encode images to base64
+base64_image1 = encode_image("body-lotion.png")
+base64_image2 = encode_image("soap.png")
+
+# Create file IDs
+file_id1 = create_file("body-lotion.png")
+file_id2 = create_file("incense-kit.png")
+
+response = client.responses.create(
+ model="${C}",
+ input=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": prompt},
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image1}",
+ },
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image2}",
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id1,
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id2,
+ }
+ ],
+ }
+ ],
+ tools=[{"type": "image_generation"}],
+)
+
+# Process the response
+image_generation_calls = [
+ output
+ for output in response.output
+ if output.type == "image_generation_call"
+]
+
+image_data = [output.result for output in image_generation_calls]
+
+if image_data:
+ image_base64 = image_data[0]
+ image_filename = f"edited_image_{int(time.time())}.png"
+ with open(image_filename, "wb") as f:
+ f.write(base64.b64decode(image_base64))
+ print(f"Image saved to {image_filename}")
+else:
+ # If no image is generated, there might be a text response with an explanation
+ text_response = [output.text for output in response.output if hasattr(output, 'text')]
+ if text_response:
+ print("No image generated. Model response:")
+ print("\\n".join(text_response))
+ else:
+ print("No image data found in response.")
+ print("Full response for debugging:")
+ print(response)
+`:`
+import base64
+import os
+import time
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Helper function to create a file (simplified for this example)
+def create_file(image_path):
+ # In a real implementation, this would upload the file to OpenAI
+ # For this example, we'll just return a placeholder ID
+ return f"file_{os.path.basename(image_path).replace('.', '_')}"
+
+# The prompt entered by the user
+prompt = "${N}"
+
+# Encode images to base64
+base64_image1 = encode_image("body-lotion.png")
+base64_image2 = encode_image("soap.png")
+
+# Create file IDs
+file_id1 = create_file("body-lotion.png")
+file_id2 = create_file("incense-kit.png")
+
+response = client.responses.create(
+ model="${C}",
+ input=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": prompt},
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image1}",
+ },
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image2}",
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id1,
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id2,
+ }
+ ],
+ }
+ ],
+ tools=[{"type": "image_generation"}],
+)
+
+# Process the response
+image_generation_calls = [
+ output
+ for output in response.output
+ if output.type == "image_generation_call"
+]
+
+image_data = [output.result for output in image_generation_calls]
+
+if image_data:
+ image_base64 = image_data[0]
+ image_filename = f"edited_image_{int(time.time())}.png"
+ with open(image_filename, "wb") as f:
+ f.write(base64.b64decode(image_base64))
+ print(f"Image saved to {image_filename}")
+else:
+ # If no image is generated, there might be a text response with an explanation
+ text_response = [output.text for output in response.output if hasattr(output, 'text')]
+ if text_response:
+ print("No image generated. Model response:")
+ print("\\n".join(text_response))
+ else:
+ print("No image data found in response.")
+ print("Full response for debugging:")
+ print(response)
+`;break;case r.EMBEDDINGS:t=`
+response = client.embeddings.create(
+ input="${l||"Your string here"}",
+ model="${C}",
+ encoding_format="base64" # or "float"
+)
+
+print(response.data[0].embedding)
+`;break;case r.TRANSCRIPTION:t=`
+# Open the audio file
+audio_file = open("path/to/your/audio/file.mp3", "rb")
+
+# Make the transcription request
+response = client.audio.transcriptions.create(
+ model="${C}",
+ file=audio_file${l?`,
+ prompt="${l.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:""}
+)
+
+print(response.text)
+`;break;case r.SPEECH:t=`
+# Make the text-to-speech request
+response = client.audio.speech.create(
+ model="${C}",
+ input="${l||"Your text to convert to speech here"}",
+ voice="${x}" # Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer
+)
+
+# Save the audio to a file
+output_filename = "output_speech.mp3"
+response.stream_to_file(output_filename)
+print(f"Audio saved to {output_filename}")
+
+# Optional: Customize response format and speed
+# response = client.audio.speech.create(
+# model="${C}",
+# input="${l||"Your text to convert to speech here"}",
+# voice="alloy",
+# response_format="mp3", # Options: mp3, opus, aac, flac, wav, pcm
+# speed=1.0 # Range: 0.25 to 4.0
+# )
+# response.stream_to_file("output_speech.mp3")
+`;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${w}
+${t}`}],190272)},652272,209261,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(447566),r=e.i(166406),i=e.i(492030),l=e.i(596239);let n=e=>"github"===e.source.source&&e.source.repo?`/plugin marketplace add ${e.source.repo}`:"url"===e.source.source&&e.source.url?`/plugin marketplace add ${e.source.url}`:`/plugin marketplace add ${e.name}`;e.s(["formatInstallCommand",0,n,"getCategoryBadgeColor",0,e=>{if(!e)return"gray";let t=e.toLowerCase();if(t.includes("development")||t.includes("dev"))return"blue";if(t.includes("productivity")||t.includes("workflow"))return"green";if(t.includes("learning")||t.includes("education"))return"purple";if(t.includes("security")||t.includes("safety"))return"red";if(t.includes("data")||t.includes("analytics"))return"orange";else if(t.includes("integration")||t.includes("api"))return"yellow";return"gray"},"isValidEmail",0,e=>!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),"isValidSemanticVersion",0,e=>!e||/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(e),"isValidUrl",0,e=>{if(!e)return!0;try{return new URL(e),!0}catch{return!1}},"parseKeywords",0,e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>""!==e):[],"validatePluginName",0,e=>!!e&&""!==e.trim()&&/^[a-z0-9-]+$/.test(e)],209261),e.s(["default",0,({skill:e,onBack:o})=>{let c,[d,m]=(0,a.useState)("overview"),[p,u]=(0,a.useState)(null),g=(e,t)=>{navigator.clipboard.writeText(e),u(t),setTimeout(()=>u(null),2e3)},x="github"===(c=e.source).source&&c.repo?`https://github.com/${c.repo}`:"git-subdir"===c.source&&c.url?c.path?`${c.url}/tree/main/${c.path}`:c.url:"url"===c.source&&c.url?c.url:null,h=n(e),f=[...e.category?[{property:"Category",value:e.category}]:[],...e.domain?[{property:"Domain",value:e.domain}]:[],...e.namespace?[{property:"Namespace",value:e.namespace}]:[],...e.version?[{property:"Version",value:e.version}]:[],...e.author?.name?[{property:"Author",value:e.author.name}]:[],...e.created_at?[{property:"Added",value:new Date(e.created_at).toLocaleDateString()}]:[]];return(0,t.jsxs)("div",{style:{padding:"24px 32px 24px 0"},children:[(0,t.jsxs)("div",{onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(s.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:"Skills"})]}),(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name}),e.description&&(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"8px 0 0 0",lineHeight:1.6},children:e.description})]}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28,marginTop:24},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:[{key:"overview",label:"Overview"},{key:"usage",label:"How to Use"}].map(e=>(0,t.jsx)("div",{onClick:()=>m(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Skill Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Metadata registered with this skill"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:160},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:f.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},a))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Status"}),(0,t.jsx)("span",{style:{fontSize:12,padding:"3px 10px",borderRadius:12,backgroundColor:e.enabled?"#e6f4ea":"#f1f3f4",color:e.enabled?"#137333":"#5f6368",fontWeight:500},children:e.enabled?"Public":"Draft"})]}),x&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Source"}),(0,t.jsxs)("a",{href:x,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,color:"#1a73e8",wordBreak:"break-all",display:"flex",alignItems:"center",gap:4},children:[x.replace("https://",""),(0,t.jsx)(l.LinkOutlined,{style:{fontSize:11,flexShrink:0}})]})]}),e.keywords&&e.keywords.length>0&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.keywords.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Skill ID"}),(0,t.jsx)("div",{style:{fontSize:12,fontFamily:"monospace",color:"#3c4043",wordBreak:"break-all"},children:e.id})]})]})]}),"usage"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"Using this skill"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:"Once your proxy is set as a marketplace, enable this skill in Claude Code with one command:"}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden",marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"Run in Claude Code"}),(0,t.jsxs)("button",{onClick:()=>g(h,"install"),style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"install"===p?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["install"===p?(0,t.jsx)(i.CheckOutlined,{}):(0,t.jsx)(r.CopyOutlined,{}),"install"===p?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:14,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:h})]}),(0,t.jsxs)("p",{style:{fontSize:13,color:"#5f6368",lineHeight:1.6,margin:0},children:["Don't have the marketplace configured yet?"," ",(0,t.jsx)("span",{onClick:()=>m("setup"),style:{color:"#1a73e8",cursor:"pointer"},children:"See one-time setup →"})]})]}),"setup"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"One-time marketplace setup"}),(0,t.jsxs)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:["Add this to ",(0,t.jsx)("code",{style:{fontSize:13,backgroundColor:"#f1f3f4",padding:"1px 6px",borderRadius:4},children:"~/.claude/settings.json"})," to point Claude Code at your proxy:"]}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"~/.claude/settings.json"}),(0,t.jsxs)("button",{onClick:()=>{g(JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2),"settings")},style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"settings"===p?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["settings"===p?(0,t.jsx)(i.CheckOutlined,{}):(0,t.jsx)(r.CopyOutlined,{}),"settings"===p?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:13,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2)})]})]})]})}],652272)},115571,e=>{"use strict";let t="local-storage-change";function a(e){window.dispatchEvent(new CustomEvent(t,{detail:{key:e}}))}function s(e){try{return window.localStorage.getItem(e)}catch(t){return console.warn(`Error reading localStorage key "${e}":`,t),null}}function r(e,t){try{window.localStorage.setItem(e,t)}catch(t){console.warn(`Error setting localStorage key "${e}":`,t)}}function i(e){try{window.localStorage.removeItem(e)}catch(t){console.warn(`Error removing localStorage key "${e}":`,t)}}e.s(["LOCAL_STORAGE_EVENT",0,t,"emitLocalStorageChange",()=>a,"getLocalStorageItem",()=>s,"removeLocalStorageItem",()=>i,"setLocalStorageItem",()=>r])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let s={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"};var r=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(r.default,(0,t.default)({},e,{ref:i,icon:s}))});e.s(["LinkOutlined",0,i],596239)},928685,e=>{"use strict";var t=e.i(38953);e.s(["SearchOutlined",()=>t.default])},879664,e=>{"use strict";let t=(0,e.i(475254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",()=>t])},916925,e=>{"use strict";var t,a=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t.ZAI="Z.AI (Zhipu AI)",t);let s={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference",ZAI:"zai"},r="../ui/assets/logos/",i={"A2A Agent":`${r}a2a_agent.png`,Ai21:`${r}ai21.svg`,"Ai21 Chat":`${r}ai21.svg`,"AI/ML API":`${r}aiml_api.svg`,"Aiohttp Openai":`${r}openai_small.svg`,Anthropic:`${r}anthropic.svg`,"Anthropic Text":`${r}anthropic.svg`,AssemblyAI:`${r}assemblyai_small.png`,Azure:`${r}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${r}microsoft_azure.svg`,"Azure Text":`${r}microsoft_azure.svg`,Baseten:`${r}baseten.svg`,"Amazon Bedrock":`${r}bedrock.svg`,"Amazon Bedrock Mantle":`${r}bedrock.svg`,"AWS SageMaker":`${r}bedrock.svg`,Cerebras:`${r}cerebras.svg`,Cloudflare:`${r}cloudflare.svg`,Codestral:`${r}mistral.svg`,Cohere:`${r}cohere.svg`,"Cohere Chat":`${r}cohere.svg`,Cometapi:`${r}cometapi.svg`,Cursor:`${r}cursor.svg`,"Databricks (Qwen API)":`${r}databricks.svg`,Dashscope:`${r}dashscope.svg`,Deepseek:`${r}deepseek.svg`,Deepgram:`${r}deepgram.png`,DeepInfra:`${r}deepinfra.png`,ElevenLabs:`${r}elevenlabs.png`,"Fal AI":`${r}fal_ai.jpg`,"Featherless Ai":`${r}featherless.svg`,"Fireworks AI":`${r}fireworks.svg`,Friendliai:`${r}friendli.svg`,"Github Copilot":`${r}github_copilot.svg`,"Google AI Studio":`${r}google.svg`,GradientAI:`${r}gradientai.svg`,Groq:`${r}groq.svg`,vllm:`${r}vllm.png`,Huggingface:`${r}huggingface.svg`,Hyperbolic:`${r}hyperbolic.svg`,Infinity:`${r}infinity.png`,"Jina AI":`${r}jina.png`,"Lambda Ai":`${r}lambda.svg`,"Lm Studio":`${r}lmstudio.svg`,"Meta Llama":`${r}meta_llama.svg`,MiniMax:`${r}minimax.svg`,"Mistral AI":`${r}mistral.svg`,Moonshot:`${r}moonshot.svg`,Morph:`${r}morph.svg`,Nebius:`${r}nebius.svg`,Novita:`${r}novita.svg`,"Nvidia Nim":`${r}nvidia_nim.svg`,Ollama:`${r}ollama.svg`,"Ollama Chat":`${r}ollama.svg`,Oobabooga:`${r}openai_small.svg`,OpenAI:`${r}openai_small.svg`,"Openai Like":`${r}openai_small.svg`,"OpenAI Text Completion":`${r}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${r}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${r}openai_small.svg`,Openrouter:`${r}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${r}oracle.svg`,Perplexity:`${r}perplexity-ai.svg`,Recraft:`${r}recraft.svg`,Replicate:`${r}replicate.svg`,RunwayML:`${r}runwayml.png`,Sagemaker:`${r}bedrock.svg`,Sambanova:`${r}sambanova.svg`,"SAP Generative AI Hub":`${r}sap.png`,Snowflake:`${r}snowflake.svg`,"Text-Completion-Codestral":`${r}mistral.svg`,TogetherAI:`${r}togetherai.svg`,Topaz:`${r}topaz.svg`,Triton:`${r}nvidia_triton.png`,V0:`${r}v0.svg`,"Vercel Ai Gateway":`${r}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${r}google.svg`,"Vertex Ai Beta":`${r}google.svg`,Vllm:`${r}vllm.png`,VolcEngine:`${r}volcengine.png`,"Voyage AI":`${r}voyage.webp`,Watsonx:`${r}watsonx.svg`,"Watsonx Text":`${r}watsonx.svg`,xAI:`${r}xai.svg`,Xinference:`${r}xinference.svg`};e.s(["Providers",()=>a,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else if("Z.AI (Zhipu AI)"===e)return"zai/glm-4.5";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:i[e],displayName:e}}let t=Object.keys(s).find(t=>s[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let r=a[t];return{logo:i[r],displayName:r}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let a=s[e];console.log(`Provider mapped to: ${a}`);let r=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let s=t.litellm_provider;(s===a||"string"==typeof s&&s.includes(a))&&r.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&r.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&r.push(e)}))),r},"providerLogoMap",0,i,"provider_map",0,s])},798496,e=>{"use strict";var t=e.i(843476),a=e.i(152990),s=e.i(682830),r=e.i(271645),i=e.i(269200),l=e.i(427612),n=e.i(64848),o=e.i(942232),c=e.i(496020),d=e.i(977572),m=e.i(94629),p=e.i(360820),u=e.i(871943);function g({data:e=[],columns:g,isLoading:x=!1,defaultSorting:h=[],pagination:f,onPaginationChange:_,enablePagination:b=!1,onRowClick:y}){let[v,j]=r.default.useState(h),[A]=r.default.useState("onChange"),[N,T]=r.default.useState({}),[S,C]=r.default.useState({}),w=(0,a.useReactTable)({data:e,columns:g,state:{sorting:v,columnSizing:N,columnVisibility:S,...b&&f?{pagination:f}:{}},columnResizeMode:A,onSortingChange:j,onColumnSizingChange:T,onColumnVisibilityChange:C,...b&&_?{onPaginationChange:_}:{},getCoreRowModel:(0,s.getCoreRowModel)(),getSortedRowModel:(0,s.getSortedRowModel)(),...b?{getPaginationRowModel:(0,s.getPaginationRowModel)()}:{},enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("div",{className:"relative min-w-full",children:(0,t.jsxs)(i.Table,{className:"[&_td]:py-2 [&_th]:py-2",style:{width:w.getTotalSize(),minWidth:"100%",tableLayout:"fixed"},children:[(0,t.jsx)(l.TableHead,{children:w.getHeaderGroups().map(e=>(0,t.jsx)(c.TableRow,{children:e.headers.map(e=>(0,t.jsxs)(n.TableHeaderCell,{className:`py-1 h-8 relative ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,a.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(p.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(u.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(m.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,t.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 ${e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200"}`})]},e.id))},e.id))}),(0,t.jsx)(o.TableBody,{children:x?(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:g.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading models..."})})})}):w.getRowModel().rows.length>0?w.getRowModel().rows.map(e=>(0,t.jsx)(c.TableRow,{onClick:()=>y?.(e.original),className:y?"cursor-pointer hover:bg-gray-50":"",children:e.getVisibleCells().map(e=>(0,t.jsx)(d.TableCell,{className:`py-0.5 overflow-hidden ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:g.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No models found"})})})})})]})})})})}e.s(["ModelDataTable",()=>g])},737033,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(599724),r=e.i(928685),i=e.i(311451),l=e.i(199133),n=e.i(798496),o=e.i(389083),c=e.i(592968),d=e.i(166406),m=e.i(596239),p=e.i(652272);e.s(["default",0,({skills:e,isLoading:u,isAdmin:g,accessToken:x,publicPage:h=!1,onPublishSuccess:f})=>{let[_,b]=(0,a.useState)(""),[y,v]=(0,a.useState)(void 0),[j,A]=(0,a.useState)(null),N=e.length,T=(0,a.useMemo)(()=>[...new Set(e.map(e=>e.domain).filter(Boolean))],[e]),S=(0,a.useMemo)(()=>[...new Set(e.map(e=>e.namespace).filter(Boolean))],[e]),C=(0,a.useMemo)(()=>{let t=e;if(y&&(t=t.filter(e=>(e.domain||"General")===y)),_.trim()){let e=_.toLowerCase();t=t.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.domain?.toLowerCase().includes(e)||t.namespace?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))}return t},[e,_,y]);return j?(0,t.jsx)(p.default,{skill:j,onBack:()=>A(null),isAdmin:g,accessToken:x,onPublishClick:f}):u?(0,t.jsx)("div",{className:"text-center py-16 text-gray-400",children:"Loading skills..."}):(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Total Skills"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:N})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Namespaces"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:S.length})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Domains"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:T.length})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("h3",{className:"text-sm font-semibold text-gray-700",children:["All ",h?"Public ":"","Skills"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Select,{placeholder:"All Domains",allowClear:!0,value:y,onChange:e=>v(e),style:{width:160},options:T.map(e=>({label:e,value:e}))}),(0,t.jsx)(i.Input,{prefix:(0,t.jsx)(r.SearchOutlined,{className:"text-gray-400"}),placeholder:"Search by name, namespace, or tag…",value:_,onChange:e=>b(e.target.value),style:{width:280},allowClear:!0})]})]}),(0,t.jsx)(n.ModelDataTable,{columns:((e,a,r=!1)=>[{header:"Skill Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:r})=>{let i=r.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)("button",{type:"button",className:"font-medium text-sm cursor-pointer text-blue-600 hover:underline bg-transparent border-none p-0",onClick:()=>e(i),children:i.name}),(0,t.jsx)(c.Tooltip,{title:"Copy skill name",children:(0,t.jsx)(d.CopyOutlined,{onClick:()=>a(i.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),i.description&&(0,t.jsx)(s.Text,{className:"text-xs text-gray-500 line-clamp-1 md:hidden",children:i.description})]})}},{header:"Description",accessorKey:"description",enableSorting:!1,cell:({row:e})=>(0,t.jsx)(s.Text,{className:"text-xs line-clamp-2",children:e.original.description||"-"})},{header:"Category",accessorKey:"category",enableSorting:!0,cell:({row:e})=>{let a=e.original.category;return a?(0,t.jsx)(o.Badge,{color:"blue",size:"xs",children:a}):(0,t.jsx)(s.Text,{className:"text-xs text-gray-400",children:"-"})}},{header:"Domain",accessorKey:"domain",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(s.Text,{className:"text-xs",children:e.original.domain||"-"})},{header:"Source",accessorKey:"source",enableSorting:!1,cell:({row:e})=>{let a=e.original.source,r=null,i="-";return(a?.source==="github"&&a.repo?(r=`https://github.com/${a.repo}`,i=a.repo):a?.source==="git-subdir"&&a.url?i=(r=a.path?`${a.url}/tree/main/${a.path}`:a.url).replace("https://github.com/",""):a?.source==="url"&&a.url&&(r=a.url,i=a.url.replace(/^https?:\/\//,"")),r)?(0,t.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:underline truncate max-w-[180px]",title:i,children:[(0,t.jsx)("span",{className:"truncate",children:i}),(0,t.jsx)(m.LinkOutlined,{className:"shrink-0",style:{fontSize:10}})]}):(0,t.jsx)(s.Text,{className:"text-xs text-gray-400",children:"-"})}},{header:"Status",accessorKey:"enabled",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(o.Badge,{color:e.original.enabled?"green":"gray",size:"xs",children:e.original.enabled?"Public":"Draft"})}])(e=>A(e),e=>{navigator.clipboard.writeText(e)},h),data:C,isLoading:!1,defaultSorting:[{id:"name",desc:!1}]}),(0,t.jsx)("div",{className:"mt-3 text-center",children:(0,t.jsxs)(s.Text,{className:"text-sm text-gray-500",children:["Showing ",C.length," of ",N," skill",1!==N?"s":""]})})]})]})}],737033)},93826,174886,952571,e=>{"use strict";var t=e.i(271645);let a=t.forwardRef(function(e,a){return t.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:a},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});e.s(["SearchIcon",0,a],93826);var s=e.i(991124);e.s(["Copy",()=>s.default],174886);var r=e.i(879664);e.s(["Info",()=>r.default],952571)},976883,e=>{"use strict";var t=e.i(843476),a=e.i(275144),s=e.i(434626),r=e.i(93826),i=e.i(994388),l=e.i(304967),n=e.i(599724),o=e.i(629569),c=e.i(212931),d=e.i(199133),m=e.i(653496),p=e.i(262218),u=e.i(592968),g=e.i(174886),x=e.i(952571),h=e.i(271645),f=e.i(798496),_=e.i(727749),b=e.i(402874),y=e.i(764205),v=e.i(737033),j=e.i(190272),A=e.i(785913),N=e.i(916925);let{TabPane:T}=m.Tabs;e.s(["default",0,({accessToken:e,isEmbedded:S=!1})=>{let C,w,I,k,E,O,M,[L,$]=(0,h.useState)(null),[R,P]=(0,h.useState)(null),[z,D]=(0,h.useState)(null),[H,B]=(0,h.useState)("LiteLLM Gateway"),[G,F]=(0,h.useState)(null),[U,V]=(0,h.useState)(""),[K,W]=(0,h.useState)({}),[X,q]=(0,h.useState)(!0),[Y,Z]=(0,h.useState)(!0),[J,Q]=(0,h.useState)(!0),[ee,et]=(0,h.useState)(""),[ea,es]=(0,h.useState)(""),[er,ei]=(0,h.useState)(""),[el,en]=(0,h.useState)([]),[eo,ec]=(0,h.useState)([]),[ed,em]=(0,h.useState)([]),[ep,eu]=(0,h.useState)([]),[eg,ex]=(0,h.useState)([]),[eh,ef]=(0,h.useState)("I'm alive! ✓"),[e_,eb]=(0,h.useState)(!1),[ey,ev]=(0,h.useState)(!1),[ej,eA]=(0,h.useState)(!1),[eN,eT]=(0,h.useState)(null),[eS,eC]=(0,h.useState)(null),[ew,eI]=(0,h.useState)(null),[ek,eE]=(0,h.useState)({}),[eO,eM]=(0,h.useState)("models"),[eL,e$]=(0,h.useState)([]),[eR,eP]=(0,h.useState)(!1);(0,h.useEffect)(()=>{(async()=>{try{await (0,y.getUiConfig)()}catch(e){console.error("Failed to get UI config:",e)}let e=async()=>{try{q(!0);let e=await (0,y.modelHubPublicModelsCall)();console.log("ModelHubData:",e),$(Array.isArray(e)?e:[])}catch(e){console.error("There was an error fetching the public model data",e),ef("Service unavailable")}finally{q(!1)}},t=async()=>{try{Z(!0);let e=await (0,y.agentHubPublicModelsCall)();console.log("AgentHubData:",e),P(Array.isArray(e)?e:[])}catch(e){console.error("There was an error fetching the public agent data",e)}finally{Z(!1)}},a=async()=>{try{Q(!0);let e=await (0,y.mcpHubPublicServersCall)();console.log("MCPHubData:",e),D(Array.isArray(e)?e:[])}catch(e){console.error("There was an error fetching the public MCP server data",e)}finally{Q(!1)}},s=async()=>{try{eP(!0);let e=await (0,y.skillHubPublicCall)();e$(e.plugins??[])}catch(e){console.error("There was an error fetching the public skill data",e)}finally{eP(!1)}};(async()=>{let e=await (0,y.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),B(e.docs_title),F(e.custom_docs_description),V(e.litellm_version),W(e.useful_links||{})})(),e(),t(),a(),s()})()},[]),(0,h.useEffect)(()=>{},[ee,el,eo,ed]);let ez=(0,h.useMemo)(()=>{if(!L||!Array.isArray(L))return[];let e=L;if(ee.trim()){let t=ee.toLowerCase(),a=t.split(/\s+/),s=L.filter(e=>{let s=e.model_group.toLowerCase();return!!s.includes(t)||a.every(e=>s.includes(e))});s.length>0&&(e=s.sort((e,a)=>{let s=e.model_group.toLowerCase(),r=a.model_group.toLowerCase(),i=1e3*(s===t),l=1e3*(r===t),n=100*!!s.startsWith(t),o=100*!!r.startsWith(t),c=50*!!t.split(/\s+/).every(e=>s.includes(e)),d=50*!!t.split(/\s+/).every(e=>r.includes(e)),m=s.length;return l+o+d+(1e3-r.length)-(i+n+c+(1e3-m))}))}return e.filter(e=>{let t=0===el.length||el.some(t=>e.providers.includes(t)),a=0===eo.length||eo.includes(e.mode||""),s=0===ed.length||Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).some(([e])=>{let t=e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return ed.includes(t)});return t&&a&&s})},[L,ee,el,eo,ed]),eD=(0,h.useMemo)(()=>{if(!R||!Array.isArray(R))return[];let e=R;if(ea.trim()){let t=ea.toLowerCase(),a=t.split(/\s+/);e=(e=R.filter(e=>{let s=e.name.toLowerCase(),r=e.description.toLowerCase();return!!(s.includes(t)||r.includes(t))||a.every(e=>s.includes(e)||r.includes(e))})).sort((e,a)=>{let s=e.name.toLowerCase(),r=a.name.toLowerCase(),i=1e3*(s===t),l=1e3*(r===t),n=100*!!s.startsWith(t),o=100*!!r.startsWith(t),c=i+n+(1e3-s.length);return l+o+(1e3-r.length)-c})}return e.filter(e=>0===ep.length||e.skills?.some(e=>e.tags?.some(e=>ep.includes(e))))},[R,ea,ep]),eH=(0,h.useMemo)(()=>{if(!z||!Array.isArray(z))return[];let e=z;if(er.trim()){let t=er.toLowerCase(),a=t.split(/\s+/);e=(e=z.filter(e=>{let s=e.server_name.toLowerCase(),r=(e.mcp_info?.description||"").toLowerCase();return!!(s.includes(t)||r.includes(t))||a.every(e=>s.includes(e)||r.includes(e))})).sort((e,a)=>{let s=e.server_name.toLowerCase(),r=a.server_name.toLowerCase(),i=1e3*(s===t),l=1e3*(r===t),n=100*!!s.startsWith(t),o=100*!!r.startsWith(t),c=i+n+(1e3-s.length);return l+o+(1e3-r.length)-c})}return e.filter(e=>0===eg.length||eg.includes(e.transport))},[z,er,eg]),eB=e=>{navigator.clipboard.writeText(e),_.default.success("Copied to clipboard!")},eG=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eF=e=>`$${(1e6*e).toFixed(4)}`,eU=e=>e?e>=1e3?`${(e/1e3).toFixed(0)}K`:e.toString():"N/A";return(0,t.jsx)(a.ThemeProvider,{accessToken:e,children:(0,t.jsxs)("div",{className:S?"w-full":"min-h-screen bg-white",children:[!S&&(0,t.jsx)(b.default,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:eE,proxySettings:ek,accessToken:e||null,isPublicPage:!0,isDarkMode:!1,toggleDarkMode:()=>{}}),(0,t.jsxs)("div",{className:S?"w-full p-6":"w-full px-8 py-12",children:[S&&(0,t.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,t.jsx)("p",{className:"text-sm text-gray-700",children:"These are models, agents, and MCP servers your proxy admin has indicated are available in your company."})}),!S&&(0,t.jsxs)(l.Card,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,t.jsx)(o.Title,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,t.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:G||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,t.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"w-4 h-4 mr-2",children:"🔧"}),"Built with litellm: v",U]})})]}),K&&Object.keys(K).length>0&&(0,t.jsxs)(l.Card,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,t.jsx)(o.Title,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(K||{}).map(([e,t])=>({title:e,url:"string"==typeof t?t:t.url,index:"string"==typeof t?0:t.index??0})).sort((e,t)=>e.index-t.index).map(({title:e,url:a})=>(0,t.jsxs)("button",{onClick:()=>window.open(a,"_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,t.jsx)(s.ExternalLinkIcon,{className:"w-4 h-4"}),(0,t.jsx)(n.Text,{className:"text-sm font-medium",children:e})]},e))})]}),!S&&(0,t.jsxs)(l.Card,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,t.jsx)(o.Title,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,t.jsxs)(n.Text,{className:"text-green-600 font-medium text-sm",children:["Service status: ",eh]})})]}),(0,t.jsx)(l.Card,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:(0,t.jsxs)(m.Tabs,{activeKey:eO,onChange:eM,size:"large",className:"public-hub-tabs",children:[(0,t.jsxs)(T,{tab:"Model Hub",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,t.jsx)(o.Title,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,t.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,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,t.jsx)(u.Tooltip,{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,t.jsx)(x.Info,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.SearchIcon,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:ee,onChange:e=>et(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,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:el,onChange:e=>en(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:a}=(0,N.getProviderLogoAndName)(e.value);return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:a,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"capitalize",children:e.label})]})},children:L&&Array.isArray(L)&&(C=new Set,L.forEach(e=>{(e.providers??[]).forEach(e=>C.add(e))}),Array.from(C)).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:eo,onChange:e=>ec(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:L&&Array.isArray(L)&&(w=new Set,L.forEach(e=>{e.mode&&w.add(e.mode)}),Array.from(w)).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:ed,onChange:e=>em(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:L&&Array.isArray(L)&&(I=new Set,L.forEach(e=>{Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).forEach(([e])=>{let t=e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");I.add(t)})}),Array.from(I).sort()).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]})]}),(0,t.jsx)(f.ModelDataTable,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:({row:e})=>(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(u.Tooltip,{title:e.original.model_group,children:(0,t.jsx)(i.Button,{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:()=>{eT(e.original),eb(!0)},children:e.original.model_group})})}),size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:({row:e})=>{let a=e.original.providers??[];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:a.map(e=>{let{logo:a}=(0,N.getProviderLogoAndName)(e);return(0,t.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[a&&(0,t.jsx)("img",{src:a,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:({row:e})=>{let a=e.original.mode;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:(e=>{switch(e?.toLowerCase()){case"chat":return"💬";case"rerank":return"🔄";case"embedding":return"📄";default:return"🤖"}})(a||"")}),(0,t.jsx)(n.Text,{children:a||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(n.Text,{className:"text-center",children:eU(e.original.max_input_tokens)}),size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(n.Text,{className:"text-center",children:eU(e.original.max_output_tokens)}),size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:({row:e})=>{let a=e.original.input_cost_per_token;return(0,t.jsx)(n.Text,{className:"text-center",children:a?eF(a):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:({row:e})=>{let a=e.original.output_cost_per_token;return(0,t.jsx)(n.Text,{className:"text-center",children:a?eF(a):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:({row:e})=>{let a=Object.entries(e.original).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>eG(e));return 0===a.length?(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"}):1===a.length?(0,t.jsx)("div",{className:"h-6 flex items-center",children:(0,t.jsx)(p.Tag,{color:"blue",className:"text-xs",children:a[0]})}):(0,t.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,t.jsx)(p.Tag,{color:"blue",className:"text-xs",children:a[0]}),(0,t.jsx)(u.Tooltip,{title:(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:"All Features:"}),a.map((e,a)=>(0,t.jsxs)("div",{className:"text-xs",children:["• ",e]},a))]}),trigger:"click",placement:"topLeft",children:(0,t.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",a.length-1]})})]})},size:120},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,cell:({row:e})=>{let a=e.original,s="healthy"===a.health_status?"green":"unhealthy"===a.health_status?"red":"default",r=a.health_response_time?`Response Time: ${Number(a.health_response_time).toFixed(2)}ms`:"N/A",i=a.health_checked_at?`Last Checked: ${new Date(a.health_checked_at).toLocaleString()}`:"N/A";return(0,t.jsx)(u.Tooltip,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:r}),(0,t.jsx)("div",{children:i})]}),children:(0,t.jsx)(p.Tag,{color:s,children:(0,t.jsx)("span",{className:"capitalize",children:a.health_status??"Unknown"})},a.model_group)})},size:100},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:({row:e})=>{var a,s;let r,i=e.original;return(0,t.jsx)(n.Text,{className:"text-xs text-gray-600",children:(a=i.rpm,s=i.tpm,r=[],a&&r.push(`RPM: ${a.toLocaleString()}`),s&&r.push(`TPM: ${s.toLocaleString()}`),r.length>0?r.join(", "):"N/A")})},size:150}],data:ez,isLoading:X,defaultSorting:[{id:"model_group",desc:!1}]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsxs)(n.Text,{className:"text-sm text-gray-600",children:["Showing ",ez.length," of ",L?.length||0," models"]})})]},"models"),R&&Array.isArray(R)&&R.length>0&&(0,t.jsxs)(T,{tab:"Agent Hub",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,t.jsx)(o.Title,{className:"text-2xl font-semibold text-gray-900",children:"Available Agents"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium text-gray-700",children:"Search Agents:"}),(0,t.jsx)(u.Tooltip,{title:"Search agents by name or description",placement:"top",children:(0,t.jsx)(x.Info,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.SearchIcon,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",placeholder:"Search agent names or descriptions...",value:ea,onChange:e=>es(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,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Skills:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:ep,onChange:e=>eu(e),placeholder:"Select skills",className:"w-full",size:"large",allowClear:!0,children:R&&Array.isArray(R)&&(k=new Set,R.forEach(e=>{e.skills?.forEach(e=>{e.tags?.forEach(e=>k.add(e))})}),Array.from(k).sort()).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]})]}),(0,t.jsx)(f.ModelDataTable,{columns:[{header:"Agent Name",accessorKey:"name",enableSorting:!0,cell:({row:e})=>(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(u.Tooltip,{title:e.original.name,children:(0,t.jsx)(i.Button,{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:()=>{eC(e.original),ev(!0)},children:e.original.name})})}),size:150},{header:"Description",accessorKey:"description",enableSorting:!1,cell:({row:e})=>{let a=e.original.description??"",s=a.length>80?a.substring(0,80)+"...":a;return(0,t.jsx)(u.Tooltip,{title:a,children:(0,t.jsx)(n.Text,{className:"text-sm text-gray-700",children:s})})},size:250},{header:"Version",accessorKey:"version",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(n.Text,{className:"text-sm",children:e.original.version}),size:80},{header:"Provider",accessorKey:"provider",enableSorting:!1,cell:({row:e})=>{let a=e.original.provider;return a?(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(n.Text,{className:"font-medium",children:a.organization})}):(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"})},size:120},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:({row:e})=>{let a=e.original.skills||[];return 0===a.length?(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"}):1===a.length?(0,t.jsx)("div",{className:"h-6 flex items-center",children:(0,t.jsx)(p.Tag,{color:"purple",className:"text-xs",children:a[0].name})}):(0,t.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,t.jsx)(p.Tag,{color:"purple",className:"text-xs",children:a[0].name}),(0,t.jsx)(u.Tooltip,{title:(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:"All Skills:"}),a.map((e,a)=>(0,t.jsxs)("div",{className:"text-xs",children:["• ",e.name]},a))]}),trigger:"click",placement:"topLeft",children:(0,t.jsxs)("span",{className:"text-xs text-purple-600 cursor-pointer hover:text-purple-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",a.length-1]})})]})},size:150},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:({row:e})=>{let a=Object.entries(e.original.capabilities||{}).filter(([e,t])=>!0===t).map(([e])=>e);return 0===a.length?(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:a.map(e=>(0,t.jsx)(p.Tag,{color:"green",className:"text-xs capitalize",children:e},e))})},size:150}],data:eD,isLoading:Y,defaultSorting:[{id:"name",desc:!1}]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsxs)(n.Text,{className:"text-sm text-gray-600",children:["Showing ",eD.length," of ",R?.length||0," agents"]})})]},"agents"),z&&Array.isArray(z)&&z.length>0&&(0,t.jsxs)(T,{tab:"MCP Hub",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,t.jsx)(o.Title,{className:"text-2xl font-semibold text-gray-900",children:"Available MCP Servers"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium text-gray-700",children:"Search MCP Servers:"}),(0,t.jsx)(u.Tooltip,{title:"Search MCP servers by name or description",placement:"top",children:(0,t.jsx)(x.Info,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.SearchIcon,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",placeholder:"Search MCP server names or descriptions...",value:er,onChange:e=>ei(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,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Transport:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:eg,onChange:e=>ex(e),placeholder:"Select transport types",className:"w-full",size:"large",allowClear:!0,children:z&&Array.isArray(z)&&(E=new Set,z.forEach(e=>{e.transport&&E.add(e.transport)}),Array.from(E).sort()).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]})]}),(0,t.jsx)(f.ModelDataTable,{columns:[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,cell:({row:e})=>(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(u.Tooltip,{title:e.original.server_name,children:(0,t.jsx)(i.Button,{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:()=>{eI(e.original),eA(!0)},children:e.original.server_name})})}),size:150},{header:"Description",accessorKey:"mcp_info.description",enableSorting:!1,cell:({row:e})=>{let a=String(e.original.mcp_info?.description??"-"),s=a.length>80?a.substring(0,80)+"...":a;return(0,t.jsx)(u.Tooltip,{title:a,children:(0,t.jsx)(n.Text,{className:"text-sm text-gray-700",children:s})})},size:250},{header:"URL",accessorKey:"url",enableSorting:!1,cell:({row:e})=>{let a=e.original.url??"",s=a.length>40?a.substring(0,40)+"...":a;return(0,t.jsx)(u.Tooltip,{title:a,children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Text,{className:"text-xs font-mono",children:s}),(0,t.jsx)(g.Copy,{onClick:()=>eB(a),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-3 h-3"})]})})},size:200},{header:"Transport",accessorKey:"transport",enableSorting:!0,cell:({row:e})=>{let a=e.original.transport;return(0,t.jsx)(p.Tag,{color:"blue",className:"text-xs uppercase",children:a})},size:100},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,cell:({row:e})=>{let a=e.original.auth_type;return(0,t.jsx)(p.Tag,{color:"none"===a?"gray":"green",className:"text-xs capitalize",children:a})},size:100}],data:eH,isLoading:J,defaultSorting:[{id:"server_name",desc:!1}]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsxs)(n.Text,{className:"text-sm text-gray-600",children:["Showing ",eH.length," of ",z?.length||0," MCP servers"]})})]},"mcp"),(0,t.jsx)(T,{tab:"Skill Hub",children:(0,t.jsx)(v.default,{skills:eL,isLoading:eR,publicPage:!0})},"skills")]})})]}),(0,t.jsx)(c.Modal,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:eN?.model_group||"Model Details"}),eN&&(0,t.jsx)(u.Tooltip,{title:"Copy model name",children:(0,t.jsx)(g.Copy,{onClick:()=>eB(eN.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:e_,footer:null,onOk:()=>{eb(!1),eT(null)},onCancel:()=>{eb(!1),eT(null)},children:eN&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{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)(n.Text,{className:"font-medium",children:"Model Name:"}),(0,t.jsx)(n.Text,{children:eN.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(n.Text,{children:eN.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(eN.providers??[]).map(e=>{let{logo:a}=(0,N.getProviderLogoAndName)(e);return(0,t.jsx)(p.Tag,{color:"blue",children:(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[a&&(0,t.jsx)("img",{src:a,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),eN.model_group.includes("*")&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,t.jsx)(x.Info,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,t.jsxs)(n.Text,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the"," ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,t.jsxs)(n.Text,{className:"text-sm text-blue-800",children:["For example, with"," ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:eN.model_group}),", you can use any string (",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:eN.model_group.replaceAll("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{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)(n.Text,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(n.Text,{children:eN.max_input_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(n.Text,{children:eN.max_output_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(n.Text,{children:eN.input_cost_per_token?eF(eN.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(n.Text,{children:eN.output_cost_per_token?eF(eN.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(O=Object.entries(eN).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>e),M=["green","blue","purple","orange","red","yellow"],0===O.length?(0,t.jsx)(n.Text,{className:"text-gray-500",children:"No special capabilities listed"}):O.map((e,a)=>(0,t.jsx)(p.Tag,{color:M[a%M.length],children:eG(e)},e)))})]}),(eN.tpm||eN.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[eN.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(n.Text,{children:eN.tpm.toLocaleString()})]}),eN.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(n.Text,{children:eN.rpm.toLocaleString()})]})]})]}),eN.supported_openai_params&&eN.supported_openai_params.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eN.supported_openai_params.map(e=>(0,t.jsx)(p.Tag,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-sm",children:(0,j.generateCodeSnippet)({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:[],selectedPolicies:[],selectedMCPServers:[],endpointType:(0,A.getEndpointType)(eN.mode||"chat"),selectedModel:eN.model_group,selectedSdk:"openai"})})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB((0,j.generateCodeSnippet)({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:[],selectedPolicies:[],selectedMCPServers:[],endpointType:(0,A.getEndpointType)(eN.mode||"chat"),selectedModel:eN.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})}),(0,t.jsx)(c.Modal,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:eS?.name||"Agent Details"}),eS&&(0,t.jsx)(u.Tooltip,{title:"Copy agent name",children:(0,t.jsx)(g.Copy,{onClick:()=>eB(eS.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ey,footer:null,onOk:()=>{ev(!1),eC(null)},onCancel:()=>{ev(!1),eC(null)},children:eS&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Name:"}),(0,t.jsx)(n.Text,{children:eS.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Version:"}),(0,t.jsx)(n.Text,{children:eS.version})]}),(0,t.jsxs)("div",{className:"col-span-2",children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(n.Text,{children:eS.description})]}),eS.url&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"URL:"}),(0,t.jsx)("a",{href:eS.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all",children:eS.url})]})]})]}),eS.capabilities&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(eS.capabilities).filter(([e,t])=>!0===t).map(([e])=>(0,t.jsx)(p.Tag,{color:"green",className:"capitalize",children:e},e))})]}),eS.skills&&eS.skills.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,t.jsx)("div",{className:"space-y-4",children:eS.skills.map((e,a)=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium text-base",children:e.name}),(0,t.jsx)(n.Text,{className:"text-sm text-gray-600",children:e.description})]})}),e.tags&&e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(e=>(0,t.jsx)(p.Tag,{color:"purple",className:"text-xs",children:e},e))})]},a))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Input Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(eS.defaultInputModes??[]).map(e=>(0,t.jsx)(p.Tag,{color:"blue",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Output Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(eS.defaultOutputModes??[]).map(e=>(0,t.jsx)(p.Tag,{color:"blue",children:e},e))})]})]})]}),eS.documentationUrl&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Documentation"}),(0,t.jsxs)("a",{href:eS.documentationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 flex items-center space-x-2",children:[(0,t.jsx)(s.ExternalLinkIcon,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"View Documentation"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example (A2A Protocol)"}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 1: Retrieve Agent Card"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-xs",children:`base_url = '${eS.url}'
+
+resolver = A2ACardResolver(
+ httpx_client=httpx_client,
+ base_url=base_url,
+ # agent_card_path uses default, extended_agent_card_path also uses default
+)
+
+# Fetch Public Agent Card and Initialize Client
+final_agent_card_to_use: AgentCard | None = None
+_public_card = (
+ await resolver.get_agent_card()
+) # Fetches from default public path - \`/agents/{agent_id}/\`
+final_agent_card_to_use = _public_card
+
+if _public_card.supports_authenticated_extended_card:
+ try:
+ auth_headers_dict = {
+ 'Authorization': 'Bearer dummy-token-for-extended-card'
+ }
+ _extended_card = await resolver.get_agent_card(
+ relative_card_path=EXTENDED_AGENT_CARD_PATH,
+ http_kwargs={'headers': auth_headers_dict},
+ )
+ final_agent_card_to_use = (
+ _extended_card # Update to use the extended card
+ )
+ except Exception as e_extended:
+ logger.warning(
+ f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',
+ exc_info=True,
+ )`})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB(`from a2a.client import A2ACardResolver, A2AClient
+from a2a.types import (
+ AgentCard,
+ MessageSendParams,
+ SendMessageRequest,
+ SendStreamingMessageRequest,
+)
+from a2a.utils.constants import (
+ AGENT_CARD_WELL_KNOWN_PATH,
+ EXTENDED_AGENT_CARD_PATH,
+)
+
+base_url = '${eS.url}'
+
+resolver = A2ACardResolver(
+ httpx_client=httpx_client,
+ base_url=base_url,
+ # agent_card_path uses default, extended_agent_card_path also uses default
+)
+
+# Fetch Public Agent Card and Initialize Client
+final_agent_card_to_use: AgentCard | None = None
+_public_card = (
+ await resolver.get_agent_card()
+) # Fetches from default public path - \`/agents/{agent_id}/\`
+final_agent_card_to_use = _public_card
+
+if _public_card.supports_authenticated_extended_card:
+ try:
+ auth_headers_dict = {
+ 'Authorization': 'Bearer dummy-token-for-extended-card'
+ }
+ _extended_card = await resolver.get_agent_card(
+ relative_card_path=EXTENDED_AGENT_CARD_PATH,
+ http_kwargs={'headers': auth_headers_dict},
+ )
+ final_agent_card_to_use = (
+ _extended_card # Update to use the extended card
+ )
+ except Exception as e_extended:
+ logger.warning(
+ f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',
+ exc_info=True,
+ )`)},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 2: Call the Agent"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-xs",children:`client = A2AClient(
+ httpx_client=httpx_client, agent_card=final_agent_card_to_use
+)
+
+send_message_payload: dict[str, Any] = {
+ 'message': {
+ 'role': 'user',
+ 'parts': [
+ {'kind': 'text', 'text': 'how much is 10 USD in INR?'}
+ ],
+ 'messageId': uuid4().hex,
+ },
+}
+request = SendMessageRequest(
+ id=str(uuid4()), params=MessageSendParams(**send_message_payload)
+)
+
+response = await client.send_message(request)
+print(response.model_dump(mode='json', exclude_none=True))`})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB(`client = A2AClient(
+ httpx_client=httpx_client, agent_card=final_agent_card_to_use
+)
+
+send_message_payload: dict[str, Any] = {
+ 'message': {
+ 'role': 'user',
+ 'parts': [
+ {'kind': 'text', 'text': 'how much is 10 USD in INR?'}
+ ],
+ 'messageId': uuid4().hex,
+ },
+}
+request = SendMessageRequest(
+ id=str(uuid4()), params=MessageSendParams(**send_message_payload)
+)
+
+response = await client.send_message(request)
+print(response.model_dump(mode='json', exclude_none=True))`)},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})]})}),(0,t.jsx)(c.Modal,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:ew?.server_name||"MCP Server Details"}),ew&&(0,t.jsx)(u.Tooltip,{title:"Copy server name",children:(0,t.jsx)(g.Copy,{onClick:()=>eB(ew.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ej,footer:null,onOk:()=>{eA(!1),eI(null)},onCancel:()=>{eA(!1),eI(null)},children:ew&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Server Name:"}),(0,t.jsx)(n.Text,{children:ew.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Transport:"}),(0,t.jsx)(p.Tag,{color:"blue",children:ew.transport})]}),ew.alias&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Alias:"}),(0,t.jsx)(n.Text,{children:ew.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Auth Type:"}),(0,t.jsx)(p.Tag,{color:"none"===ew.auth_type?"gray":"green",children:ew.auth_type})]}),(0,t.jsxs)("div",{className:"col-span-2",children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(n.Text,{children:ew.mcp_info?.description||"-"})]}),(0,t.jsxs)("div",{className:"col-span-2",children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("a",{href:ew.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all flex items-center space-x-2",children:[(0,t.jsx)("span",{children:ew.url}),(0,t.jsx)(s.ExternalLinkIcon,{className:"w-4 h-4"})]})]})]})]}),ew.mcp_info&&Object.keys(ew.mcp_info).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Additional Information"}),(0,t.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(ew.mcp_info,null,2)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-sm",children:`# Using MCP Server with Python FastMCP
+
+from fastmcp import Client
+import asyncio
+
+# Standard MCP configuration
+config = {
+ "mcpServers": {
+ "${ew.server_name}": {
+ "url": "http://localhost:4000/${ew.server_name}/mcp",
+ "headers": {
+ "x-litellm-api-key": "Bearer sk-1234"
+ }
+ }
+ }
+}
+
+# Create a client that connects to the server
+client = Client(config)
+
+async def main():
+ async with client:
+ # List available tools
+ tools = await client.list_tools()
+ print(f"Available tools: {[tool.name for tool in tools]}")
+
+ # Call a tool
+ response = await client.call_tool(
+ name="tool_name",
+ arguments={"arg": "value"}
+ )
+ print(f"Response: {response}")
+
+if __name__ == "__main__":
+ asyncio.run(main())`})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB(`# Using MCP Server with Python FastMCP
+
+from fastmcp import Client
+import asyncio
+
+# Standard MCP configuration
+config = {
+ "mcpServers": {
+ "${ew.server_name}": {
+ "url": "http://localhost:4000/${ew.server_name}/mcp",
+ "headers": {
+ "x-litellm-api-key": "Bearer sk-1234"
+ }
+ }
+ }
+}
+
+# Create a client that connects to the server
+client = Client(config)
+
+async def main():
+ async with client:
+ # List available tools
+ tools = await client.list_tools()
+ print(f"Available tools: {[tool.name for tool in tools]}")
+
+ # Call a tool
+ response = await client.call_tool(
+ name="tool_name",
+ arguments={"arg": "value"}
+ )
+ print(f"Response: {response}")
+
+if __name__ == "__main__":
+ asyncio.run(main())`)},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/11429586d5e74f7f.js b/litellm/proxy/_experimental/out/_next/static/chunks/11429586d5e74f7f.js
new file mode 100644
index 0000000000..e18d06ce7c
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/11429586d5e74f7f.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9314,263147,e=>{"use strict";var t=e.i(843476),s=e.i(199133),l=e.i(981339),a=e.i(645526),r=e.i(599724),i=e.i(266027),n=e.i(243652),o=e.i(764205),d=e.i(708347),c=e.i(135214);let u=(0,n.createQueryKeys)("accessGroups"),m=async e=>{let t=(0,o.getProxyBaseUrl)(),s=`${t}/v1/access_group`,l=await fetch(s,{method:"GET",headers:{[(0,o.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=(0,o.deriveErrorMessage)(e);throw(0,o.handleError)(t),Error(t)}return l.json()},p=()=>{let{accessToken:e,userRole:t}=(0,c.default)();return(0,i.useQuery)({queryKey:u.list({}),queryFn:async()=>m(e),enabled:!!e&&d.all_admin_roles.includes(t||"")})};e.s(["accessGroupKeys",0,u,"useAccessGroups",0,p],263147),e.s(["default",0,({value:e,onChange:i,placeholder:n="Select access groups",disabled:o=!1,style:d,className:c,showLabel:u=!1,labelText:m="Access Group",allowClear:g=!0})=>{let{data:h,isLoading:x,isError:y}=p();if(x)return(0,t.jsxs)("div",{children:[u&&(0,t.jsxs)(r.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.TeamOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(l.Skeleton.Input,{active:!0,block:!0,style:{height:32,...d}})]});let f=(h??[]).map(e=>({label:(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:e.access_group_name})," ",(0,t.jsxs)("span",{className:"text-gray-400 text-xs",children:["(",e.access_group_id,")"]})]}),value:e.access_group_id,selectedLabel:e.access_group_name,searchText:`${e.access_group_name} ${e.access_group_id}`}));return(0,t.jsxs)("div",{children:[u&&(0,t.jsxs)(r.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.TeamOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(s.Select,{mode:"multiple",value:e,placeholder:n,onChange:i,disabled:o,allowClear:g,showSearch:!0,style:{width:"100%",...d},className:`rounded-md ${c??""}`,notFoundContent:y?(0,t.jsx)("span",{className:"text-red-500",children:"Failed to load access groups"}):"No access groups found",filterOption:(e,t)=>(f.find(e=>e.value===t?.value)?.searchText??"").toLowerCase().includes(e.toLowerCase()),optionLabelProp:"selectedLabel",options:f.map(e=>({label:e.label,value:e.value,selectedLabel:e.selectedLabel}))})]})}],9314)},552130,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:r,className:i,accessToken:n,placeholder:o="Select agents",disabled:d=!1})=>{let[c,u]=(0,s.useState)([]),[m,p]=(0,s.useState)([]),[g,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(n){h(!0);try{let e=await (0,a.getAgentsList)(n),t=e?.agents||[];u(t);let s=new Set;t.forEach(e=>{let t=e.agent_access_groups;t&&Array.isArray(t)&&t.forEach(e=>s.add(e))}),p(Array.from(s))}catch(e){console.error("Error fetching agents:",e)}finally{h(!1)}}})()},[n]);let x=[...m.map(e=>({label:e,value:`group:${e}`,isAccessGroup:!0,searchText:`${e} Access Group`})),...c.map(e=>({label:`${e.agent_name||e.agent_id}`,value:e.agent_id,isAccessGroup:!1,searchText:`${e.agent_name||e.agent_id} ${e.agent_id} Agent`}))],y=[...r?.agents||[],...(r?.accessGroups||[]).map(e=>`group:${e}`)];return(0,t.jsx)("div",{children:(0,t.jsx)(l.Select,{mode:"multiple",placeholder:o,onChange:t=>{e({agents:t.filter(e=>!e.startsWith("group:")),accessGroups:t.filter(e=>e.startsWith("group:")).map(e=>e.replace("group:",""))})},value:y,loading:g,className:i,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>(x.find(e=>e.value===t?.value)?.searchText||"").toLowerCase().includes(e.toLowerCase()),children:x.map(e=>(0,t.jsx)(l.Select.Option,{value:e.value,label:e.label,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#722ed1",flexShrink:0}}),(0,t.jsx)("span",{style:{flex:1},children:e.label}),(0,t.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#722ed1",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"Agent"})]})},e.value))})})}])},844565,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:r,className:i,accessToken:n,placeholder:o="Select pass through routes",disabled:d=!1,teamId:c})=>{let[u,m]=(0,s.useState)([]),[p,g]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(n){g(!0);try{let e=await (0,a.getPassThroughEndpointsCall)(n,c);if(e.endpoints){let t=e.endpoints.flatMap(e=>{let t=e.path,s=e.methods;return s&&s.length>0?s.map(e=>({label:`${e} ${t}`,value:t})):[{label:t,value:t}]});m(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{g(!1)}}})()},[n,c]),(0,t.jsx)(l.Select,{mode:"tags",placeholder:o,onChange:e,value:r,loading:p,className:i,allowClear:!0,options:u,optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}])},810757,477386,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});e.s(["CogIcon",0,s],810757);let l=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});e.s(["BanIcon",0,l],477386)},557662,e=>{"use strict";let t="../ui/assets/logos/",s=[{id:"arize",displayName:"Arize",logo:`${t}arize.png`,supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"password"},description:"Arize Logging Integration"},{id:"braintrust",displayName:"Braintrust",logo:`${t}braintrust.png`,supports_key_team_logging:!1,dynamic_params:{braintrust_api_key:"password",braintrust_project_name:"text"},description:"Braintrust Logging Integration"},{id:"custom_callback_api",displayName:"Custom Callback API",logo:`${t}custom.svg`,supports_key_team_logging:!0,dynamic_params:{custom_callback_api_url:"text",custom_callback_api_headers:"text"},description:"Custom Callback API Logging Integration"},{id:"datadog",displayName:"Datadog",logo:`${t}datadog.png`,supports_key_team_logging:!1,dynamic_params:{dd_api_key:"password",dd_site:"text"},description:"Datadog Logging Integration"},{id:"lago",displayName:"Lago",logo:`${t}lago.svg`,supports_key_team_logging:!1,dynamic_params:{lago_api_url:"text",lago_api_key:"password"},description:"Lago Billing Logging Integration"},{id:"langfuse",displayName:"Langfuse",logo:`${t}langfuse.png`,supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},{id:"langfuse_otel",displayName:"Langfuse OTEL",logo:`${t}langfuse.png`,supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},{id:"langsmith",displayName:"LangSmith",logo:`${t}langsmith.png`,supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},{id:"openmeter",displayName:"OpenMeter",logo:`${t}openmeter.png`,supports_key_team_logging:!1,dynamic_params:{openmeter_api_key:"password",openmeter_base_url:"text"},description:"OpenMeter Logging Integration"},{id:"otel",displayName:"Open Telemetry",logo:`${t}otel.png`,supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:`${t}aws.svg`,supports_key_team_logging:!1,dynamic_params:{s3_bucket_name:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"S3 Bucket (AWS) Logging Integration"},{id:"SQS",displayName:"SQS",logo:`${t}aws.svg`,supports_key_team_logging:!1,dynamic_params:{sqs_queue_url:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"SQS Queue (AWS) Logging Integration"}],l=s.reduce((e,t)=>(e[t.displayName]=t,e),{}),a=s.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),r=s.reduce((e,t)=>(e[t.id]=t.displayName,e),{});e.s(["callbackInfo",0,l,"callback_map",0,a,"mapDisplayToInternalNames",0,e=>e.map(e=>a[e]||e),"mapInternalToDisplayNames",0,e=>e.map(e=>r[e]||e),"reverse_callback_map",0,r])},75921,e=>{"use strict";var t=e.i(843476),s=e.i(266027),l=e.i(243652),a=e.i(764205),r=e.i(135214);let i=(0,l.createQueryKeys)("mcpAccessGroups");var n=e.i(500727),o=e.i(699857),d=e.i(199133);let c="toolset:";e.s(["default",0,({onChange:e,value:l,className:u,accessToken:m,placeholder:p="Select MCP servers",disabled:g=!1,teamId:h})=>{let{data:x=[],isLoading:y}=(0,n.useMCPServers)(h),{data:f=[],isLoading:_}=(()=>{let{accessToken:e}=(0,r.default)();return(0,s.useQuery)({queryKey:i.list({}),queryFn:async()=>await (0,a.fetchMCPAccessGroups)(e),enabled:!!e})})(),{data:b=[],isLoading:j}=(0,o.useMCPToolsets)(),v=new Set(f),w=[...f.map(e=>({label:e,value:e,type:"accessGroup",searchText:`${e} Access Group`})),...x.map(e=>({label:`${e.server_name||e.server_id} (${e.server_id})`,value:e.server_id,type:"server",searchText:`${e.server_name||e.server_id} ${e.server_id} MCP Server`})),...b.map(e=>({label:e.toolset_name,value:`${c}${e.toolset_id}`,type:"toolset",searchText:`${e.toolset_name} ${e.toolset_id} Toolset`}))],N={accessGroup:"#52c41a",server:"#1890ff",toolset:"#722ed1"},k={accessGroup:"Access Group",server:"MCP Server",toolset:"Toolset"},S=[...l?.servers||[],...l?.accessGroups||[],...(l?.toolsets||[]).map(e=>`${c}${e}`)];return(0,t.jsx)("div",{children:(0,t.jsx)(d.Select,{mode:"multiple",placeholder:p,onChange:t=>{let s=t.filter(e=>e.startsWith(c)).map(e=>e.slice(c.length)),l=t.filter(e=>!e.startsWith(c));e({servers:l.filter(e=>!v.has(e)),accessGroups:l.filter(e=>v.has(e)),toolsets:s})},value:S,loading:y||_||j,className:u,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:g,filterOption:(e,t)=>(w.find(e=>e.value===t?.value)?.searchText||"").toLowerCase().includes(e.toLowerCase()),children:w.map(e=>(0,t.jsx)(d.Select.Option,{value:e.value,label:e.label,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:N[e.type],flexShrink:0}}),(0,t.jsx)("span",{style:{flex:1},children:e.label}),(0,t.jsx)("span",{style:{color:N[e.type],fontSize:"12px",fontWeight:500,opacity:.8},children:k[e.type]})]})},e.value))})})}],75921)},390605,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(764205),a=e.i(599724),r=e.i(482725),i=e.i(91739),n=e.i(500727),o=e.i(531516),d=e.i(696609);e.s(["default",0,({accessToken:e,selectedServers:c,toolPermissions:u,onChange:m,disabled:p=!1})=>{let{data:g=[]}=(0,n.useMCPServers)(),[h,x]=(0,s.useState)({}),[y,f]=(0,s.useState)({}),[_,b]=(0,s.useState)({}),[j,v]=(0,s.useState)({}),w=(0,s.useRef)(u);(0,s.useEffect)(()=>{w.current=u},[u]);let N=(0,s.useMemo)(()=>0===c.length?[]:g.filter(e=>c.includes(e.server_id)),[g,c]),k=async(e,t)=>{f(t=>({...t,[e]:!0})),b(t=>({...t,[e]:""}));try{let s=await (0,l.listMCPTools)(t,e);if(s.error)b(t=>({...t,[e]:s.message||"Failed to fetch tools"})),x(t=>({...t,[e]:[]}));else{let t=s.tools||[];x(s=>({...s,[e]:t}));let l=w.current;if(!l[e]&&t.length>0){let s=t.filter(e=>"delete"!==(0,d.classifyToolOp)(e.name,e.description||"")).map(e=>e.name);m({...l,[e]:s})}}}catch(t){console.error(`Error fetching tools for server ${e}:`,t),b(t=>({...t,[e]:"Failed to fetch tools"})),x(t=>({...t,[e]:[]}))}finally{f(t=>({...t,[e]:!1}))}};(0,s.useEffect)(()=>{N.forEach(t=>{h[t.server_id]||y[t.server_id]||k(t.server_id,e)})},[N,e]);let S=(e,t)=>{m({...u,[e]:t})};return 0===c.length?null:(0,t.jsx)("div",{className:"space-y-4",children:N.map(e=>{let s=e.server_name||e.alias||e.server_id,l=h[e.server_id]||[],n=u[e.server_id]||[],d=y[e.server_id],c=_[e.server_id],g=j[e.server_id]??"crud";return(0,t.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.Text,{className:"font-semibold text-gray-900",children:s}),e.description&&(0,t.jsx)(a.Text,{className:"text-sm text-gray-500",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[!p&&l.length>0&&(0,t.jsx)(i.Radio.Group,{value:g,onChange:t=>v(s=>({...s,[e.server_id]:t.target.value})),size:"small",optionType:"button",buttonStyle:"solid",options:[{label:"Risk Groups",value:"crud"},{label:"Flat List",value:"flat"}]}),!p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>{var t;let s;return s=h[t=e.server_id]||[],void m({...u,[t]:s.map(e=>e.name)})},disabled:d,children:"Select All"}),(0,t.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>{var t;return t=e.server_id,void m({...u,[t]:[]})},disabled:d,children:"Deselect All"})]})]})]}),(0,t.jsxs)("div",{className:"p-4",children:[d&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,t.jsx)(r.Spin,{size:"large"}),(0,t.jsx)(a.Text,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),c&&!d&&(0,t.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,t.jsx)(a.Text,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,t.jsx)(a.Text,{className:"text-sm text-red-500 mt-1",children:c})]}),!d&&!c&&l.length>0&&"crud"===g&&(0,t.jsx)(o.default,{tools:l,value:u[e.server_id]?n:void 0,onChange:t=>S(e.server_id,t),readOnly:p}),!d&&!c&&l.length>0&&"flat"===g&&(0,t.jsx)("div",{className:"space-y-2",children:l.map(s=>{let l=n.includes(s.name);return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:()=>{if(p)return;let t=l?n.filter(e=>e!==s.name):[...n,s.name];S(e.server_id,t)},disabled:p,className:"mt-0.5"}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Text,{className:"font-medium text-gray-900",children:s.name}),(0,t.jsxs)(a.Text,{className:"text-sm text-gray-500",children:["- ",s.description||"No description"]})]})})]},s.name)})}),!d&&!c&&0===l.length&&(0,t.jsx)("div",{className:"text-center py-6",children:(0,t.jsx)(a.Text,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}])},266484,e=>{"use strict";var t=e.i(843476),s=e.i(199133),l=e.i(592968),a=e.i(312361),r=e.i(827252),i=e.i(994388),n=e.i(304967),o=e.i(779241),d=e.i(988297),c=e.i(68155),u=e.i(810757),m=e.i(477386),p=e.i(557662),g=e.i(435451);let{Option:h}=s.Select;e.s(["default",0,({value:e=[],onChange:x,disabledCallbacks:y=[],onDisabledCallbacksChange:f})=>{let _=Object.entries(p.callbackInfo).filter(([e,t])=>t.supports_key_team_logging).map(([e,t])=>e),b=Object.keys(p.callbackInfo),j=e=>{x?.(e)},v=(t,s,l)=>{let a=[...e];if("callback_name"===s){let e=p.callback_map[l]||l;a[t]={...a[t],[s]:e,callback_vars:{}}}else a[t]={...a[t],[s]:l};j(a)},w=(t,s,l)=>{let a=[...e];a[t]={...a[t],callback_vars:{...a[t].callback_vars,[s]:l}},j(a)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(m.BanIcon,{className:"w-5 h-5 text-red-500"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,t.jsx)(l.Tooltip,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,t.jsx)(r.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,t.jsx)(s.Select,{mode:"multiple",placeholder:"Select callbacks to disable",value:y,onChange:e=>{let t=(0,p.mapDisplayToInternalNames)(e);f?.(t)},style:{width:"100%"},optionLabelProp:"label",children:b.map(e=>{let s=p.callbackInfo[e]?.logo,a=p.callbackInfo[e]?.description;return(0,t.jsx)(h,{value:e,label:e,children:(0,t.jsx)(l.Tooltip,{title:a,placement:"right",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,t.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let s=t.target,l=s.parentElement;if(l){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),l.replaceChild(t,s)}}}),(0,t.jsx)("span",{children:e})]})})},e)})}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,t.jsx)(a.Divider,{}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(u.CogIcon,{className:"w-5 h-5 text-blue-500"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,t.jsx)(l.Tooltip,{title:"Configure callback logging integrations for this team.",children:(0,t.jsx)(r.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),(0,t.jsx)(i.Button,{variant:"secondary",onClick:()=>{j([...e,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:d.PlusIcon,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,t.jsx)("div",{className:"space-y-4",children:e.map((a,d)=>{let u=a.callback_name?Object.entries(p.callback_map).find(([e,t])=>t===a.callback_name)?.[0]:void 0,m=u?p.callbackInfo[u]?.logo:null;return(0,t.jsxs)(n.Card,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,t.jsx)("img",{src:m,alt:u,className:"w-5 h-5 object-contain"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:[u||"New Integration"," Configuration"]})]}),(0,t.jsx)(i.Button,{variant:"light",onClick:()=>{j(e.filter((e,t)=>t!==d))},icon:c.TrashIcon,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,t.jsx)(s.Select,{value:u,placeholder:"Select integration",onChange:e=>v(d,"callback_name",e),className:"w-full",optionLabelProp:"label",children:_.map(e=>{let s=p.callbackInfo[e]?.logo,a=p.callbackInfo[e]?.description;return(0,t.jsx)(h,{value:e,label:e,children:(0,t.jsx)(l.Tooltip,{title:a,placement:"right",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,t.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let s=t.target,l=s.parentElement;if(l){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),l.replaceChild(t,s)}}}),(0,t.jsx)("span",{children:e})]})})},e)})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,t.jsxs)(s.Select,{value:a.callback_type,onChange:e=>v(d,"callback_type",e),className:"w-full",children:[(0,t.jsx)(h,{value:"success",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{children:"Success Only"})]})}),(0,t.jsx)(h,{value:"failure",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,t.jsx)("span",{children:"Failure Only"})]})}),(0,t.jsx)(h,{value:"success_and_failure",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),((e,s)=>{if(!e.callback_name)return null;let a=Object.entries(p.callback_map).find(([t,s])=>s===e.callback_name)?.[0];if(!a)return null;let i=p.callbackInfo[a]?.dynamic_params||{};return 0===Object.keys(i).length?null:(0,t.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,t.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(i).map(([a,i])=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,t.jsx)("span",{children:a.replace(/_/g," ")}),(0,t.jsx)(l.Tooltip,{title:`Environment variable reference recommended: os.environ/${a.toUpperCase()}`,children:(0,t.jsx)(r.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})}),"password"===i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===i&&(0,t.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===i?(0,t.jsx)(g.default,{step:.01,width:400,placeholder:`os.environ/${a.toUpperCase()}`,value:e.callback_vars[a]||"",onChange:e=>w(s,a,e.target.value)}):(0,t.jsx)(o.TextInput,{type:"password"===i?"password":"text",placeholder:`os.environ/${a.toUpperCase()}`,value:e.callback_vars[a]||"",onChange:e=>w(s,a,e.target.value)})]},a))})]})})(a,d)]})]},d)})}),0===e.length&&(0,t.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,t.jsx)(u.CogIcon,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,t.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,t.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}])},460285,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(404206),a=e.i(723731),r=e.i(653824),i=e.i(881073),n=e.i(197647),o=e.i(764205),d=e.i(158392),c=e.i(419470),u=e.i(689020);let m=(0,s.forwardRef)(({accessToken:e,value:m,onChange:p,modelData:g},h)=>{let[x,y]=(0,s.useState)({routerSettings:{},selectedStrategy:null,enableTagFiltering:!1}),[f,_]=(0,s.useState)([]),[b,j]=(0,s.useState)([]),[v,w]=(0,s.useState)([]),[N,k]=(0,s.useState)([]),[S,C]=(0,s.useState)({}),[T,I]=(0,s.useState)({}),A=(0,s.useRef)(!1),L=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=m?.router_settings?JSON.stringify({routing_strategy:m.router_settings.routing_strategy,fallbacks:m.router_settings.fallbacks,enable_tag_filtering:m.router_settings.enable_tag_filtering}):null;if(A.current&&e===L.current){A.current=!1;return}if(A.current&&e!==L.current&&(A.current=!1),e!==L.current)if(L.current=e,m?.router_settings){let e=m.router_settings,{fallbacks:t,...s}=e;y({routerSettings:s,selectedStrategy:e.routing_strategy||null,enableTagFiltering:e.enable_tag_filtering??!1});let l=e.fallbacks||[];_(l),j(l&&0!==l.length?l.map((e,t)=>{let[s,l]=Object.entries(e)[0];return{id:(t+1).toString(),primaryModel:s||null,fallbackModels:l||[]}}):[{id:"1",primaryModel:null,fallbackModels:[]}])}else y({routerSettings:{},selectedStrategy:null,enableTagFiltering:!1}),_([]),j([{id:"1",primaryModel:null,fallbackModels:[]}])},[m]),(0,s.useEffect)(()=>{e&&(0,o.getRouterSettingsCall)(e).then(e=>{if(e.fields){let t={};e.fields.forEach(e=>{t[e.field_name]={ui_field_name:e.ui_field_name,field_description:e.field_description,options:e.options,link:e.link}}),C(t);let s=e.fields.find(e=>"routing_strategy"===e.field_name);s?.options&&k(s.options),e.routing_strategy_descriptions&&I(e.routing_strategy_descriptions)}})},[e]),(0,s.useEffect)(()=>{e&&(async()=>{try{let t=await (0,u.fetchAvailableModels)(e);w(t)}catch(e){console.error("Error fetching model info for fallbacks:",e)}})()},[e]);let F=()=>{let e=new Set(["allowed_fails","cooldown_time","num_retries","timeout","retry_after"]),t=new Set(["model_group_alias","retry_policy"]),s=Object.fromEntries(Object.entries({...x.routerSettings,enable_tag_filtering:x.enableTagFiltering,routing_strategy:x.selectedStrategy,fallbacks:f.length>0?f:null}).map(([s,l])=>{if("routing_strategy_args"!==s&&"routing_strategy"!==s&&"enable_tag_filtering"!==s&&"fallbacks"!==s){let a=document.querySelector(`input[name="${s}"]`);if(a){if(void 0!==a.value&&""!==a.value){let r=((s,l,a)=>{if(null==l)return a;let r=String(l).trim();if(""===r||"null"===r.toLowerCase())return null;if(e.has(s)){let e=Number(r);return Number.isNaN(e)?a:e}if(t.has(s)){if(""===r)return null;try{return JSON.parse(r)}catch{return a}}return"true"===r.toLowerCase()||"false"!==r.toLowerCase()&&r})(s,a.value,l);return[s,r]}return[s,null]}}else if("routing_strategy"===s)return[s,x.selectedStrategy];else if("enable_tag_filtering"===s)return[s,x.enableTagFiltering];else if("fallbacks"===s)return[s,f.length>0?f:null];else if("routing_strategy_args"===s&&"latency-based-routing"===x.selectedStrategy){let e=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]'),s={};return e?.value&&(s.lowest_latency_buffer=Number(e.value)),t?.value&&(s.ttl=Number(t.value)),["routing_strategy_args",Object.keys(s).length>0?s:null]}return[s,l]}).filter(e=>null!=e)),l=(e,t=!1)=>null==e||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length||t&&("number"!=typeof e||Number.isNaN(e))?null:e;return{routing_strategy:l(s.routing_strategy),allowed_fails:l(s.allowed_fails,!0),cooldown_time:l(s.cooldown_time,!0),num_retries:l(s.num_retries,!0),timeout:l(s.timeout,!0),retry_after:l(s.retry_after,!0),fallbacks:f.length>0?f:null,context_window_fallbacks:l(s.context_window_fallbacks),retry_policy:l(s.retry_policy),model_group_alias:l(s.model_group_alias),enable_tag_filtering:x.enableTagFiltering,routing_strategy_args:l(s.routing_strategy_args)}};(0,s.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>{A.current=!0,p({router_settings:F()})},100);return()=>clearTimeout(e)},[x,f]);let O=Array.from(new Set(v.map(e=>e.model_group))).sort();return((0,s.useImperativeHandle)(h,()=>({getValue:()=>({router_settings:F()})})),e)?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)(r.TabGroup,{className:"w-full",children:[(0,t.jsxs)(i.TabList,{variant:"line",defaultValue:"1",className:"px-8 pt-4",children:[(0,t.jsx)(n.Tab,{value:"1",children:"Loadbalancing"}),(0,t.jsx)(n.Tab,{value:"2",children:"Fallbacks"})]}),(0,t.jsxs)(a.TabPanels,{className:"px-8 py-6",children:[(0,t.jsx)(l.TabPanel,{children:(0,t.jsx)(d.default,{value:x,onChange:y,routerFieldsMetadata:S,availableRoutingStrategies:N,routingStrategyDescriptions:T})}),(0,t.jsx)(l.TabPanel,{children:(0,t.jsx)(c.FallbackSelectionForm,{groups:b,onGroupsChange:e=>{j(e),_(e.filter(e=>e.primaryModel&&e.fallbackModels.length>0).map(e=>({[e.primaryModel]:e.fallbackModels})))},availableModels:O,maxGroups:5})})]})]})}):null});m.displayName="RouterSettingsAccordion",e.s(["default",0,m])},207082,e=>{"use strict";var t=e.i(619273),s=e.i(266027),l=e.i(243652),a=e.i(764205),r=e.i(135214);let i=(0,l.createQueryKeys)("keys"),n=async(e,t,s,l={})=>{try{let r=(0,a.getProxyBaseUrl)(),i=new URLSearchParams(Object.entries({team_id:l.teamID,project_id:l.projectID,organization_id:l.organizationID,key_alias:l.selectedKeyAlias,key_hash:l.keyHash,user_id:l.userID,page:t,size:s,sort_by:l.sortBy,sort_order:l.sortOrder,expand:l.expand,status:l.status,return_full_object:"true",include_team_keys:"true",include_created_by_keys:"true"}).filter(([,e])=>null!=e).map(([e,t])=>[e,String(t)])),n=`${r?`${r}/key/list`:"/key/list"}?${i}`,o=await fetch(n,{method:"GET",headers:{[(0,a.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=(0,a.deriveErrorMessage)(e);throw(0,a.handleError)(t),Error(t)}let d=await o.json();return console.log("/key/list API Response:",d),d}catch(e){throw console.error("Failed to list keys:",e),e}},o=(0,l.createQueryKeys)("deletedKeys");e.s(["keyKeys",0,i,"useDeletedKeys",0,(e,l,a={})=>{let{accessToken:i}=(0,r.default)();return(0,s.useQuery)({queryKey:o.list({page:e,limit:l,...a}),queryFn:async()=>await n(i,e,l,{...a,status:"deleted"}),enabled:!!i,staleTime:3e4,placeholderData:t.keepPreviousData})},"useKeys",0,(e,l,a={})=>{let{accessToken:o}=(0,r.default)();return(0,s.useQuery)({queryKey:i.list({page:e,limit:l,...a}),queryFn:async()=>await n(o,e,l,a),enabled:!!o,staleTime:3e4,placeholderData:t.keepPreviousData})}])},510674,e=>{"use strict";var t=e.i(266027),s=e.i(243652),l=e.i(764205),a=e.i(135214),r=e.i(708347);let i=(0,s.createQueryKeys)("projects"),n=async e=>{let t=(0,l.getProxyBaseUrl)(),s=`${t}/project/list`,a=await fetch(s,{method:"GET",headers:{[(0,l.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=(0,l.deriveErrorMessage)(e);throw(0,l.handleError)(t),Error(t)}return a.json()};e.s(["projectKeys",0,i,"useProjects",0,()=>{let{accessToken:e,userRole:s}=(0,a.default)();return(0,t.useQuery)({queryKey:i.list({}),queryFn:async()=>n(e),enabled:!!e&&r.all_admin_roles.includes(s)})}])},392110,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(199133),a=e.i(592968),r=e.i(312361),i=e.i(790848),n=e.i(536916),o=e.i(827252),d=e.i(779241);let{Option:c}=l.Select;e.s(["default",0,({form:e,autoRotationEnabled:u,onAutoRotationChange:m,rotationInterval:p,onRotationIntervalChange:g,isCreateMode:h=!1,neverExpire:x=!1,onNeverExpireChange:y})=>{let f=p&&!["7d","30d","90d","180d","365d"].includes(p),[_,b]=(0,s.useState)(f),[j,v]=(0,s.useState)(f?p:""),[w,N]=(0,s.useState)(e?.getFieldValue?.("duration")||"");return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Key Expiry Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Expire Key"}),(0,t.jsx)(a.Tooltip,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})}),!h&&y&&(0,t.jsx)(n.Checkbox,{checked:x,onChange:t=>{let s=t.target.checked;y(s),s&&(N(""),e&&"function"==typeof e.setFieldValue?e.setFieldValue("duration",""):e&&"function"==typeof e.setFieldsValue&&e.setFieldsValue({duration:""}))},className:"ml-2 text-sm font-normal text-gray-600",children:"Never Expire"})]}),(0,t.jsx)(d.TextInput,{name:"duration",placeholder:h?"e.g., 30d or leave empty to never expire":"e.g., 30d",className:"w-full",value:w,onValueChange:t=>{N(t),e&&"function"==typeof e.setFieldValue?e.setFieldValue("duration",t):e&&"function"==typeof e.setFieldsValue&&e.setFieldsValue({duration:t})},disabled:!h&&x})]})]}),(0,t.jsx)(r.Divider,{}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Auto-Rotation Settings"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Enable Auto-Rotation"}),(0,t.jsx)(a.Tooltip,{title:"Key will automatically regenerate at the specified interval for enhanced security.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsx)(i.Switch,{checked:u,onChange:m,size:"default",className:u?"":"bg-gray-400"})]}),u&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Rotation Interval"}),(0,t.jsx)(a.Tooltip,{title:"How often the key should be automatically rotated. Choose the interval that best fits your security requirements.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(l.Select,{value:_?"custom":p,onChange:e=>{"custom"===e?b(!0):(b(!1),v(""),g(e))},className:"w-full",placeholder:"Select interval",children:[(0,t.jsx)(c,{value:"7d",children:"7 days"}),(0,t.jsx)(c,{value:"30d",children:"30 days"}),(0,t.jsx)(c,{value:"90d",children:"90 days"}),(0,t.jsx)(c,{value:"180d",children:"180 days"}),(0,t.jsx)(c,{value:"365d",children:"365 days"}),(0,t.jsx)(c,{value:"custom",children:"Custom interval"})]}),_&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.TextInput,{value:j,onChange:e=>{let t=e.target.value;v(t),g(t)},placeholder:"e.g., 1s, 5m, 2h, 14d"}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Supported formats: seconds (s), minutes (m), hours (h), days (d)"})]})]})]})]}),u&&(0,t.jsx)("div",{className:"bg-blue-50 p-3 rounded-md text-sm text-blue-700",children:"When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period."})]})]})}])},939510,e=>{"use strict";var t=e.i(843476),s=e.i(808613),l=e.i(199133),a=e.i(592968),r=e.i(827252);let{Option:i}=l.Select;e.s(["default",0,({type:e,name:n,showDetailedDescriptions:o=!0,className:d="",initialValue:c=null,form:u,onChange:m})=>{let p=e.toUpperCase(),g=e.toLowerCase(),h=`Select 'guaranteed_throughput' to prevent overallocating ${p} limit when the key belongs to a Team with specific ${p} limits.`;return(0,t.jsx)(s.Form.Item,{label:(0,t.jsxs)("span",{children:[p," Rate Limit Type"," ",(0,t.jsx)(a.Tooltip,{title:h,children:(0,t.jsx)(r.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:n,initialValue:c,className:d,children:(0,t.jsx)(l.Select,{defaultValue:o?"default":void 0,placeholder:"Select rate limit type",style:{width:"100%"},optionLabelProp:o?"label":void 0,onChange:e=>{u&&u.setFieldValue(n,e),m&&m(e)},children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{value:"best_effort_throughput",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Best effort throughput - no error if we're overallocating ",g," (Team/Key Limits checked at runtime)."]})]})}),(0,t.jsx)(i,{value:"guaranteed_throughput",label:"Guaranteed throughput",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Guaranteed throughput"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Guaranteed throughput - raise an error if we're overallocating ",g," (also checks model-specific limits)"]})]})}),(0,t.jsx)(i,{value:"dynamic",label:"Dynamic",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Dynamic"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["If the key has a set ",p," (e.g. 2 ",p,") and there are no 429 errors, it can dynamically exceed the limit when the model being called is not erroring."]})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{value:"best_effort_throughput",children:"Best effort throughput"}),(0,t.jsx)(i,{value:"guaranteed_throughput",children:"Guaranteed throughput"}),(0,t.jsx)(i,{value:"dynamic",children:"Dynamic"})]})})})}])},363256,e=>{"use strict";var t=e.i(843476),s=e.i(199133);let{Text:l}=e.i(898586).Typography;e.s(["default",0,({organizations:e,value:a,onChange:r,disabled:i,loading:n,style:o})=>(0,t.jsx)(s.Select,{showSearch:!0,placeholder:"All Organizations",value:a,onChange:r,disabled:i,loading:n,allowClear:!0,style:{minWidth:280,...o},filterOption:(t,s)=>{if(!s)return!1;let l=e?.find(e=>e.organization_id===s.key);if(!l)return!1;let a=t.toLowerCase().trim(),r=(l.organization_alias||"").toLowerCase(),i=(l.organization_id||"").toLowerCase();return r.includes(a)||i.includes(a)},children:e?.map(e=>(0,t.jsxs)(s.Select.Option,{value:e.organization_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,t.jsxs)(l,{type:"secondary",children:["(",e.organization_id,")"]})]},e.organization_id))})])},319312,e=>{"use strict";var t=e.i(843476),s=e.i(464571),l=e.i(28651),a=e.i(199133);let r=[{value:"1h",label:"Hourly",resetHint:"Resets every hour"},{value:"24h",label:"Daily",resetHint:"Resets daily at midnight UTC"},{value:"7d",label:"Weekly",resetHint:"Resets every Sunday at midnight UTC"},{value:"30d",label:"Monthly",resetHint:"Resets on the 1st of every month at midnight UTC"}];function i({value:e,onChange:i}){let n=(t,s,l)=>{i(e.map((e,a)=>a===t?{...e,[s]:l}:e))};return(0,t.jsxs)("div",{children:[e.map((o,d)=>{let c=r.find(e=>e.value===o.budget_duration)?.resetHint;return(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)(a.Select,{value:o.budget_duration,onChange:e=>n(d,"budget_duration",e),style:{width:130},options:r.map(e=>({value:e.value,label:e.label}))}),(0,t.jsx)(l.InputNumber,{step:.01,min:0,precision:2,value:o.max_budget??void 0,onChange:e=>n(d,"max_budget",e??null),placeholder:"Max spend ($)",style:{width:160},prefix:"$"}),(0,t.jsx)(s.Button,{type:"text",danger:!0,size:"small",onClick:()=>{i(e.filter((e,t)=>t!==d))},style:{padding:"0 4px"},children:"✕"})]}),c&&(0,t.jsxs)("div",{style:{fontSize:11,color:"#888",marginTop:3,marginLeft:2},children:["↻ ",c]})]},d)}),(0,t.jsx)(s.Button,{size:"small",onClick:t=>{t.preventDefault(),i([...e,{budget_duration:"24h",max_budget:null}])},children:"+ Add Budget Window"})]})}e.s(["BudgetWindowsEditor",()=>i])},109034,e=>{"use strict";var t=e.i(266027),s=e.i(243652),l=e.i(764205),a=e.i(135214);let r=(0,s.createQueryKeys)("tags");e.s(["useTags",0,()=>{let{accessToken:e,userId:s,userRole:i}=(0,a.default)();return(0,t.useQuery)({queryKey:r.list({}),queryFn:async()=>await (0,l.tagListCall)(e),enabled:!!(e&&s&&i)})}])},533882,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(250980),a=e.i(797672),r=e.i(68155),i=e.i(304967),n=e.i(629569),o=e.i(599724),d=e.i(269200),c=e.i(427612),u=e.i(64848),m=e.i(942232),p=e.i(496020),g=e.i(977572),h=e.i(992619),x=e.i(727749);e.s(["default",0,({accessToken:e,initialModelAliases:y={},onAliasUpdate:f,showExampleConfig:_=!0})=>{let[b,j]=(0,s.useState)([]),[v,w]=(0,s.useState)({aliasName:"",targetModel:""}),[N,k]=(0,s.useState)(null);(0,s.useEffect)(()=>{j(Object.entries(y).map(([e,t],s)=>({id:`${s}-${e}`,aliasName:e,targetModel:t})))},[y]);let S=()=>{if(!N)return;if(!N.aliasName||!N.targetModel)return void x.default.fromBackend("Please provide both alias name and target model");if(b.some(e=>e.id!==N.id&&e.aliasName===N.aliasName))return void x.default.fromBackend("An alias with this name already exists");let e=b.map(e=>e.id===N.id?N:e);j(e),k(null);let t={};e.forEach(e=>{t[e.aliasName]=e.targetModel}),f&&f(t),x.default.success("Alias updated successfully")},C=()=>{k(null)},T=b.reduce((e,t)=>(e[t.aliasName]=t.targetModel,e),{});return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(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:"Alias Name"}),(0,t.jsx)("input",{type:"text",value:v.aliasName,onChange:e=>w({...v,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",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:"Target Model"}),(0,t.jsx)(h.default,{accessToken:e,value:v.targetModel,placeholder:"Select target model",onChange:e=>w({...v,targetModel:e}),showLabel:!1})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:()=>{if(!v.aliasName||!v.targetModel)return void x.default.fromBackend("Please provide both alias name and target model");if(b.some(e=>e.aliasName===v.aliasName))return void x.default.fromBackend("An alias with this name already exists");let e=[...b,{id:`${Date.now()}-${v.aliasName}`,aliasName:v.aliasName,targetModel:v.targetModel}];j(e),w({aliasName:"",targetModel:""});let t={};e.forEach(e=>{t[e.aliasName]=e.targetModel}),f&&f(t),x.default.success("Alias added successfully")},disabled:!v.aliasName||!v.targetModel,className:`flex items-center px-4 py-2 rounded-md text-sm ${!v.aliasName||!v.targetModel?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-green-600 text-white hover:bg-green-700"}`,children:[(0,t.jsx)(l.PlusCircleIcon,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(d.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(c.TableHead,{children:(0,t.jsxs)(p.TableRow,{children:[(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Alias Name"}),(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Target Model"}),(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(m.TableBody,{children:[b.map(s=>(0,t.jsx)(p.TableRow,{className:"h-8",children:N&&N.id===s.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:N.aliasName,onChange:e=>k({...N,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(g.TableCell,{className:"py-0.5",children:(0,t.jsx)(h.default,{accessToken:e,value:N.targetModel,onChange:e=>k({...N,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,t.jsx)(g.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:S,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:C,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)(g.TableCell,{className:"py-0.5 text-sm text-gray-900",children:s.aliasName}),(0,t.jsx)(g.TableCell,{className:"py-0.5 text-sm text-gray-500",children:s.targetModel}),(0,t.jsx)(g.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>{k({...s})},className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(a.PencilIcon,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>{var e;let t,l;return e=s.id,j(t=b.filter(t=>t.id!==e)),l={},void(t.forEach(e=>{l[e.aliasName]=e.targetModel}),f&&f(l),x.default.success("Alias deleted successfully"))},className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(r.TrashIcon,{className:"w-3 h-3"})})]})})]})},s.id)),0===b.length&&(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(g.TableCell,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),_&&(0,t.jsxs)(i.Card,{children:[(0,t.jsx)(n.Title,{className:"mb-4",children:"Configuration Example"}),(0,t.jsx)(o.Text,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,t.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,t.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(T).length?(0,t.jsxs)("span",{className:"text-gray-500",children:[(0,t.jsx)("br",{})," # No aliases configured yet"]}):Object.entries(T).map(([e,s])=>(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),' "',e,'": "',s,'"']},e))]})})]})]})}])},651904,e=>{"use strict";var t=e.i(843476),s=e.i(599724),l=e.i(266484);e.s(["default",0,function({value:e,onChange:a,premiumUser:r=!1,disabledCallbacks:i=[],onDisabledCallbacksChange:n}){return r?(0,t.jsx)(l.default,{value:e,onChange:a,disabledCallbacks:i,onDisabledCallbacksChange:n}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,t.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,t.jsxs)(s.Text,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,t.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}])},575260,e=>{"use strict";var t=e.i(843476),s=e.i(199133),l=e.i(482725),a=e.i(56456);e.s(["default",0,({projects:e,value:r,onChange:i,disabled:n,loading:o,teamId:d})=>{let c=d?e?.filter(e=>e.team_id===d):e;return(0,t.jsx)(s.Select,{showSearch:!0,placeholder:"Search or select a project",value:r,onChange:i,disabled:n,loading:o,allowClear:!0,notFoundContent:o?(0,t.jsx)(l.Spin,{indicator:(0,t.jsx)(a.LoadingOutlined,{spin:!0}),size:"small"}):void 0,filterOption:(e,t)=>{if(!t)return!1;let s=c?.find(e=>e.project_id===t.key);if(!s)return!1;let l=e.toLowerCase().trim(),a=(s.project_alias||"").toLowerCase(),r=(s.project_id||"").toLowerCase();return a.includes(l)||r.includes(l)},optionFilterProp:"children",children:!o&&c?.map(e=>(0,t.jsxs)(s.Select.Option,{value:e.project_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.project_alias||e.project_id})," ",(0,t.jsxs)("span",{className:"text-gray-500",children:["(",e.project_id,")"]})]},e.project_id))})}])},702597,364769,e=>{"use strict";var t=e.i(843476),s=e.i(207082),l=e.i(109799),a=e.i(510674),r=e.i(109034),i=e.i(292639),n=e.i(135214),o=e.i(500330),d=e.i(827252),c=e.i(912598),u=e.i(677667),m=e.i(130643),p=e.i(898667),g=e.i(994388),h=e.i(309426),x=e.i(350967),y=e.i(599724),f=e.i(779241),_=e.i(629569),b=e.i(464571),j=e.i(808613),v=e.i(311451),w=e.i(212931),N=e.i(91739),k=e.i(199133),S=e.i(790848),C=e.i(262218),T=e.i(592968),I=e.i(374009),A=e.i(271645),L=e.i(708347),F=e.i(552130),O=e.i(557662),M=e.i(9314),P=e.i(860585),E=e.i(82946),$=e.i(392110),B=e.i(533882),V=e.i(844565),R=e.i(651904),D=e.i(939510),G=e.i(460285),z=e.i(663435),K=e.i(363256),U=e.i(575260),q=e.i(371455),W=e.i(319312),H=e.i(355619),Q=e.i(75921),J=e.i(390605),Y=e.i(727749),X=e.i(764205),Z=e.i(237016),ee=e.i(888259);let et=({apiKey:e})=>{let[s,l]=(0,A.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-2",children:["Please save this secret key somewhere safe and accessible. For security reasons,"," ",(0,t.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-3 mb-1",children:"Virtual Key:"}),(0,t.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,t.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal",margin:0},children:e})}),(0,t.jsx)(Z.CopyToClipboard,{text:e,onCopy:()=>{l(!0),ee.default.success("Key copied to clipboard"),setTimeout(()=>l(!1),2e3)},children:(0,t.jsx)(b.Button,{type:"primary",style:{marginTop:12},children:s?"Copied!":"Copy Virtual Key"})})]})};e.s(["default",0,et],364769);var es=e.i(435451),el=e.i(916940);let{Option:ea}=k.Select,er=async(e,t,s,l)=>{try{if(null===e||null===t)return[];if(null!==s){let a=(await (0,X.modelAvailableCall)(s,e,t,!0,l,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},ei=async(e,t,s,l)=>{try{if(null===e||null===t)return;if(null!==s){let a=(await (0,X.modelAvailableCall)(s,e,t)).data.map(e=>e.id);console.log("available_model_names:",a),l(a)}}catch(e){console.error("Error fetching user models:",e)}};e.s(["default",0,({team:e,teams:Z,data:ee,addKey:en,autoOpenCreate:eo,prefillData:ed})=>{let{accessToken:ec,userId:eu,userRole:em,premiumUser:ep}=(0,n.default)(),eg=ep||null!=em&&L.rolesWithWriteAccess.includes(em),{data:eh,isLoading:ex}=(0,l.useOrganizations)(),{data:ey,isLoading:ef}=(0,a.useProjects)(),{data:e_}=(0,i.useUISettings)(),{data:eb}=(0,r.useTags)(),ej=!!e_?.values?.enable_projects_ui,ev=!!e_?.values?.disable_custom_api_keys,ew=eb?Object.values(eb).map(e=>({value:e.name,label:e.name})):[],eN=(0,c.useQueryClient)(),[ek]=j.Form.useForm(),[eS,eC]=(0,A.useState)(!1),[eT,eI]=(0,A.useState)(null),[eA,eL]=(0,A.useState)(null),[eF,eO]=(0,A.useState)([]),[eM,eP]=(0,A.useState)([]),[eE,e$]=(0,A.useState)("you"),[eB,eV]=(0,A.useState)(!1),[eR,eD]=(0,A.useState)(null),[eG,ez]=(0,A.useState)([]),[eK,eU]=(0,A.useState)([]),[eq,eW]=(0,A.useState)([]),[eH,eQ]=(0,A.useState)([]),[eJ,eY]=(0,A.useState)(e),[eX,eZ]=(0,A.useState)(null),[e0,e1]=(0,A.useState)(null),[e2,e4]=(0,A.useState)(!1),[e5,e3]=(0,A.useState)(null),[e6,e7]=(0,A.useState)({}),[e9,e8]=(0,A.useState)([]),[te,tt]=(0,A.useState)(!1),[ts,tl]=(0,A.useState)([]),[ta,tr]=(0,A.useState)([]),[ti,tn]=(0,A.useState)("llm_api"),[to,td]=(0,A.useState)({}),[tc,tu]=(0,A.useState)(!1),[tm,tp]=(0,A.useState)("30d"),[tg,th]=(0,A.useState)(null),[tx,ty]=(0,A.useState)([]),[tf,t_]=(0,A.useState)(0),[tb,tj]=(0,A.useState)([]),[tv,tw]=(0,A.useState)(null),tN=()=>{eC(!1),ek.resetFields(),eQ([]),tr([]),tn("llm_api"),td({}),tu(!1),tp("30d"),th(null),t_(e=>e+1),tw(null),eZ(null),e1(null),ty([])},tk=()=>{eC(!1),eI(null),eY(null),ek.resetFields(),eQ([]),tr([]),tn("llm_api"),td({}),tu(!1),tp("30d"),th(null),t_(e=>e+1),tw(null),eZ(null),e1(null),ty([])};(0,A.useEffect)(()=>{eu&&em&&ec&&ei(eu,em,ec,eO)},[ec,eu,em]),(0,A.useEffect)(()=>{ec&&(0,X.getAgentsList)(ec).then(e=>tj(e?.agents||[])).catch(()=>tj([]))},[ec]),(0,A.useEffect)(()=>{let e=async()=>{try{let e=(await (0,X.getPoliciesList)(ec)).policies.map(e=>e.policy_name);eU(e)}catch(e){console.error("Failed to fetch policies:",e)}},t=async()=>{try{let e=await (0,X.getPromptsList)(ec);eW(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}};(async()=>{try{let e=(await (0,X.getGuardrailsList)(ec)).guardrails.map(e=>e.guardrail_name);ez(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e(),t()},[ec]),(0,A.useEffect)(()=>{(async()=>{try{if(ec){let e=sessionStorage.getItem("possibleUserRoles");if(e)e7(JSON.parse(e));else{let e=await (0,X.getPossibleUserRoles)(ec);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),e7(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[ec]),(0,A.useEffect)(()=>{if(eo&&!eB&&Z&&em&&L.rolesWithWriteAccess.includes(em)&&(eC(!0),eV(!0),ed)){if(ed.owned_by&&("another_user"===ed.owned_by&&"Admin"!==em?e$("you"):e$(ed.owned_by)),ed.team_id){let e=Z?.find(e=>e.team_id===ed.team_id)||null;e&&(eY(e),ek.setFieldsValue({team_id:ed.team_id}))}ed.key_alias&&ek.setFieldsValue({key_alias:ed.key_alias}),ed.models&&ed.models.length>0&&eD(ed.models),ed.key_type&&(tn(ed.key_type),ek.setFieldsValue({key_type:ed.key_type}))}},[eo,ed,Z,eB,ek,em]);let tS=eM.includes("no-default-models")&&!eJ,tC=async e=>{try{let t,l=e?.key_alias??"",a=e?.team_id??null;if((ee?.filter(e=>e.team_id===a).map(e=>e.key_alias)??[]).includes(l))throw Error(`Key alias ${l} already exists for team with ID ${a}, please provide another key alias`);if(Y.default.info("Making API Call"),eC(!0),"you"===eE)e.user_id=eu;else if("agent"===eE){if(!tv)return void Y.default.fromBackend("Please select an agent");e.agent_id=tv}let r={};try{r=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===eE&&(r.service_account_id=e.key_alias),eH.length>0&&(r={...r,logging:eH.filter(e=>e.callback_name)}),ta.length>0){let e=(0,O.mapDisplayToInternalNames)(ta);r={...r,litellm_disabled_callbacks:e}}if(tc&&(e.auto_rotate=!0,e.rotation_interval=tm),e.duration&&""!==e.duration.trim()||(e.duration=null),e.metadata=JSON.stringify(r),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&(e.allowed_mcp_servers_and_groups.servers?.length>0||e.allowed_mcp_servers_and_groups.accessGroups?.length>0)){e.object_permission||(e.object_permission={});let{servers:t,accessGroups:s}=e.allowed_mcp_servers_and_groups;t&&t.length>0&&(e.object_permission.mcp_servers=t),s&&s.length>0&&(e.object_permission.mcp_access_groups=s),delete e.allowed_mcp_servers_and_groups}let i=e.mcp_tool_permissions||{};if(Object.keys(i).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=i),delete e.mcp_tool_permissions,e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),e.allowed_agents_and_groups&&(e.allowed_agents_and_groups.agents?.length>0||e.allowed_agents_and_groups.accessGroups?.length>0)){e.object_permission||(e.object_permission={});let{agents:t,accessGroups:s}=e.allowed_agents_and_groups;t&&t.length>0&&(e.object_permission.agents=t),s&&s.length>0&&(e.object_permission.agent_access_groups=s),delete e.allowed_agents_and_groups}Object.keys(to).length>0&&(e.aliases=JSON.stringify(to)),tg?.router_settings&&Object.values(tg.router_settings).some(e=>null!=e&&""!==e)&&(e.router_settings=tg.router_settings);let n=tx.filter(e=>e.budget_duration&&null!==e.max_budget&&void 0!==e.max_budget);n.length>0&&(e.budget_limits=n),t="service_account"===eE?await (0,X.keyCreateServiceAccountCall)(ec,e):await (0,X.keyCreateCall)(ec,eu,e),console.log("key create Response:",t),en(t),eN.invalidateQueries({queryKey:s.keyKeys.lists()}),eI(t.key),eL(t.soft_budget),Y.default.success("Virtual Key Created"),ek.resetFields(),ty([]),localStorage.removeItem("userData"+eu)}catch(t){console.log("error in create key:",t);let e=(e=>{let t;if(!(t=!e||"object"!=typeof e||e instanceof Error?String(e):JSON.stringify(e)).includes("/key/generate")&&!t.includes("KeyManagementRoutes.KEY_GENERATE"))return`Error creating the key: ${e}`;let s=t;try{if(!e||"object"!=typeof e||e instanceof Error){let e=t.match(/\{[\s\S]*\}/);if(e){let t=JSON.parse(e[0]),l=t?.error||t;l?.message&&(s=l.message)}}else{let t=e?.error||e;t?.message&&(s=t.message)}}catch(e){}return t.includes("team_member_permission_error")||s.includes("Team member does not have permissions")?"Team member does not have permission to generate key for this team. Ask your proxy admin to configure the team member permission settings.":`Error creating the key: ${e}`})(t);Y.default.fromBackend(e)}};(0,A.useEffect)(()=>{if(e0){let e=ey?.find(e=>e.project_id===e0);eP(e?.models??[]),ek.setFieldValue("models",[]);return}eu&&em&&ec&&er(eu,em,ec,eJ?.team_id??null).then(e=>{eP(Array.from(new Set([...eJ?.models??[],...e])))}),eR||ek.setFieldValue("models",[]),ek.setFieldValue("allowed_mcp_servers_and_groups",{servers:[],accessGroups:[]})},[eJ,e0,ec,eu,em,ek]),(0,A.useEffect)(()=>{if(!eR||0===eR.length||!eM||0===eM.length)return;let e=eR.filter(e=>eM.includes(e));e.length>0&&ek.setFieldsValue({models:e}),eD(null)},[eR,eM,ek]),(0,A.useEffect)(()=>{if(!e0||!Z)return;let e=ey?.find(e=>e.project_id===e0);if(!e?.team_id||eJ?.team_id===e.team_id)return;let t=Z.find(t=>t.team_id===e.team_id)||null;t&&(eY(t),ek.setFieldValue("team_id",t.team_id))},[Z,e0,ey]);let tT=async e=>{if(!e)return void e8([]);tt(!0);try{let t=new URLSearchParams;if(t.append("user_email",e),null==ec)return;let s=(await (0,X.userFilterUICall)(ec,t)).map(e=>({label:`${e.user_email} (${e.user_id})`,value:e.user_id,user:e}));e8(s)}catch(e){console.error("Error fetching users:",e),Y.default.fromBackend("Failed to search for users")}finally{tt(!1)}},tI=(0,A.useCallback)((0,I.default)(e=>tT(e),300),[ec]);return(0,t.jsxs)("div",{children:[em&&L.rolesWithWriteAccess.includes(em)&&(0,t.jsx)(g.Button,{className:"mx-auto",onClick:()=>eC(!0),"data-testid":"create-key-button",children:"+ Create New Key"}),(0,t.jsx)(w.Modal,{open:eS,width:1e3,footer:null,onOk:tN,onCancel:tk,children:(0,t.jsxs)(j.Form,{form:ek,onFinish:tC,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(_.Title,{className:"mb-4",children:"Key Ownership"}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Owned By"," ",(0,t.jsx)(T.Tooltip,{title:"Select who will own this Virtual Key",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,t.jsxs)(N.Radio.Group,{onChange:e=>e$(e.target.value),value:eE,children:[(0,t.jsx)(N.Radio,{value:"you",children:"You"}),(0,t.jsx)(N.Radio,{value:"service_account",children:"Service Account"}),"Admin"===em&&(0,t.jsx)(N.Radio,{value:"another_user",children:"Another User"}),(0,t.jsxs)(N.Radio,{value:"agent",children:["Agent ",(0,t.jsx)(C.Tag,{color:"purple",children:"New"})]})]})}),"another_user"===eE&&(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["User ID"," ",(0,t.jsx)(T.Tooltip,{title:"The user who will own this key and be responsible for its usage",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===eE,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,t.jsx)(k.Select,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{tI(e)},onSelect:(e,t)=>{let s;return s=t.user,void ek.setFieldsValue({user_id:s.user_id})},options:e9,loading:te,allowClear:!0,style:{width:"100%"},notFoundContent:te?"Searching...":"No users found"}),(0,t.jsx)(b.Button,{onClick:()=>e4(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),"agent"===eE&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-purple-50 border border-purple-200 rounded-md",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Select Agent ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]})}),(0,t.jsx)(k.Select,{showSearch:!0,placeholder:"Select an agent",style:{width:"100%"},value:tv,onChange:e=>tw(e),filterOption:(e,t)=>t?.label?.toLowerCase().includes(e.toLowerCase()),options:tb.map(e=>({label:e.agent_name||e.agent_id,value:e.agent_id}))}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"This key will be used by the selected agent to make requests to LiteLLM"})]}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Organization"," ",(0,t.jsx)(T.Tooltip,{title:"The organization this key belongs to. Selecting an organization filters the available teams.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"organization_id",className:"mt-4",children:(0,t.jsx)(K.default,{organizations:eh,loading:ex,disabled:"Admin"!==em,onChange:e=>{eZ(e||null),eY(null),e1(null),ek.setFieldValue("team_id",void 0),ek.setFieldValue("project_id",void 0)}})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Team"," ",(0,t.jsx)(T.Tooltip,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:e?e.team_id:null,className:"mt-4",rules:[{required:"service_account"===eE,message:"Please select a team for the service account"}],help:"service_account"===eE?"required":"",children:(0,t.jsx)(z.default,{disabled:null!==e0,organizationId:eX,onTeamSelect:e=>{eY(e),e1(null),ek.setFieldValue("project_id",void 0),e?.organization_id?(eZ(e.organization_id),ek.setFieldValue("organization_id",e.organization_id)):e||(eZ(null),ek.setFieldValue("organization_id",void 0))}})}),ej&&(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Project"," ",(0,t.jsx)(T.Tooltip,{title:"Assign this key to a project. Selecting a project will lock the team to the project's team.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"project_id",className:"mt-4",children:(0,t.jsx)(U.default,{projects:ey,teamId:eJ?.team_id,loading:ef||!Z,onChange:e=>{if(!e){e1(null),eY(null),ek.setFieldValue("team_id",void 0);return}e1(e)}})})]}),tS&&(0,t.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,t.jsx)(y.Text,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your Virtual Key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!tS&&(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(_.Title,{className:"mb-4",children:"Key Details"}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["you"===eE||"another_user"===eE?"Key Name":"Service Account ID"," ",(0,t.jsx)(T.Tooltip,{title:"you"===eE||"another_user"===eE?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:`Please input a ${"you"===eE?"key name":"service account ID"}`}],help:"required",children:(0,t.jsx)(f.TextInput,{placeholder:""})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Models"," ",(0,t.jsx)(T.Tooltip,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team. Leave empty to allow access to all models.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",rules:[],help:"management"===ti||"read_only"===ti?"Models field is disabled for this key type":"optional - leave empty to allow access to all models",className:"mt-4",children:(0,t.jsxs)(k.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===ti||"read_only"===ti,onChange:e=>{e.includes("all-team-models")&&ek.setFieldsValue({models:["all-team-models"]})},children:[!e0&&(0,t.jsx)(ea,{value:"all-team-models",children:"All Team Models"},"all-team-models"),eM.map(e=>(0,t.jsx)(ea,{value:e,children:(0,H.getModelDisplayName)(e)},e))]})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Key Type"," ",(0,t.jsx)(T.Tooltip,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"llm_api",className:"mt-4",children:(0,t.jsxs)(k.Select,{defaultValue:"llm_api",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{tn(e),("management"===e||"read_only"===e)&&ek.setFieldsValue({models:[]})},children:[(0,t.jsx)(ea,{value:"default",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call AI APIs + Management routes"})]})}),(0,t.jsx)(ea,{value:"llm_api",label:"AI APIs",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"AI APIs"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only AI API routes (chat/completions, embeddings, etc.)"})]})}),(0,t.jsx)(ea,{value:"management",label:"Management",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})})]}),!tS&&(0,t.jsx)("div",{className:"mb-8",children:(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)(_.Title,{className:"m-0",children:"Optional Settings"})}),(0,t.jsxs)(m.AccordionBody,{children:[(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Max Budget (USD)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:`Budget cannot exceed team max budget: $${e?.max_budget!==null&&e?.max_budget!==void 0?e?.max_budget:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.max_budget&&s>e.max_budget)throw Error(`Budget cannot exceed team max budget: $${(0,o.formatNumberWithCommas)(e.max_budget,4)}`)}}],children:(0,t.jsx)(es.default,{step:.01,precision:2,width:200})}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Reset Budget"," ",(0,t.jsx)(T.Tooltip,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:`Team Reset Budget: ${e?.budget_duration!==null&&e?.budget_duration!==void 0?e?.budget_duration:"None"}`,children:(0,t.jsx)(P.default,{onChange:e=>ek.setFieldValue("budget_duration",e)})}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Budget Windows"," ",(0,t.jsx)(T.Tooltip,{title:"Set multiple independent budget windows (e.g., hourly $10 AND monthly $200). Each window tracks spend separately and resets on its own schedule.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,t.jsx)(W.BudgetWindowsEditor,{value:tx,onChange:ty})}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:`TPM cannot exceed team TPM limit: ${e?.tpm_limit!==null&&e?.tpm_limit!==void 0?e?.tpm_limit:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.tpm_limit&&s>e.tpm_limit)throw Error(`TPM limit cannot exceed team TPM limit: ${e.tpm_limit}`)}}],children:(0,t.jsx)(es.default,{step:1,width:400})}),(0,t.jsx)(D.default,{type:"tpm",name:"tpm_limit_type",className:"mt-4",initialValue:null,form:ek,showDetailedDescriptions:!0}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:`RPM cannot exceed team RPM limit: ${e?.rpm_limit!==null&&e?.rpm_limit!==void 0?e?.rpm_limit:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.rpm_limit&&s>e.rpm_limit)throw Error(`RPM limit cannot exceed team RPM limit: ${e.rpm_limit}`)}}],children:(0,t.jsx)(es.default,{step:1,width:400})}),(0,t.jsx)(D.default,{type:"rpm",name:"rpm_limit_type",className:"mt-4",initialValue:null,form:ek,showDetailedDescriptions:!0}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(T.Tooltip,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:eg?"Select existing guardrails or enter new ones":"Premium feature - Upgrade to set guardrails by key",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},disabled:!eg,placeholder:eg?"Select or enter guardrails":"Premium feature - Upgrade to set guardrails by key",options:eG.map(e=>({value:e,label:e}))})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(T.Tooltip,{title:"When enabled, this key will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"disable_global_guardrails",className:"mt-4",valuePropName:"checked",help:eg?"Bypass global guardrails for this key":"Premium feature - Upgrade to disable global guardrails by key",children:(0,t.jsx)(S.Switch,{disabled:!eg,checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Policies"," ",(0,t.jsx)(T.Tooltip,{title:"Apply policies to this key to control guardrails and other settings",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",className:"mt-4",help:ep?"Select existing policies or enter new ones":"Premium feature - Upgrade to set policies by key",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},disabled:!ep,placeholder:ep?"Select or enter policies":"Premium feature - Upgrade to set policies by key",options:eK.map(e=>({value:e,label:e}))})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Prompts"," ",(0,t.jsx)(T.Tooltip,{title:"Allow this key to use specific prompt templates",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/prompt_management",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"prompts",className:"mt-4",help:ep?"Select existing prompts or enter new ones":"Premium feature - Upgrade to set prompts by key",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},disabled:!ep,placeholder:ep?"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:eq.map(e=>({value:e,label:e}))})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Access Groups"," ",(0,t.jsx)(T.Tooltip,{title:"Assign access groups to this key. Access groups control which models, MCP servers, and agents this key can use",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",className:"mt-4",help:"Select access groups to assign to this key",children:(0,t.jsx)(M.default,{placeholder:"Select access groups (optional)"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Pass Through Routes"," ",(0,t.jsx)(T.Tooltip,{title:"Allow this key to use specific pass through routes",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"allowed_passthrough_routes",className:"mt-4",help:ep?"Select existing pass through routes or enter new ones":"Premium feature - Upgrade to set pass through routes by key",children:(0,t.jsx)(V.default,{onChange:e=>ek.setFieldValue("allowed_passthrough_routes",e),value:ek.getFieldValue("allowed_passthrough_routes"),accessToken:ec,placeholder:ep?"Select or enter pass through routes":"Premium feature - Upgrade to set pass through routes by key",disabled:!ep,teamId:eJ?eJ.team_id:null})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,t.jsx)(T.Tooltip,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,t.jsx)(el.default,{onChange:e=>ek.setFieldValue("allowed_vector_store_ids",e),value:ek.getFieldValue("allowed_vector_store_ids"),accessToken:ec,placeholder:"Select vector stores (optional)"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Metadata"," ",(0,t.jsx)(T.Tooltip,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,t.jsx)(v.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Tags"," ",(0,t.jsx)(T.Tooltip,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",tokenSeparators:[","],options:ew})}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"MCP Settings"})}),(0,t.jsxs)(m.AccordionBody,{children:[(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,t.jsx)(T.Tooltip,{title:"Select which MCP servers or access groups this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",help:"Select MCP servers or access groups this key can access",children:(0,t.jsx)(Q.default,{onChange:e=>ek.setFieldValue("allowed_mcp_servers_and_groups",e),value:ek.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:ec,teamId:eJ?.team_id??null,placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(j.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(v.Input,{type:"hidden"})}),(0,t.jsx)(j.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.allowed_mcp_servers_and_groups!==t.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(J.default,{accessToken:ec,selectedServers:ek.getFieldValue("allowed_mcp_servers_and_groups")?.servers||[],toolPermissions:ek.getFieldValue("mcp_tool_permissions")||{},onChange:e=>ek.setFieldsValue({mcp_tool_permissions:e})})})})]})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Agent Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Agents"," ",(0,t.jsx)(T.Tooltip,{title:"Select which agents or access groups this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_agents_and_groups",help:"Select agents or access groups this key can access",children:(0,t.jsx)(F.default,{onChange:e=>ek.setFieldValue("allowed_agents_and_groups",e),value:ek.getFieldValue("allowed_agents_and_groups"),accessToken:ec,placeholder:"Select agents or access groups (optional)"})})})]}),ep?(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(R.default,{value:eH,onChange:eQ,premiumUser:!0,disabledCallbacks:ta,onDisabledCallbacksChange:tr})})})]}):(0,t.jsx)(T.Tooltip,{title:(0,t.jsxs)("span",{children:["Key-level logging settings is an enterprise feature, get in touch -",(0,t.jsx)("a",{href:"https://www.litellm.ai/enterprise",target:"_blank",children:"https://www.litellm.ai/enterprise"})]}),placement:"top",children:(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("div",{style:{opacity:.5},children:(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(R.default,{value:eH,onChange:eQ,premiumUser:!1,disabledCallbacks:ta,onDisabledCallbacksChange:tr})})})]})}),(0,t.jsx)("div",{style:{position:"absolute",inset:0,cursor:"not-allowed"}})]})}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Router Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4 w-full",children:(0,t.jsx)(G.default,{accessToken:ec||"",value:tg||void 0,onChange:th,modelData:eF.length>0?{data:eF.map(e=>({model_name:e}))}:void 0},tf)})})]},`router-settings-accordion-${tf}`),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Model Aliases"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(y.Text,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used in API calls. This allows you to create shortcuts for specific models."}),(0,t.jsx)(B.default,{accessToken:ec,initialModelAliases:to,onAliasUpdate:td,showExampleConfig:!1})]})})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Key Lifecycle"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)($.default,{form:ek,autoRotationEnabled:tc,onAutoRotationChange:tu,rotationInterval:tm,onRotationIntervalChange:tp,isCreateMode:!0})})}),(0,t.jsx)(j.Form.Item,{name:"duration",hidden:!0,initialValue:null,children:(0,t.jsx)(v.Input,{})})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("b",{children:"Advanced Settings"}),(0,t.jsx)(T.Tooltip,{title:(0,t.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,t.jsx)("a",{href:X.proxyBaseUrl?`${X.proxyBaseUrl}/#/key%20management/generate_key_fn_key_generate_post`:"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,t.jsx)(d.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)(E.default,{schemaComponent:"GenerateKeyRequest",form:ek,excludedFields:["key_alias","team_id","organization_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit",...ev?["key"]:[]]})})]})]})]})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(b.Button,{htmlType:"submit",disabled:tS,style:{opacity:tS?.5:1},children:"Create Key"})})]})}),e2&&(0,t.jsx)(w.Modal,{title:"Create New User",open:e2,onCancel:()=>e4(!1),footer:null,width:800,children:(0,t.jsx)(q.CreateUserButton,{userID:eu,accessToken:ec,teams:Z,possibleUIRoles:e6,onUserCreated:e=>{e3(e),ek.setFieldsValue({user_id:e}),e4(!1)},isEmbedded:!0})}),eT&&(0,t.jsx)(w.Modal,{open:eS,onOk:tN,onCancel:tk,footer:null,children:(0,t.jsxs)(x.Grid,{numItems:1,className:"gap-2 w-full",children:[(0,t.jsx)(_.Title,{children:"Save your Key"}),(0,t.jsx)(h.Col,{numColSpan:1,children:null!=eT?(0,t.jsx)(et,{apiKey:eT}):(0,t.jsx)(y.Text,{children:"Key being created, this might take 30s"})})]})})]})},"fetchTeamModels",0,er,"fetchUserModels",0,ei],702597)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1198c9038aaedc3a.js b/litellm/proxy/_experimental/out/_next/static/chunks/1198c9038aaedc3a.js
new file mode 100644
index 0000000000..552205f303
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/1198c9038aaedc3a.js
@@ -0,0 +1,420 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,611052,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(212931),n=e.i(311451),a=e.i(790848),s=e.i(888259),r=e.i(438957);e.i(247167);var l=e.i(931067);let c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};var d=e.i(9583),p=o.forwardRef(function(e,t){return o.createElement(d.default,(0,l.default)({},e,{ref:t,icon:c}))}),m=e.i(492030),u=e.i(266537),f=e.i(447566),g=e.i(149192),h=e.i(596239);e.s(["ByokCredentialModal",0,({server:e,open:l,onClose:c,onSuccess:d,accessToken:_})=>{let[b,x]=(0,o.useState)(1),[v,y]=(0,o.useState)(""),[j,w]=(0,o.useState)(!0),[S,k]=(0,o.useState)(!1),C=e.alias||e.server_name||"Service",N=C.charAt(0).toUpperCase(),O=()=>{x(1),y(""),w(!0),k(!1),c()},z=async()=>{if(!v.trim())return void s.default.error("Please enter your API key");k(!0);try{let t=await fetch(`/v1/mcp/server/${e.server_id}/user-credential`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${_}`},body:JSON.stringify({credential:v.trim(),save:j})});if(!t.ok){let e=await t.json();throw Error(e?.detail?.error||"Failed to save credential")}s.default.success(`Connected to ${C}`),d(e.server_id),O()}catch(e){s.default.error(e.message||"Failed to connect")}finally{k(!1)}};return(0,t.jsx)(i.Modal,{open:l,onCancel:O,footer:null,width:480,closeIcon:null,className:"byok-modal",children:(0,t.jsxs)("div",{className:"relative p-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[2===b?(0,t.jsxs)("button",{onClick:()=>x(1),className:"flex items-center gap-1 text-gray-500 hover:text-gray-800 text-sm",children:[(0,t.jsx)(f.ArrowLeftOutlined,{})," Back"]}):(0,t.jsx)("div",{}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("div",{className:`w-2 h-2 rounded-full ${1===b?"bg-blue-500":"bg-gray-300"}`}),(0,t.jsx)("div",{className:`w-2 h-2 rounded-full ${2===b?"bg-blue-500":"bg-gray-300"}`})]}),(0,t.jsx)("button",{onClick:O,className:"text-gray-400 hover:text-gray-600",children:(0,t.jsx)(g.CloseOutlined,{})})]}),1===b?(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-3 mb-6",children:[(0,t.jsx)("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-teal-400 to-cyan-600 flex items-center justify-center text-white font-bold text-xl shadow",children:"L"}),(0,t.jsx)(u.ArrowRightOutlined,{className:"text-gray-400 text-lg"}),(0,t.jsx)("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-800 flex items-center justify-center text-white font-bold text-xl shadow",children:N})]}),(0,t.jsxs)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:["Connect ",C]}),(0,t.jsxs)("p",{className:"text-gray-500 mb-6",children:["LiteLLM needs access to ",C," to complete your request."]}),(0,t.jsx)("div",{className:"bg-gray-50 rounded-xl p-4 text-left mb-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"text-gray-500",children:[(0,t.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M8 4v16M16 4v16",stroke:"currentColor",strokeWidth:"2"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold text-gray-800 mb-1",children:"How it works"}),(0,t.jsxs)("p",{className:"text-gray-500 text-sm",children:["LiteLLM acts as a secure bridge. Your requests are routed through our MCP client directly to"," ",C,"'s API."]})]})]})}),e.byok_description&&e.byok_description.length>0&&(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 text-left mb-6",children:[(0,t.jsxs)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-widest mb-3 flex items-center gap-2",children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"text-green-500",children:[(0,t.jsx)("path",{d:"M12 2L12 22M2 12L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"})]}),"Requested Access"]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.byok_description.map((e,o)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,t.jsx)(m.CheckOutlined,{className:"text-green-500 flex-shrink-0"}),e]},o))})]}),(0,t.jsxs)("button",{onClick:()=>x(2),className:"w-full bg-gray-900 hover:bg-gray-700 text-white font-medium py-3 px-6 rounded-xl flex items-center justify-center gap-2 transition-colors",children:["Continue to Authentication ",(0,t.jsx)(u.ArrowRightOutlined,{})]}),(0,t.jsx)("button",{onClick:O,className:"mt-3 w-full text-gray-400 hover:text-gray-600 text-sm py-2",children:"Cancel"})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-blue-50 flex items-center justify-center mb-4",children:(0,t.jsx)(r.KeyOutlined,{className:"text-blue-400 text-xl"})}),(0,t.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Provide API Key"}),(0,t.jsxs)("p",{className:"text-gray-500 mb-6",children:["Enter your ",C," API key to authorize this connection."]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-800 mb-2",children:[C," API Key"]}),(0,t.jsx)(n.Input.Password,{placeholder:"Enter your API key",value:v,onChange:e=>y(e.target.value),size:"large",className:"rounded-lg"}),e.byok_api_key_help_url&&(0,t.jsxs)("a",{href:e.byok_api_key_help_url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 text-sm mt-2 flex items-center gap-1",children:["Where do I find my API key? ",(0,t.jsx)(h.LinkOutlined,{})]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"text-gray-500",children:(0,t.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z",fill:"currentColor"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Save key for future use"})]}),(0,t.jsx)(a.Switch,{checked:j,onChange:w})]}),(0,t.jsxs)("div",{className:"bg-blue-50 rounded-xl p-4 flex items-start gap-3 mb-6",children:[(0,t.jsx)(p,{className:"text-blue-400 mt-0.5 flex-shrink-0"}),(0,t.jsx)("p",{className:"text-sm text-blue-700",children:"Your key is stored securely and transmitted over HTTPS. It is never shared with third parties."})]}),(0,t.jsxs)("button",{onClick:z,disabled:S,className:"w-full bg-blue-500 hover:bg-blue-600 disabled:opacity-60 text-white font-medium py-3 px-6 rounded-xl flex items-center justify-center gap-2 transition-colors",children:[(0,t.jsx)(p,{})," Connect & Authorize"]})]})]})})}],611052)},132104,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["ArrowUpOutlined",0,a],132104)},447593,989022,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),i={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"},n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["ClearOutlined",0,a],447593);var s=e.i(843476),r=e.i(592968),l=e.i(637235);let c={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"};var d=o.forwardRef(function(e,i){return o.createElement(n.default,(0,t.default)({},e,{ref:i,icon:c}))});let p={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"};var m=o.forwardRef(function(e,i){return o.createElement(n.default,(0,t.default)({},e,{ref:i,icon:p}))}),u=e.i(872934),f=e.i(812618),g=e.i(366308),h=e.i(458505);e.s(["default",0,({timeToFirstToken:e,totalLatency:t,usage:o,toolName:i})=>e||t||o?(0,s.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==e&&(0,s.jsx)(r.Tooltip,{title:"Time to first token",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["TTFT: ",(e/1e3).toFixed(2),"s"]})]})}),void 0!==t&&(0,s.jsx)(r.Tooltip,{title:"Total latency",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(l.ClockCircleOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Total Latency: ",(t/1e3).toFixed(2),"s"]})]})}),o?.promptTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Prompt tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(m,{className:"mr-1"}),(0,s.jsxs)("span",{children:["In: ",o.promptTokens]})]})}),o?.completionTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Completion tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(u.ExportOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Out: ",o.completionTokens]})]})}),o?.reasoningTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Reasoning tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(f.BulbOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Reasoning: ",o.reasoningTokens]})]})}),o?.totalTokens!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Total tokens",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(d,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Total: ",o.totalTokens]})]})}),o?.cost!==void 0&&(0,s.jsx)(r.Tooltip,{title:"Cost",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(h.DollarOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["$",o.cost.toFixed(6)]})]})}),i&&(0,s.jsx)(r.Tooltip,{title:"Tool used",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(g.ToolOutlined,{className:"mr-1"}),(0,s.jsxs)("span",{children:["Tool: ",i]})]})})]}):null],989022)},245094,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={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"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["CodeOutlined",0,a],245094)},458505,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={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"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["DollarOutlined",0,a],458505)},829672,836938,310730,e=>{"use strict";e.i(247167);var t=e.i(271645),o=e.i(343794),i=e.i(914949),n=e.i(404948);let a=e=>e?"function"==typeof e?e():e:null;e.s(["getRenderPropValue",0,a],836938);var s=e.i(613541),r=e.i(763731),l=e.i(242064),c=e.i(491816);e.i(793154);var d=e.i(880476),p=e.i(183293),m=e.i(717356),u=e.i(320560),f=e.i(307358),g=e.i(246422),h=e.i(838378),_=e.i(617933);let b=(0,g.genStyleHooks)("Popover",e=>{let{colorBgElevated:t,colorText:o}=e,i=(0,h.mergeToken)(e,{popoverBg:t,popoverColor:o});return[(e=>{let{componentCls:t,popoverColor:o,titleMinWidth:i,fontWeightStrong:n,innerPadding:a,boxShadowSecondary:s,colorTextHeading:r,borderRadiusLG:l,zIndexPopup:c,titleMarginBottom:d,colorBgElevated:m,popoverBg:f,titleBorderBottom:g,innerContentPadding:h,titlePadding:_}=e;return[{[t]:Object.assign(Object.assign({},(0,p.resetComponent)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:l,boxShadow:s,padding:a},[`${t}-title`]:{minWidth:i,marginBottom:d,color:r,fontWeight:n,borderBottom:g,padding:_},[`${t}-inner-content`]:{color:o,padding:h}})},(0,u.default)(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]})(i),(e=>{let{componentCls:t}=e;return{[t]:_.PresetColors.map(o=>{let i=e[`${o}6`];return{[`&${t}-${o}`]:{"--antd-arrow-background-color":i,[`${t}-inner`]:{backgroundColor:i},[`${t}-arrow`]:{background:"transparent"}}}})}})(i),(0,m.initZoomMotion)(i,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:o,fontHeight:i,padding:n,wireframe:a,zIndexPopupBase:s,borderRadiusLG:r,marginXS:l,lineType:c,colorSplit:d,paddingSM:p}=e,m=o-i;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:s+30},(0,f.getArrowToken)(e)),(0,u.getArrowOffsetToken)({contentRadius:r,limitVerticalRadius:!0})),{innerPadding:12*!a,titleMarginBottom:a?0:l,titlePadding:a?`${m/2}px ${n}px ${m/2-t}px`:0,titleBorderBottom:a?`${t}px ${c} ${d}`:"none",innerContentPadding:a?`${p}px ${n}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var x=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);nt.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]]);return o};let v=({title:e,content:o,prefixCls:i})=>e||o?t.createElement(t.Fragment,null,e&&t.createElement("div",{className:`${i}-title`},e),o&&t.createElement("div",{className:`${i}-inner-content`},o)):null,y=e=>{let{hashId:i,prefixCls:n,className:s,style:r,placement:l="top",title:c,content:p,children:m}=e,u=a(c),f=a(p),g=(0,o.default)(i,n,`${n}-pure`,`${n}-placement-${l}`,s);return t.createElement("div",{className:g,style:r},t.createElement("div",{className:`${n}-arrow`}),t.createElement(d.Popup,Object.assign({},e,{className:i,prefixCls:n}),m||t.createElement(v,{prefixCls:n,title:u,content:f})))},j=e=>{let{prefixCls:i,className:n}=e,a=x(e,["prefixCls","className"]),{getPrefixCls:s}=t.useContext(l.ConfigContext),r=s("popover",i),[c,d,p]=b(r);return c(t.createElement(y,Object.assign({},a,{prefixCls:r,hashId:d,className:(0,o.default)(n,p)})))};e.s(["Overlay",0,v,"default",0,j],310730);var w=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);nt.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]]);return o};let S=t.forwardRef((e,d)=>{var p,m;let{prefixCls:u,title:f,content:g,overlayClassName:h,placement:_="top",trigger:x="hover",children:y,mouseEnterDelay:j=.1,mouseLeaveDelay:S=.1,onOpenChange:k,overlayStyle:C={},styles:N,classNames:O}=e,z=w(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:E,className:I,style:R,classNames:T,styles:M}=(0,l.useComponentConfig)("popover"),A=E("popover",u),[P,$,L]=b(A),H=E(),F=(0,o.default)(h,$,L,I,T.root,null==O?void 0:O.root),B=(0,o.default)(T.body,null==O?void 0:O.body),[D,V]=(0,i.default)(!1,{value:null!=(p=e.open)?p:e.visible,defaultValue:null!=(m=e.defaultOpen)?m:e.defaultVisible}),q=(e,t)=>{V(e,!0),null==k||k(e,t)},U=a(f),W=a(g);return P(t.createElement(c.default,Object.assign({placement:_,trigger:x,mouseEnterDelay:j,mouseLeaveDelay:S},z,{prefixCls:A,classNames:{root:F,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},M.root),R),C),null==N?void 0:N.root),body:Object.assign(Object.assign({},M.body),null==N?void 0:N.body)},ref:d,open:D,onOpenChange:e=>{q(e)},overlay:U||W?t.createElement(v,{prefixCls:A,title:U,content:W}):null,transitionName:(0,s.getTransitionName)(H,"zoom-big",z.transitionName),"data-popover-inject":!0}),(0,r.cloneElement)(y,{onKeyDown:e=>{var o,i;(0,t.isValidElement)(y)&&(null==(i=null==y?void 0:(o=y.props).onKeyDown)||i.call(o,e)),e.keyCode===n.default.ESC&&q(!1,e)}})))});S._InternalPanelDoNotUseOrYouWillBeFired=j,e.s(["default",0,S],829672)},282786,e=>{"use strict";var t=e.i(829672);e.s(["Popover",()=>t.default])},219470,812618,e=>{"use strict";e.s(["coy",0,{'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}],219470),e.i(247167);var t=e.i(931067),o=e.i(271645);let i={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"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["BulbOutlined",0,a],812618)},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["ArrowLeftOutlined",0,a],447566)},492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={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"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["LinkOutlined",0,a],596239)},190272,785913,e=>{"use strict";var t,o,i=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),n=((o={}).IMAGE="image",o.VIDEO="video",o.CHAT="chat",o.RESPONSES="responses",o.IMAGE_EDITS="image_edits",o.ANTHROPIC_MESSAGES="anthropic_messages",o.EMBEDDINGS="embeddings",o.SPEECH="speech",o.TRANSCRIPTION="transcription",o.A2A_AGENTS="a2a_agents",o.MCP="mcp",o.REALTIME="realtime",o);let a={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>n,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(i).includes(e)){let t=a[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:o,accessToken:i,apiKey:a,inputMessage:s,chatHistory:r,selectedTags:l,selectedVectorStores:c,selectedGuardrails:d,selectedPolicies:p,selectedMCPServers:m,mcpServers:u,mcpServerToolRestrictions:f,selectedVoice:g,endpointType:h,selectedModel:_,selectedSdk:b,proxySettings:x}=e,v="session"===o?i:a,y=window.location.origin,j=x?.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?y=j:x?.PROXY_BASE_URL&&(y=x.PROXY_BASE_URL);let w=s||"Your prompt here",S=w.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),k=r.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),C={};l.length>0&&(C.tags=l),c.length>0&&(C.vector_stores=c),d.length>0&&(C.guardrails=d),p.length>0&&(C.policies=p);let N=_||"your-model-name",O="azure"===b?`import openai
+
+client = openai.AzureOpenAI(
+ api_key="${v||"YOUR_LITELLM_API_KEY"}",
+ azure_endpoint="${y}",
+ api_version="2024-02-01"
+)`:`import openai
+
+client = openai.OpenAI(
+ api_key="${v||"YOUR_LITELLM_API_KEY"}",
+ base_url="${y}"
+)`;switch(h){case n.CHAT:{let e=Object.keys(C).length>0,o="";if(e){let e=JSON.stringify({metadata:C},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();o=`,
+ extra_body=${e}`}let i=k.length>0?k:[{role:"user",content:w}];t=`
+import base64
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Example with text only
+response = client.chat.completions.create(
+ model="${N}",
+ messages=${JSON.stringify(i,null,4)}${o}
+)
+
+print(response)
+
+# Example with image or PDF (uncomment and provide file path to use)
+# base64_file = encode_image("path/to/your/file.jpg") # or .pdf
+# response_with_file = client.chat.completions.create(
+# model="${N}",
+# messages=[
+# {
+# "role": "user",
+# "content": [
+# {
+# "type": "text",
+# "text": "${S}"
+# },
+# {
+# "type": "image_url",
+# "image_url": {
+# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}
+# }
+# }
+# ]
+# }
+# ]${o}
+# )
+# print(response_with_file)
+`;break}case n.RESPONSES:{let e=Object.keys(C).length>0,o="";if(e){let e=JSON.stringify({metadata:C},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();o=`,
+ extra_body=${e}`}let i=k.length>0?k:[{role:"user",content:w}];t=`
+import base64
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Example with text only
+response = client.responses.create(
+ model="${N}",
+ input=${JSON.stringify(i,null,4)}${o}
+)
+
+print(response.output_text)
+
+# Example with image or PDF (uncomment and provide file path to use)
+# base64_file = encode_image("path/to/your/file.jpg") # or .pdf
+# response_with_file = client.responses.create(
+# model="${N}",
+# input=[
+# {
+# "role": "user",
+# "content": [
+# {"type": "input_text", "text": "${S}"},
+# {
+# "type": "input_image",
+# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}
+# },
+# ],
+# }
+# ]${o}
+# )
+# print(response_with_file.output_text)
+`;break}case n.IMAGE:t="azure"===b?`
+# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.
+# This snippet uses 'client.images.generate' and will create a new image based on your prompt.
+# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.
+import os
+import requests
+import json
+import time
+from PIL import Image
+
+result = client.images.generate(
+ model="${N}",
+ prompt="${s}",
+ n=1
+)
+
+json_response = json.loads(result.model_dump_json())
+
+# Set the directory for the stored image
+image_dir = os.path.join(os.curdir, 'images')
+
+# If the directory doesn't exist, create it
+if not os.path.isdir(image_dir):
+ os.mkdir(image_dir)
+
+# Initialize the image path
+image_filename = f"generated_image_{int(time.time())}.png"
+image_path = os.path.join(image_dir, image_filename)
+
+try:
+ # Retrieve the generated image
+ if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):
+ image_url = json_response["data"][0]["url"]
+ generated_image = requests.get(image_url).content
+ with open(image_path, "wb") as image_file:
+ image_file.write(generated_image)
+
+ print(f"Image saved to {image_path}")
+ # Display the image
+ image = Image.open(image_path)
+ image.show()
+ else:
+ print("Could not find image URL in response.")
+ print("Full response:", json_response)
+except Exception as e:
+ print(f"An error occurred: {e}")
+ print("Full response:", json_response)
+`:`
+import base64
+import os
+import time
+import json
+from PIL import Image
+import requests
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Helper function to create a file (simplified for this example)
+def create_file(image_path):
+ # In a real implementation, this would upload the file to OpenAI
+ # For this example, we'll just return a placeholder ID
+ return f"file_{os.path.basename(image_path).replace('.', '_')}"
+
+# The prompt entered by the user
+prompt = "${S}"
+
+# Encode images to base64
+base64_image1 = encode_image("body-lotion.png")
+base64_image2 = encode_image("soap.png")
+
+# Create file IDs
+file_id1 = create_file("body-lotion.png")
+file_id2 = create_file("incense-kit.png")
+
+response = client.responses.create(
+ model="${N}",
+ input=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": prompt},
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image1}",
+ },
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image2}",
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id1,
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id2,
+ }
+ ],
+ }
+ ],
+ tools=[{"type": "image_generation"}],
+)
+
+# Process the response
+image_generation_calls = [
+ output
+ for output in response.output
+ if output.type == "image_generation_call"
+]
+
+image_data = [output.result for output in image_generation_calls]
+
+if image_data:
+ image_base64 = image_data[0]
+ image_filename = f"edited_image_{int(time.time())}.png"
+ with open(image_filename, "wb") as f:
+ f.write(base64.b64decode(image_base64))
+ print(f"Image saved to {image_filename}")
+else:
+ # If no image is generated, there might be a text response with an explanation
+ text_response = [output.text for output in response.output if hasattr(output, 'text')]
+ if text_response:
+ print("No image generated. Model response:")
+ print("\\n".join(text_response))
+ else:
+ print("No image data found in response.")
+ print("Full response for debugging:")
+ print(response)
+`;break;case n.IMAGE_EDITS:t="azure"===b?`
+import base64
+import os
+import time
+import json
+from PIL import Image
+import requests
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# The prompt entered by the user
+prompt = "${S}"
+
+# Encode images to base64
+base64_image1 = encode_image("body-lotion.png")
+base64_image2 = encode_image("soap.png")
+
+# Create file IDs
+file_id1 = create_file("body-lotion.png")
+file_id2 = create_file("incense-kit.png")
+
+response = client.responses.create(
+ model="${N}",
+ input=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": prompt},
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image1}",
+ },
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image2}",
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id1,
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id2,
+ }
+ ],
+ }
+ ],
+ tools=[{"type": "image_generation"}],
+)
+
+# Process the response
+image_generation_calls = [
+ output
+ for output in response.output
+ if output.type == "image_generation_call"
+]
+
+image_data = [output.result for output in image_generation_calls]
+
+if image_data:
+ image_base64 = image_data[0]
+ image_filename = f"edited_image_{int(time.time())}.png"
+ with open(image_filename, "wb") as f:
+ f.write(base64.b64decode(image_base64))
+ print(f"Image saved to {image_filename}")
+else:
+ # If no image is generated, there might be a text response with an explanation
+ text_response = [output.text for output in response.output if hasattr(output, 'text')]
+ if text_response:
+ print("No image generated. Model response:")
+ print("\\n".join(text_response))
+ else:
+ print("No image data found in response.")
+ print("Full response for debugging:")
+ print(response)
+`:`
+import base64
+import os
+import time
+
+# Helper function to encode images to base64
+def encode_image(image_path):
+ with open(image_path, "rb") as image_file:
+ return base64.b64encode(image_file.read()).decode('utf-8')
+
+# Helper function to create a file (simplified for this example)
+def create_file(image_path):
+ # In a real implementation, this would upload the file to OpenAI
+ # For this example, we'll just return a placeholder ID
+ return f"file_{os.path.basename(image_path).replace('.', '_')}"
+
+# The prompt entered by the user
+prompt = "${S}"
+
+# Encode images to base64
+base64_image1 = encode_image("body-lotion.png")
+base64_image2 = encode_image("soap.png")
+
+# Create file IDs
+file_id1 = create_file("body-lotion.png")
+file_id2 = create_file("incense-kit.png")
+
+response = client.responses.create(
+ model="${N}",
+ input=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "input_text", "text": prompt},
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image1}",
+ },
+ {
+ "type": "input_image",
+ "image_url": f"data:image/jpeg;base64,{base64_image2}",
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id1,
+ },
+ {
+ "type": "input_image",
+ "file_id": file_id2,
+ }
+ ],
+ }
+ ],
+ tools=[{"type": "image_generation"}],
+)
+
+# Process the response
+image_generation_calls = [
+ output
+ for output in response.output
+ if output.type == "image_generation_call"
+]
+
+image_data = [output.result for output in image_generation_calls]
+
+if image_data:
+ image_base64 = image_data[0]
+ image_filename = f"edited_image_{int(time.time())}.png"
+ with open(image_filename, "wb") as f:
+ f.write(base64.b64decode(image_base64))
+ print(f"Image saved to {image_filename}")
+else:
+ # If no image is generated, there might be a text response with an explanation
+ text_response = [output.text for output in response.output if hasattr(output, 'text')]
+ if text_response:
+ print("No image generated. Model response:")
+ print("\\n".join(text_response))
+ else:
+ print("No image data found in response.")
+ print("Full response for debugging:")
+ print(response)
+`;break;case n.EMBEDDINGS:t=`
+response = client.embeddings.create(
+ input="${s||"Your string here"}",
+ model="${N}",
+ encoding_format="base64" # or "float"
+)
+
+print(response.data[0].embedding)
+`;break;case n.TRANSCRIPTION:t=`
+# Open the audio file
+audio_file = open("path/to/your/audio/file.mp3", "rb")
+
+# Make the transcription request
+response = client.audio.transcriptions.create(
+ model="${N}",
+ file=audio_file${s?`,
+ prompt="${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:""}
+)
+
+print(response.text)
+`;break;case n.SPEECH:t=`
+# Make the text-to-speech request
+response = client.audio.speech.create(
+ model="${N}",
+ input="${s||"Your text to convert to speech here"}",
+ voice="${g}" # Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer
+)
+
+# Save the audio to a file
+output_filename = "output_speech.mp3"
+response.stream_to_file(output_filename)
+print(f"Audio saved to {output_filename}")
+
+# Optional: Customize response format and speed
+# response = client.audio.speech.create(
+# model="${N}",
+# input="${s||"Your text to convert to speech here"}",
+# voice="alloy",
+# response_format="mp3", # Options: mp3, opus, aac, flac, wav, pcm
+# speed=1.0 # Range: 0.25 to 4.0
+# )
+# response.stream_to_file("output_speech.mp3")
+`;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${O}
+${t}`}],190272)},434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var i=e.i(247167);e.r(516015);var n=e.r(271645),a=n&&"object"==typeof n&&"default"in n?n:{default:n},s=void 0!==i.default&&i.default.env&&!0,r=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,o=t.name,i=void 0===o?"stylesheet":o,n=t.optimizeForSpeed,a=void 0===n?s:n;c(r(i),"`name` must be a string"),this._name=i,this._deletedRulePlaceholder="#"+i+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;ttypeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(i){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var i=this._tags[e];c(i,"old rule at index `"+e+"` not found"),i.textContent=t}return e},o.deleteRule=function(e){if("u"typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u">>0},p={};function m(e,t){if(!t)return"jsx-"+e;var o=String(t),i=e+o;return p[i]||(p[i]="jsx-"+d(e+"-"+o)),p[i]}function u(e,t){"u"typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),i=o.styleId,n=o.rules;if(i in this._instancesCounts){this._instancesCounts[i]+=1;return}var a=n.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[i]=a,this._instancesCounts[i]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var i=this._fromServer&&this._fromServer[o];i?(i.parentNode.removeChild(i),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],i=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:i}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,i=e.id;if(o){var n=m(i,o);return{styleId:n,rules:Array.isArray(t)?t.map(function(e){return u(n,e)}):[u(n,t)]}}return{styleId:m(i),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),g=n.createContext(null);function h(){return new f}function _(){return n.useContext(g)}g.displayName="StyleSheetContext";var b=a.default.useInsertionEffect||a.default.useLayoutEffect,x="u">typeof window?h():void 0;function v(e){var t=x||_();return t&&("u"{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function i(e,i,n,a,s,r,l,c,d,p,m,u,f,g,h,_,b,x,v,y,j,w,S,k,C){console.log=function(){},console.log("isLocal:",!1);let N=y||(0,o.getProxyBaseUrl)(),O={};s&&s.length>0&&(O["x-litellm-tags"]=s.join(","));let z=new t.default.OpenAI({apiKey:a,baseURL:N,dangerouslyAllowBrowser:!0,defaultHeaders:O});try{let t,o=Date.now(),a=!1,s={},y=!1,N=[];for await(let v of(g&&g.length>0&&(g.includes("__all__")?N.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),i=o?.toolset_name||t;N.push({type:"mcp",server_label:i,server_url:`litellm_proxy/mcp/${encodeURIComponent(i)}`,require_approval:"never"})}else{let t=j?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,i=w?.[e]||[];N.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...i.length>0?{allowed_tools:i}:{}})}})),await z.chat.completions.create({model:n,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:p,messages:e,...m?{vector_store_ids:m}:{},...u?{guardrails:u}:{},...f?{policies:f}:{},...N.length>0?{tools:N,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==x?{max_tokens:x}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:r}))){console.log("Stream chunk:",v);let e=v.choices[0]?.delta;if(console.log("Delta content:",v.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!a&&(v.choices[0]?.delta?.content||e&&e.reasoning_content)&&(a=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),v.choices[0]?.delta?.content){let e=v.choices[0].delta.content;i(e,v.model)}if(e&&e.image&&h&&(console.log("Image generated:",e.image),h(e.image.url,v.model)),e&&e.reasoning_content){let t=e.reasoning_content;l&&l(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!s.mcp_list_tools&&(s.mcp_list_tools=t.mcp_list_tools,S&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};S(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(s.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(s.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(v.usage&&d){console.log("Usage data found:",v.usage);let e={completionTokens:v.usage.completion_tokens,promptTokens:v.usage.prompt_tokens,totalTokens:v.usage.total_tokens};v.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=v.usage.completion_tokens_details.reasoning_tokens),void 0!==v.usage.cost&&null!==v.usage.cost&&(e.cost=parseFloat(v.usage.cost)),d(e)}}S&&(s.mcp_tool_calls||s.mcp_call_results)&&s.mcp_tool_calls&&s.mcp_tool_calls.length>0&&s.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",i=e.function?.arguments||e.arguments||"{}",n=s.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||s.mcp_call_results?.[t],a={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof i?i:JSON.stringify(i),output:n?.result?"string"==typeof n.result?n.result:JSON.stringify(n.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};S(a),console.log("MCP call event sent:",a)});let O=Date.now();v&&v(O-o)}catch(e){throw r?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>i],254530);var n=e.i(727749);async function a(e,i,s,r,l=[],c,d,p,m,u,f,g,h,_,b,x,v,y,j,w,S,k,C){if(!r)throw Error("Virtual Key is required");if(!s||""===s.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let N=w||(0,o.getProxyBaseUrl)(),O={};l&&l.length>0&&(O["x-litellm-tags"]=l.join(","));let z=new t.default.OpenAI({apiKey:r,baseURL:N,dangerouslyAllowBrowser:!0,defaultHeaders:O});try{let t=Date.now(),o=!1,n=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),a=[];_&&_.length>0&&(_.includes("__all__")?a.push({type:"mcp",server_label:"litellm",server_url:`${N}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=C?.find(e=>e.toolset_id===t),i=o?.toolset_name||t;a.push({type:"mcp",server_label:i,server_url:`${N}/mcp/${encodeURIComponent(i)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.server_name||e,i=k?.[e]||[];a.push({type:"mcp",server_label:o,server_url:`${N}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...i.length>0?{allowed_tools:i}:{}})}})),y&&a.push({type:"code_interpreter",container:{type:"auto"}});let r=await z.responses.create({model:s,input:n,stream:!0,litellm_trace_id:u,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...g?{guardrails:g}:{},...h?{policies:h}:{},...a.length>0?{tools:a,tool_choice:"auto"}:{}},{signal:c}),l="",w={code:"",containerId:""};for await(let e of r)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),v)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};v(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(l=e.item.name,console.log("MCP tool used:",l)),E=w;var E,I=w="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):E;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&j){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||I.code)&&j({code:I.code,containerId:I.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let n=e.delta;if(console.log("Text delta",n),n.length>0&&(i("assistant",n,s),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),p&&p(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&d&&d(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&x&&(console.log("Response ID for session management:",t.id),x(t.id)),o&&m){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),m(e,l)}}}return r}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):n.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>a],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),i=e.i(898586),n=e.i(362024);let{Text:a}=i.Typography,{Panel:s}=n.Collapse;e.s(["default",0,({events:e,className:i})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let a=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),r=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",a),console.log("MCPEventsDisplay: mcpCallEvents:",r),a||0!==r.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${i||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(n.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:a?["list-tools"]:r.map((e,t)=>`mcp-call-${t}`),children:[a&&(0,t.jsx)(s,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:a.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),r.map((e,o)=>(0,t.jsx)(s,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),i=e.i(464571),n=e.i(918789),a=e.i(650056),s=e.i(219470),r=e.i(755151),l=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[d,p]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(i.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>p(!d),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[d?"Hide reasoning":"Show reasoning",d?(0,t.jsx)(r.DownOutlined,{className:"ml-1"}):(0,t.jsx)(l.RightOutlined,{className:"ml-1"})]}),d&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(n.default,{components:{code({node:e,inline:o,className:i,children:n,...r}){let l=/language-(\w+)/.exec(i||"");return!o&&l?(0,t.jsx)(a.Prism,{style:s.coy,language:l[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(n).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${i} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...r,children:n})}},children:e})})]}):null}])},84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),i={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"},n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["SendOutlined",0,a],84899)},518617,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["CloseCircleOutlined",0,a],518617)},149192,e=>{"use strict";var t=e.i(864517);e.s(["CloseOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},245704,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={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"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["CheckCircleOutlined",0,a],245704)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var n=e.i(9583),a=o.forwardRef(function(e,a){return o.createElement(n.default,(0,t.default)({},e,{ref:a,icon:i}))});e.s(["SoundOutlined",0,a],782273);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var r=o.forwardRef(function(e,i){return o.createElement(n.default,(0,t.default)({},e,{ref:i,icon:s}))});e.s(["AudioOutlined",0,r],793916)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/171a03c36a999407.js b/litellm/proxy/_experimental/out/_next/static/chunks/171a03c36a999407.js
new file mode 100644
index 0000000000..22795c9bec
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/171a03c36a999407.js
@@ -0,0 +1,84 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,185357,180766,782719,969641,476993,824296,64352,230312,e=>{"use strict";var t,a,l=e.i(843476),r=e.i(808613),i=e.i(311451),s=e.i(212931),n=e.i(199133),o=e.i(262218),d=e.i(898586),c=e.i(464571),m=e.i(271645),u=e.i(727749),p=e.i(764205),g=e.i(770914),x=e.i(515831),h=e.i(175712),f=e.i(646563),y=e.i(519756);let{Text:j}=d.Typography,{Option:_}=n.Select,b=({visible:e,prebuiltPatterns:t,categories:a,selectedPatternName:r,patternAction:i,onPatternNameChange:o,onActionChange:d,onAdd:m,onCancel:u})=>(0,l.jsxs)(s.Modal,{title:"Add prebuilt pattern",open:e,onCancel:u,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Pattern type"}),(0,l.jsx)(n.Select,{placeholder:"Choose pattern type",value:r,onChange:o,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,a)=>{let l=t.find(e=>e.name===a?.value);return!!l&&(l.display_name.toLowerCase().includes(e.toLowerCase())||l.name.toLowerCase().includes(e.toLowerCase()))},children:a.map(e=>{let a=t.filter(t=>t.category===e);return 0===a.length?null:(0,l.jsx)(n.Select.OptGroup,{label:e,children:a.map(e=>(0,l.jsx)(_,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Action"}),(0,l.jsx)(j,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:i,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(_,{value:"BLOCK",children:"Block"}),(0,l.jsx)(_,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:u,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:m,children:"Add"})]})]}),{Text:v}=d.Typography,{Option:w}=n.Select,N=({visible:e,patternName:t,patternRegex:a,patternAction:r,onNameChange:o,onRegexChange:d,onActionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add custom regex pattern",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Pattern name"}),(0,l.jsx)(i.Input,{placeholder:"e.g., internal_id, employee_code",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Regex pattern"}),(0,l.jsx)(i.Input,{placeholder:"e.g., ID-[0-9]{6}",value:a,onChange:e=>d(e.target.value),style:{marginTop:8}}),(0,l.jsx)(v,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Action"}),(0,l.jsx)(v,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:r,onChange:m,style:{width:"100%"},children:[(0,l.jsx)(w,{value:"BLOCK",children:"Block"}),(0,l.jsx)(w,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]}),{Text:C}=d.Typography,{Option:S}=n.Select,k=({visible:e,keyword:t,action:a,description:r,onKeywordChange:o,onActionChange:d,onDescriptionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add blocked keyword",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Keyword"}),(0,l.jsx)(i.Input,{placeholder:"Enter sensitive keyword or phrase",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Action"}),(0,l.jsx)(C,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,l.jsxs)(n.Select,{value:a,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(S,{value:"BLOCK",children:"Block"}),(0,l.jsx)(S,{value:"MASK",children:"Mask"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Description (optional)"}),(0,l.jsx)(i.Input.TextArea,{placeholder:"Explain why this keyword is sensitive",value:r,onChange:e=>m(e.target.value),rows:3,style:{marginTop:8}})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]});var I=e.i(291542),A=e.i(955135);let{Text:O}=d.Typography,{Option:P}=n.Select,T=({patterns:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,l.jsx)(o.Tag,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,t)=>t.display_name||t.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,l.jsxs)(O,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(P,{value:"BLOCK",children:"Block"}),(0,l.jsx)(P,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})},{Text:L}=d.Typography,{Option:B}=n.Select,F=({keywords:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,"action",e),style:{width:120},size:"small",children:[(0,l.jsx)(B,{value:"BLOCK",children:"Block"}),(0,l.jsx)(B,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})};var $=e.i(362024),E=e.i(993914);let{Title:M,Text:R}=d.Typography,{Option:G}=n.Select,z=({availableCategories:e,selectedCategories:t,onCategoryAdd:a,onCategoryRemove:r,onCategoryUpdate:i,accessToken:s,pendingSelection:d,onPendingSelectionChange:u})=>{let[g,x]=m.default.useState(""),y=void 0!==d?d:g,j=u||x,[_,b]=m.default.useState({}),[v,w]=m.default.useState({}),[N,C]=m.default.useState({}),[S,k]=m.default.useState([]),[O,P]=m.default.useState(""),[T,L]=m.default.useState(!1),B=async e=>{if(s&&!_[e]){C(t=>({...t,[e]:!0}));try{let t=await (0,p.getCategoryYaml)(s,e),a=t.yaml_content;if("json"===t.file_type)try{let e=JSON.parse(a);a=JSON.stringify(e,null,2)}catch(t){console.warn(`Failed to format JSON for ${e}:`,t)}b(t=>({...t,[e]:a})),w(a=>({...a,[e]:t.file_type||"yaml"}))}catch(t){console.error(`Failed to fetch content for category ${e}:`,t)}finally{C(t=>({...t,[e]:!1}))}}};m.default.useEffect(()=>{if(y&&s){let e=_[y];if(e)return void P(e);L(!0),console.log(`Fetching content for category: ${y}`,{accessToken:s?"present":"missing"}),(0,p.getCategoryYaml)(s,y).then(e=>{console.log(`Successfully fetched content for ${y}:`,e);let t=e.yaml_content;if("json"===e.file_type)try{let e=JSON.parse(t);t=JSON.stringify(e,null,2)}catch(e){console.warn(`Failed to format JSON for ${y}:`,e)}P(t),b(e=>({...e,[y]:t})),w(t=>({...t,[y]:e.file_type||"yaml"}))}).catch(e=>{console.error(`Failed to fetch preview content for category ${y}:`,e),P("")}).finally(()=>{L(!1)})}else P(""),L(!1)},[y,s]);let F=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(t,a)=>{let r=e.find(e=>e.name===a.category);return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:t}),r?.description&&(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888",marginTop:"4px"},children:r.description})]})}},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"action",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"BLOCK",children:(0,l.jsx)(o.Tag,{color:"red",children:"BLOCK"})}),(0,l.jsx)(G,{value:"MASK",children:(0,l.jsx)(o.Tag,{color:"orange",children:"MASK"})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"severity_threshold",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"low",children:"Low"}),(0,l.jsx)(G,{value:"medium",children:"Medium"}),(0,l.jsx)(G,{value:"high",children:"High"})]})},{title:"",key:"actions",width:80,render:(e,t)=>(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r(t.id),size:"small",children:"Remove"})}],z=e.filter(e=>!t.some(t=>t.category===e.name));return(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:8},children:[(0,l.jsx)(M,{level:5,style:{margin:0},children:"Blocked topics"}),(0,l.jsx)(R,{type:"secondary",style:{fontSize:12,fontWeight:400},children:"Select topics to block using keyword and semantic analysis"})]}),size:"small",children:[(0,l.jsxs)("div",{style:{marginBottom:16,display:"flex",gap:8},children:[(0,l.jsx)(n.Select,{placeholder:"Select a content category",value:y||void 0,onChange:j,style:{flex:1},showSearch:!0,optionLabelProp:"label",filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),children:z.map(e=>(0,l.jsx)(G,{value:e.name,label:e.display_name,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:e.display_name}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:e.description})]})},e.name))}),(0,l.jsx)(c.Button,{type:"primary",onClick:()=>{if(!y)return;let l=e.find(e=>e.name===y);!l||t.some(e=>e.category===y)||(a({id:`category-${Date.now()}`,category:l.name,display_name:l.display_name,action:l.default_action,severity_threshold:"medium"}),j(""),P(""))},disabled:!y,icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add"})]}),y&&(0,l.jsxs)("div",{style:{marginBottom:16,padding:"12px",background:"#f9f9f9",border:"1px solid #e0e0e0",borderRadius:"4px"},children:[(0,l.jsxs)("div",{style:{marginBottom:8,fontWeight:500,fontSize:"14px"},children:["Preview: ",e.find(e=>e.name===y)?.display_name,v[y]&&(0,l.jsxs)("span",{style:{marginLeft:8,fontSize:"12px",color:"#888",fontWeight:400},children:["(",v[y]?.toUpperCase(),")"]})]}),T?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):O?(0,l.jsx)("pre",{style:{background:"#fff",padding:"12px",borderRadius:"4px",overflow:"auto",maxHeight:"300px",maxWidth:"100%",fontSize:"12px",lineHeight:"1.5",margin:0,border:"1px solid #e0e0e0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,l.jsx)("code",{children:O})}):(0,l.jsx)("div",{style:{padding:"8px",textAlign:"center",color:"#888",fontSize:"12px"},children:"Unable to load category content"})]}),t.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Table,{dataSource:t,columns:F,pagination:!1,size:"small",rowKey:"id"}),(0,l.jsx)("div",{style:{marginTop:16},children:(0,l.jsx)($.Collapse,{activeKey:S,onChange:e=>{let t=Array.isArray(e)?e:e?[e]:[],a=new Set(S);t.forEach(e=>{a.has(e)||_[e]||B(e)}),k(t)},ghost:!0,items:t.map(e=>{let t=(v[e.category]||"yaml").toUpperCase();return{key:e.category,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(E.FileTextOutlined,{}),(0,l.jsxs)("span",{children:["View ",t," for ",e.display_name]})]}),children:N[e.category]?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):_[e.category]?(0,l.jsx)("pre",{style:{background:"#f5f5f5",padding:"16px",borderRadius:"4px",overflow:"auto",maxHeight:"400px",fontSize:"12px",lineHeight:"1.5",margin:0},children:(0,l.jsx)("code",{children:_[e.category]})}):(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Content will load when expanded"})}})})})]}):(0,l.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"#888",border:"1px dashed #d9d9d9",borderRadius:"4px"},children:"No blocked topics selected. Add topics to detect and block harmful content."})]})};var D=e.i(790848),K=e.i(28651);let{Title:q,Text:H}=d.Typography,{Option:J}=n.Select,U={competitor_intent_type:"airline",brand_self:[],locations:[],policy:{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:.7,threshold_medium:.45,threshold_low:.3},W=({enabled:e,config:t,onChange:a,accessToken:i})=>{let s=t??U,[o,d]=(0,m.useState)([]),[c,u]=(0,m.useState)(!1);(0,m.useEffect)(()=>{"airline"===s.competitor_intent_type&&i&&0===o.length&&(u(!0),(0,p.getMajorAirlines)(i).then(e=>d(e.airlines??[])).catch(()=>d([])).finally(()=>u(!1)))},[s.competitor_intent_type,i,o.length]);let x=e=>{a(e,e?{...U}:null)},f=(t,l)=>{a(e,{...s,[t]:l})},y=(t,l)=>{a(e,{...s,policy:{...s.policy,[t]:l}})},j=(t,l)=>{a(e,{...s,[t]:l.filter(Boolean)})};return e?(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(q,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:e,onChange:x})]}),size:"small",children:[(0,l.jsx)(H,{type:"secondary",style:{display:"block",marginBottom:16},children:"Block or reframe competitor comparison questions. Airline type uses major airlines (excluding your brand); generic requires manual competitor list."}),(0,l.jsxs)(r.Form,{layout:"vertical",size:"small",children:[(0,l.jsx)(r.Form.Item,{label:"Type",children:(0,l.jsxs)(n.Select,{value:s.competitor_intent_type,onChange:e=>f("competitor_intent_type",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"airline",children:"Airline (auto-load competitors from IATA)"}),(0,l.jsx)(J,{value:"generic",children:"Generic (specify competitors manually)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Your Brand (brand_self)",required:!0,help:"airline"===s.competitor_intent_type?"Select your airline from the list (excluded from competitors) or type to add a custom term":"Names/codes users use for your brand",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:c?"Loading airlines...":"airline"===s.competitor_intent_type?"Search or select airline, or type to add custom":"Type and press Enter to add",value:s.brand_self,onChange:t=>"airline"===s.competitor_intent_type&&o.length>0?(t=>{let l=t.filter(Boolean),r=[],i=new Set;for(let e of l){let t=o.find(t=>t.match.split("|")[0]?.trim().toLowerCase()===e.toLowerCase());if(t)for(let e of t.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean))i.has(e)||(i.add(e),r.push(e));else i.has(e.toLowerCase())||(i.add(e.toLowerCase()),r.push(e))}a(e,{...s,brand_self:r})})(t??[]):j("brand_self",t??[]),tokenSeparators:[","],loading:c,showSearch:!0,filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),optionFilterProp:"label",options:"airline"===s.competitor_intent_type&&o.length>0?o.map(e=>{let t=e.match.split("|")[0]?.trim()??e.id,a=e.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean);return{value:t.toLowerCase(),label:`${t}${a.length>1?` (${a.slice(1).join(", ")})`:""}`}}):void 0})}),"airline"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Locations (optional)",help:"Countries, cities, airports for disambiguation (e.g. qatar, doha)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.locations??[],onChange:e=>j("locations",e??[]),tokenSeparators:[","]})}),"generic"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Competitors",required:!0,help:"Competitor names to detect (required for generic type)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.competitors??[],onChange:e=>j("competitors",e??[]),tokenSeparators:[","]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.competitor_comparison??"refuse",onChange:e=>y("competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Possible competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.possible_competitor_comparison??"reframe",onChange:e=>y("possible_competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative to backend LLM)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Confidence thresholds",help:(0,l.jsxs)(l.Fragment,{children:["Classify competitor intent by confidence (0–1). Higher confidence → stronger intent.",(0,l.jsxs)("ul",{style:{marginBottom:0,marginTop:4,paddingLeft:20},children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"High (≥)"}),': Treat as full competitor comparison → uses "Competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Medium (≥)"}),': Treat as possible comparison → uses "Possible competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Low (≥)"}),": Log only; allow request. Below Low → allow with no action"]})]}),"Raise thresholds to be more permissive; lower them to be stricter."]}),children:(0,l.jsxs)(g.Space,{wrap:!0,children:[(0,l.jsx)(r.Form.Item,{label:"High",style:{marginBottom:0},help:"e.g. 0.7",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_high??.7,onChange:e=>f("threshold_high",e??.7),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Medium",style:{marginBottom:0},help:"e.g. 0.45",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_medium??.45,onChange:e=>f("threshold_medium",e??.45),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Low",style:{marginBottom:0},help:"e.g. 0.3",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_low??.3,onChange:e=>f("threshold_low",e??.3),style:{width:80}})})]})})]})]}):(0,l.jsx)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(q,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:!1,onChange:x})]}),size:"small",children:(0,l.jsx)(H,{type:"secondary",children:"Block or reframe competitor comparison questions. When enabled, airline type auto-loads competitors from IATA; generic type requires manual competitor list."})})},{Title:V,Text:Y}=d.Typography,Q=({prebuiltPatterns:e,categories:t,selectedPatterns:a,blockedWords:r,onPatternAdd:i,onPatternRemove:s,onPatternActionChange:n,onBlockedWordAdd:o,onBlockedWordRemove:d,onBlockedWordUpdate:j,onFileUpload:_,accessToken:v,showStep:w,contentCategories:C=[],selectedContentCategories:S=[],onContentCategoryAdd:I,onContentCategoryRemove:A,onContentCategoryUpdate:O,pendingCategorySelection:P,onPendingCategorySelectionChange:L,competitorIntentEnabled:B=!1,competitorIntentConfig:$=null,onCompetitorIntentChange:E})=>{let[M,R]=(0,m.useState)(!1),[G,D]=(0,m.useState)(!1),[K,q]=(0,m.useState)(!1),[H,J]=(0,m.useState)(""),[U,Q]=(0,m.useState)("BLOCK"),[X,Z]=(0,m.useState)(""),[ee,et]=(0,m.useState)(""),[ea,el]=(0,m.useState)("BLOCK"),[er,ei]=(0,m.useState)(""),[es,en]=(0,m.useState)("BLOCK"),[eo,ed]=(0,m.useState)(""),[ec,em]=(0,m.useState)(!1),eu=async e=>{em(!0);try{let t=await e.text();if(v){let e=await (0,p.validateBlockedWordsFile)(v,t);if(e.valid)_&&_(t),u.default.success(e.message||"File uploaded successfully");else{let t=e.error||e.errors&&e.errors.join(", ")||"Invalid file";u.default.error(`Validation failed: ${t}`)}}}catch(e){u.default.error(`Failed to upload file: ${e}`)}finally{em(!1)}return!1};return(0,l.jsxs)("div",{className:"space-y-6",children:[!w&&(0,l.jsx)("div",{children:(0,l.jsx)(Y,{type:"secondary",children:"Configure patterns, keywords, and content categories to detect and filter sensitive information in requests and responses."})}),(!w||"patterns"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>R(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add prebuilt pattern"}),(0,l.jsx)(c.Button,{onClick:()=>q(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add custom regex"})]})}),(0,l.jsx)(T,{patterns:a,onActionChange:n,onRemove:s})]}),(!w||"keywords"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>D(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add keyword"}),(0,l.jsx)(x.Upload,{beforeUpload:eu,accept:".yaml,.yml",showUploadList:!1,children:(0,l.jsx)(c.Button,{icon:(0,l.jsx)(y.UploadOutlined,{}),loading:ec,children:"Upload YAML file"})})]})}),(0,l.jsx)(F,{keywords:r,onActionChange:j,onRemove:d})]}),(!w||"competitor_intent"===w||"categories"===w)&&E&&(0,l.jsx)(W,{enabled:B,config:$,onChange:E,accessToken:v}),(!w||"categories"===w)&&C.length>0&&I&&A&&O&&(0,l.jsx)(z,{availableCategories:C,selectedCategories:S,onCategoryAdd:I,onCategoryRemove:A,onCategoryUpdate:O,accessToken:v,pendingSelection:P,onPendingSelectionChange:L}),(0,l.jsx)(b,{visible:M,prebuiltPatterns:e,categories:t,selectedPatternName:H,patternAction:U,onPatternNameChange:J,onActionChange:e=>Q(e),onAdd:()=>{if(!H)return void u.default.error("Please select a pattern");let t=e.find(e=>e.name===H);i({id:`pattern-${Date.now()}`,type:"prebuilt",name:H,display_name:t?.display_name,action:U}),R(!1),J(""),Q("BLOCK")},onCancel:()=>{R(!1),J(""),Q("BLOCK")}}),(0,l.jsx)(N,{visible:K,patternName:X,patternRegex:ee,patternAction:ea,onNameChange:Z,onRegexChange:et,onActionChange:e=>el(e),onAdd:()=>{X&&ee?(i({id:`custom-${Date.now()}`,type:"custom",name:X,pattern:ee,action:ea}),q(!1),Z(""),et(""),el("BLOCK")):u.default.error("Please provide pattern name and regex")},onCancel:()=>{q(!1),Z(""),et(""),el("BLOCK")}}),(0,l.jsx)(k,{visible:G,keyword:er,action:es,description:eo,onKeywordChange:ei,onActionChange:e=>en(e),onDescriptionChange:ed,onAdd:()=>{er?(o({id:`word-${Date.now()}`,keyword:er,action:es,description:eo||void 0}),D(!1),ei(""),ed(""),en("BLOCK")):u.default.error("Please enter a keyword")},onCancel:()=>{D(!1),ei(""),ed(""),en("BLOCK")}})]})};var X=((t={}).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t);let Z={},ee=e=>{let t={};return t.PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t.LlmAsAJudge="LiteLLM LLM as a Judge",Object.entries(e).forEach(([e,a])=>{a&&"object"==typeof a&&"ui_friendly_name"in a&&(t[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=a.ui_friendly_name)}),Z=t,t},et=()=>Object.keys(Z).length>0?Z:X,ea={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission",BlockCodeExecution:"block_code_execution",Promptguard:"promptguard",LlmAsAJudge:"llm_as_a_judge",Xecguard:"xecguard",QostodianNexus:"qostodian_nexus"},el=e=>{Object.entries(e).forEach(([e,t])=>{t&&"object"==typeof t&&"ui_friendly_name"in t&&(ea[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=e)})},er=e=>!!e&&"Presidio PII"===et()[e],ei=e=>!!e&&"LiteLLM Content Filter"===et()[e],es=e=>!!e&&"llm_as_a_judge"===ea[e],en="../ui/assets/logos/",eo={"Zscaler AI Guard":`${en}zscaler.svg`,"Presidio PII":`${en}microsoft_azure.svg`,"Bedrock Guardrail":`${en}bedrock.svg`,Lakera:`${en}lakeraai.jpeg`,"Azure Content Safety Prompt Shield":`${en}microsoft_azure.svg`,"Azure Content Safety Text Moderation":`${en}microsoft_azure.svg`,"Aporia AI":`${en}aporia.png`,"PANW Prisma AIRS":`${en}palo_alto_networks.jpeg`,"Noma Security":`${en}noma_security.png`,"Javelin Guardrails":`${en}javelin.png`,"Pillar Guardrail":`${en}pillar.jpeg`,"Google Cloud Model Armor":`${en}google.svg`,"Guardrails AI":`${en}guardrails_ai.jpeg`,"Lasso Guardrail":`${en}lasso.png`,"Pangea Guardrail":`${en}pangea.png`,"AIM Guardrail":`${en}aim_security.jpeg`,"OpenAI Moderation":`${en}openai_small.svg`,EnkryptAI:`${en}enkrypt_ai.avif`,"Prompt Security":`${en}prompt_security.png`,PromptGuard:`${en}promptguard.svg`,XecGuard:`${en}xecguard.svg`,"LiteLLM Content Filter":`${en}litellm_logo.jpg`,"LiteLLM LLM as a Judge":`${en}litellm_logo.jpg`,Akto:`${en}akto.svg`,"Qostodian Nexus":`${en}qohash.jpg`},ed=e=>{if(!e)return{logo:"",displayName:"-"};let t=Object.keys(ea).find(t=>ea[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let a=et()[t];return{logo:eo[a]||"",displayName:a||e}};function ec(e){return!0===e?"yes":!1===e?"no":"inherit"}function em(e){return"yes"===e||"no"!==e&&void 0}e.s(["choiceToSkipSystemForCreate",()=>em,"getGuardrailLogoAndName",0,ed,"getGuardrailProviders",0,et,"guardrailLogoMap",0,eo,"guardrail_provider_map",0,ea,"populateGuardrailProviderMap",0,el,"populateGuardrailProviders",0,ee,"shouldRenderContentFilterConfigSettings",0,ei,"shouldRenderLLMJudgeFields",0,es,"shouldRenderPIIConfigSettings",0,er,"skipSystemMessageToChoice",()=>ec],180766);var eu=e.i(435451);let{Title:ep}=d.Typography,eg=({field:e,fieldKey:t,fullFieldKey:a,value:s})=>{let[o,d]=m.default.useState([]),[u,p]=m.default.useState(e.dict_key_options||[]);return m.default.useEffect(()=>{if(s&&"object"==typeof s){let t=Object.keys(s);d(t.map(e=>({key:e,id:`${e}_${Date.now()}_${Math.random()}`}))),p((e.dict_key_options||[]).filter(e=>!t.includes(e)))}},[s,e.dict_key_options]),(0,l.jsxs)("div",{className:"space-y-3",children:[o.map(t=>(0,l.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,l.jsx)("div",{className:"w-24 font-medium text-sm",children:t.key}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(r.Form.Item,{name:Array.isArray(a)?[...a,t.key]:[a,t.key],style:{marginBottom:0},initialValue:s&&"object"==typeof s?s[t.key]:void 0,normalize:"number"===e.dict_value_type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"number"===e.dict_value_type?(0,l.jsx)(eu.default,{step:1,width:200,placeholder:`Enter ${t.key} value`}):"boolean"===e.dict_value_type?(0,l.jsxs)(n.Select,{placeholder:`Select ${t.key} value`,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):(0,l.jsx)(i.Input,{placeholder:`Enter ${t.key} value`})})}),(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>{var e,a;return e=t.id,a=t.key,void(d(o.filter(t=>t.id!==e)),p([...u,a].sort()))},children:"Remove"})]},t.id)),u.length>0&&(0,l.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,l.jsx)(n.Select,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&void(!e||(d([...o,{key:e,id:`${e}_${Date.now()}`}]),p(u.filter(t=>t!==e)))),value:void 0,children:u.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}),(0,l.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})},ex=({optionalParams:e,parentFieldKey:t,values:a})=>e.fields&&0!==Object.keys(e.fields).length?(0,l.jsxs)("div",{className:"guardrail-optional-params",children:[(0,l.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,l.jsx)(ep,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,l.jsx)("p",{className:"text-gray-600 text-sm",children:e.description||"Configure additional settings for this guardrail provider"})]}),(0,l.jsx)("div",{className:"space-y-8",children:Object.entries(e.fields).map(([e,s])=>{let o,d;return o=`${t}.${e}`,(console.log("value",d=a?.[e]),"dict"===s.type&&s.dict_key_options)?(0,l.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,l.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,l.jsx)(eg,{field:s,fieldKey:e,fullFieldKey:[t,e],value:d})]},o):(0,l.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,l.jsx)(r.Form.Item,{name:[t,e],label:(0,l.jsxs)("div",{className:"mb-2",children:[(0,l.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:`${e} is required`}]:void 0,className:"mb-0",initialValue:void 0!==d?d:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"select"===s.type&&s.options?(0,l.jsx)(n.Select,{placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,l.jsxs)(n.Select,{placeholder:s.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"number"===s.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:s.description}):(0,l.jsx)(i.Input,{placeholder:s.description})})},o)})})]}):null;var eh=e.i(482725),ef=e.i(850627);let ey=({selectedProvider:e,accessToken:t,providerParams:a=null,value:s=null})=>{let[o,d]=(0,m.useState)(!1),[c,u]=(0,m.useState)(a),[g,x]=(0,m.useState)(null);if((0,m.useEffect)(()=>{if(a)return void u(a);let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,p.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),ee(e),el(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};a||e()},[t,a]),!e)return null;if(o)return(0,l.jsx)(eh.Spin,{tip:"Loading provider parameters..."});if(g)return(0,l.jsx)("div",{className:"text-red-500",children:g});let h=ea[e]?.toLowerCase(),f=c&&c[h];if(console.log("Provider key:",h),console.log("Provider fields:",f),!f||0===Object.keys(f).length)return(0,l.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",s);let y=new Set(["patterns","blocked_words","blocked_words_file","categories","severity_threshold","pattern_redaction_format","keyword_redaction_tag"]),j=ei(e),_=(e,t="",a)=>Object.entries(e).map(([e,o])=>{let d=t?`${t}.${e}`:e,c=a?a[e]:s?.[e];if(console.log("Field value:",c),"ui_friendly_name"===e||"optional_params"===e&&"nested"===o.type&&o.fields||j&&y.has(e))return null;if("nested"===o.type&&o.fields)return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 font-medium",children:e}),(0,l.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:_(o.fields,d,c)})]},d);let m=void 0!==c?c:o.default_value??("percentage"===o.type?.5:void 0);return(0,l.jsx)(r.Form.Item,{name:d,label:e,tooltip:o.description,rules:o.required?[{required:!0,message:`${e} is required`}]:void 0,initialValue:m,children:"select"===o.type&&o.options?(0,l.jsx)(n.Select,{placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===o.type&&o.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===o.type||"boolean"===o.type?(0,l.jsxs)(n.Select,{placeholder:o.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"percentage"===o.type&&null!=o.min&&null!=o.max?(0,l.jsx)(ef.Slider,{min:o.min,max:o.max,step:o.step??.1,marks:{[o.min]:"0%",[(o.min+o.max)/2]:"50%",[o.max]:"100%"}}):"number"===o.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:o.description,defaultValue:void 0!==c?Number(c):void 0}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:o.description,defaultValue:c||""}):(0,l.jsx)(i.Input,{placeholder:o.description,defaultValue:c||""})},d)});return(0,l.jsx)(l.Fragment,{children:_(f)})};var ej=e.i(592968),e_=e.i(750113);let eb=({availableModels:e,form:t})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6,padding:"10px 14px",marginBottom:16,fontSize:13,color:"#389e0d"},children:["After each LLM response, the ",(0,l.jsx)("strong",{children:"Judge Model"})," scores it 0–100 against your criteria. If the weighted average falls below the threshold, the response is blocked (or logged)."]}),(0,l.jsx)(r.Form.Item,{name:"judge_model",label:(0,l.jsxs)("span",{children:["Judge Model ",(0,l.jsx)(ej.Tooltip,{title:"The LLM that reads each response and grades it. Pick a capable model — it never sees end-user data beyond what the LLM returned.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),rules:[{required:!0,message:"Select a judge model"}],children:(0,l.jsx)(n.Select,{showSearch:!0,placeholder:"Select a model",options:e.map(e=>({label:e,value:e}))})}),(0,l.jsx)(r.Form.Item,{name:"overall_threshold",label:(0,l.jsxs)("span",{children:["Minimum Score to Pass ",(0,l.jsx)(ej.Tooltip,{title:"0–100. If the weighted average of criterion scores falls below this, the guardrail triggers. 80 is a good default.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:80,children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"/ 100",style:{width:"100%"}})}),(0,l.jsx)(r.Form.Item,{name:"on_failure",label:(0,l.jsxs)("span",{children:["On Failure ",(0,l.jsx)(ej.Tooltip,{title:"Block: return HTTP 422 when the score is too low. Log: record the result but let the response through.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:"block",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block (return 422)"}),(0,l.jsx)(n.Select.Option,{value:"log",children:"Log only"})]})}),(0,l.jsx)(r.Form.Item,{label:(0,l.jsxs)("span",{children:["Evaluation Criteria ",(0,l.jsx)(ej.Tooltip,{title:"Each criterion is something the judge checks. Weights must add up to 100%.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,l.jsx)(r.Form.List,{name:"criteria",initialValue:[{name:"",weight:100,description:""}],children:(e,{add:a,remove:s})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...a})=>(0,l.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,padding:"12px 12px 0",marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-end"},children:[(0,l.jsx)(r.Form.Item,{...a,name:[t,"name"],rules:[{required:!0,message:"Enter criterion name"}],style:{flex:2,marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"Criterion name (e.g. Policy accuracy)"})}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"weight"],label:(0,l.jsx)(ej.Tooltip,{title:"How much this criterion counts toward the final score. All weights must add up to 100%.",children:(0,l.jsxs)("span",{style:{fontSize:12,color:"#595959"},children:["Weight ",(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#bfbfbf"}})]})}),rules:[{required:!0,message:"Enter weight"}],style:{flex:1,marginBottom:8},children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"%",style:{width:"100%"},placeholder:"e.g. 50"})}),(0,l.jsx)("div",{style:{marginBottom:8},children:(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>s(t),children:"×"})})]}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"description"],rules:[{required:!0,message:"Describe what to check"}],style:{marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"What should the judge check for this criterion?"})})]},e)),(0,l.jsx)(c.Button,{type:"dashed",block:!0,style:{marginTop:4},onClick:()=>a({name:"",weight:0,description:""}),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add Criterion"}),e.length>0&&(0,l.jsx)(r.Form.Item,{shouldUpdate:!0,noStyle:!0,children:()=>{let e=(t.getFieldValue("criteria")||[]).reduce((e,t)=>e+(Number(t?.weight)||0),0),a=100===e;return(0,l.jsxs)("div",{style:{marginTop:6,fontSize:12,color:a?"#52c41a":"#faad14"},children:["Weights total: ",e,"%",a?" ✓":" — must add up to 100%"]})}})]})})})]});var ev=e.i(536916),ew=e.i(149192),eN=e.i(741585),eN=eN,eC=e.i(724154);e.i(247167);var eS=e.i(931067);let ek={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"};var eI=e.i(9583),eA=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:ek}))});let{Text:eO}=d.Typography,{Option:eP}=n.Select,eT=({categories:e,selectedCategories:t,onChange:a})=>(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-2",children:[(0,l.jsx)(eA,{className:"text-gray-500 mr-1"}),(0,l.jsx)(eO,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,l.jsx)(n.Select,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:a,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,l.jsx)(o.Tag,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:e.map(e=>(0,l.jsx)(eP,{value:e.category,children:e.category},e.category))})]}),eL=({onSelectAll:e,onUnselectAll:t,hasSelectedEntities:a})=>(0,l.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(eO,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,l.jsx)(ej.Tooltip,{title:"Apply action to all PII types at once",children:(0,l.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:t,disabled:!a,icon:(0,l.jsx)(ew.CloseOutlined,{}),children:"Unselect All"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(c.Button,{color:"primary",variant:"outlined",onClick:()=>e("MASK"),className:"h-10",block:!0,icon:(0,l.jsx)(eN.default,{}),children:"Select All & Mask"}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:()=>e("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,l.jsx)(eC.StopOutlined,{}),children:"Select All & Block"})]})]}),eB=({entities:e,selectedEntities:t,selectedActions:a,actions:r,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:d})=>(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eO,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,l.jsx)(eO,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===e.length?(0,l.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):e.map(e=>(0,l.jsxs)("div",{className:`px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ${t.includes(e)?"bg-blue-50":""}`,children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)(ev.Checkbox,{checked:t.includes(e),onChange:()=>i(e),className:"mr-3"}),(0,l.jsx)(eO,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:e.replace(/_/g," ")}),d.get(e)&&(0,l.jsx)(o.Tag,{className:"ml-2 text-xs",color:"blue",children:d.get(e)})]}),(0,l.jsx)("div",{className:"w-32",children:(0,l.jsx)(n.Select,{value:t.includes(e)&&a[e]||"MASK",onChange:t=>s(e,t),style:{width:120},disabled:!t.includes(e),className:`${!t.includes(e)?"opacity-50":""}`,dropdownMatchSelectWidth:!1,children:r.map(e=>(0,l.jsx)(eP,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center",children:[(e=>{switch(e){case"MASK":return(0,l.jsx)(eN.default,{style:{marginRight:4}});case"BLOCK":return(0,l.jsx)(eC.StopOutlined,{style:{marginRight:4}});default:return null}})(e),e]})},e))})})]},e))})]}),{Title:eF,Text:e$}=d.Typography,eE=({entities:e,actions:t,selectedEntities:a,selectedActions:r,onEntitySelect:i,onActionSelect:s,entityCategories:n=[]})=>{let[o,d]=(0,m.useState)([]),c=new Map;n.forEach(e=>{e.entities.forEach(t=>{c.set(t,e.category)})});let u=e.filter(e=>0===o.length||o.includes(c.get(e)||""));return(0,l.jsxs)("div",{className:"pii-configuration",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,l.jsx)("div",{className:"flex items-center",children:(0,l.jsx)(eF,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,l.jsxs)(e$,{className:"text-gray-500",children:[a.length," items selected"]})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)(eT,{categories:n,selectedCategories:o,onChange:d}),(0,l.jsx)(eL,{onSelectAll:t=>{e.forEach(e=>{a.includes(e)||i(e),s(e,t)})},onUnselectAll:()=>{a.forEach(e=>{i(e)})},hasSelectedEntities:a.length>0})]}),(0,l.jsx)(eB,{entities:u,selectedEntities:a,selectedActions:r,actions:t,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:c})]})};var eM=e.i(304967),eR=e.i(599724),eG=e.i(312361),ez=e.i(21548),eD=e.i(827252);let eK={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eq=({value:e,onChange:t,disabled:a=!1})=>{let r={...eK,...e||{},rules:e?.rules?[...e.rules]:[]},s=e=>{let a={...r,...e};t?.(a)},o=(e,t)=>{s({rules:r.rules.map((a,l)=>l===e?{...a,...t}:a)})},d=(e,t)=>{let a=r.rules[e];if(!a)return;let l=Object.entries(a.allowed_param_patterns||{});t(l);let i={};l.forEach(([e,t])=>{i[e]=t}),o(e,{allowed_param_patterns:Object.keys(i).length>0?i:void 0})};return(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,l.jsx)(eR.Text,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!a&&(0,l.jsx)(c.Button,{icon:(0,l.jsx)(f.PlusOutlined,{}),type:"primary",onClick:()=>{s({rules:[...r.rules,{id:`rule_${Math.random().toString(36).slice(2,8)}`,decision:"allow",allowed_param_patterns:void 0}]})},className:"!bg-blue-600 !text-white hover:!bg-blue-500",children:"Add Rule"})]}),(0,l.jsx)(eG.Divider,{}),0===r.rules.length?(0,l.jsx)(ez.Empty,{description:"No tool rules added yet"}):(0,l.jsx)("div",{className:"space-y-4",children:r.rules.map((e,t)=>{let m;return(0,l.jsxs)(eM.Card,{className:"bg-gray-50",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,l.jsxs)(eR.Text,{className:"font-semibold",children:["Rule ",t+1]}),(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,type:"text",disabled:a,onClick:()=>{s({rules:r.rules.filter((e,a)=>a!==t)})},children:"Remove"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Rule ID"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"unique_rule_id",value:e.id,onChange:e=>o(t,{id:e.target.value})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^mcp__github_.*$",value:e.tool_name??"",onChange:e=>o(t,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^function$",value:e.tool_type??"",onChange:e=>o(t,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,l.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Decision"}),(0,l.jsxs)(n.Select,{disabled:a,value:e.decision,style:{width:200},onChange:e=>o(t,{decision:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsx)("div",{className:"mt-4",children:0===(m=Object.entries(e.allowed_param_patterns||{})).length?(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),m.map(([r,s],n)=>(0,l.jsxs)(g.Space,{align:"start",children:[(0,l.jsx)(i.Input,{disabled:a,placeholder:"messages[0].content",value:r,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[,t]=e[n];e[n]=[a,t]})}}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^email@.*$",value:s,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[t]=e[n];e[n]=[t,a]})}}),(0,l.jsx)(c.Button,{disabled:a,icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,onClick:()=>d(t,e=>{e.splice(n,1)})})]},`${e.id||t}-${n}`)),(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})})]},e.id||t)})}),(0,l.jsx)(eG.Divider,{}),(0,l.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Default action"}),(0,l.jsxs)(n.Select,{disabled:a,value:r.default_action,onChange:e=>s({default_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(eR.Text,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,l.jsx)(ej.Tooltip,{title:"Block returns an error when a forbidden tool is invoked. Rewrite strips the tool call but lets the rest of the response continue.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})})]}),(0,l.jsxs)(n.Select,{disabled:a,value:r.on_disallowed_action,onChange:e=>s({on_disallowed_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block"}),(0,l.jsx)(n.Select.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,l.jsx)(i.Input.TextArea,{disabled:a,rows:3,placeholder:"This violates our org policy...",value:r.violation_message_template,onChange:e=>s({violation_message_template:e.target.value})})]})]})},{Title:eH,Text:eJ,Link:eU}=d.Typography,{Option:eW}=n.Select,eV={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};e.s(["default",0,({visible:e,onClose:t,accessToken:a,onSuccess:d,preset:g})=>{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(0),[I,A]=(0,m.useState)(null),[O,P]=(0,m.useState)([]),[T,L]=(0,m.useState)(2),[B,F]=(0,m.useState)({}),[$,E]=(0,m.useState)([]),[M,R]=(0,m.useState)([]),[G,z]=(0,m.useState)([]),[D,K]=(0,m.useState)(""),[q,H]=(0,m.useState)(!1),[J,U]=(0,m.useState)(null),[W,V]=(0,m.useState)(""),[Y,X]=(0,m.useState)(void 0),[Z,en]=(0,m.useState)("warn"),[ed,ec]=(0,m.useState)(""),[eu,ep]=(0,m.useState)(!1),[eg,eh]=(0,m.useState)([]),[ef,ej]=(0,m.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),e_=(0,m.useMemo)(()=>!!y&&"tool_permission"===(ea[y]||"").toLowerCase(),[y]);(0,m.useEffect)(()=>{a&&(async()=>{try{let[e,t,l]=await Promise.all([(0,p.getGuardrailUISettings)(a),(0,p.getGuardrailProviderSpecificParams)(a),(0,p.modelAvailableCall)(a,"","").catch(()=>null)]);b(e),A(t),l?.data&&eh(l.data.map(e=>e.id)),ee(t),el(t)}catch(e){console.error("Error fetching guardrail data:",e),u.default.fromBackend("Failed to load guardrail configuration")}})()},[a]),(0,m.useEffect)(()=>{if(!g||!e||!_)return;j(g.provider);let t={provider:g.provider,guardrail_name:g.guardrailNameSuggestion,mode:g.mode,default_on:g.defaultOn,skip_system_message_choice:"inherit"};if("BlockCodeExecution"===g.provider&&(t.confidence_threshold=.5),x.setFieldsValue(t),g.categoryName&&_.content_filter_settings?.content_categories){let e=_.content_filter_settings.content_categories.find(e=>e.name===g.categoryName);e&&z([{id:`category-${Date.now()}`,category:e.name,display_name:e.display_name,action:e.default_action,severity_threshold:"medium"}])}},[g,e,_]);let ev=e=>{j(e);let t={config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0};"BlockCodeExecution"===e&&(t.confidence_threshold=.5),x.setFieldsValue(t),w([]),C({}),P([]),L(2),F({}),E([]),R([]),z([]),K(""),H(!1),U(null),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),"LlmAsAJudge"===e&&x.setFieldsValue({mode:"post_call"})},ew=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eN=(e,t)=>{C(a=>({...a,[e]:t}))},eC=async()=>{try{if(0===S&&(await x.validateFields(["guardrail_name","provider","mode","default_on"]),y)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===y&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await x.validateFields(e)}if(1===S&&er(y)&&0===v.length)return void u.default.fromBackend("Please select at least one PII entity to continue");k(S+1)}catch(e){console.error("Form validation failed:",e)}},eS=()=>{x.resetFields(),j(null),w([]),C({}),P([]),L(2),F({}),E([]),R([]),z([]),K(""),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),V(""),X(void 0),en("warn"),ec(""),ep(!1),k(0)},ek=()=>{eS(),t()},eI=async()=>{try{f(!0),await x.validateFields();let e=x.getFieldsValue(!0),l=ea[e.provider],r={guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}},i=em(e.skip_system_message_choice);if(void 0!==i&&(r.litellm_params.skip_system_message_in_guardrail=i),"PresidioPII"===e.provider&&v.length>0){let t={};v.forEach(e=>{t[e]=N[e]||"MASK"}),r.litellm_params.pii_entities_config=t,e.presidio_analyzer_api_base&&(r.litellm_params.presidio_analyzer_api_base=e.presidio_analyzer_api_base),e.presidio_anonymizer_api_base&&(r.litellm_params.presidio_anonymizer_api_base=e.presidio_anonymizer_api_base)}if(ei(e.provider)){let e=q&&J?.brand_self?.length>0;if(0===$.length&&0===M.length&&0===G.length&&!e){u.default.fromBackend("Please configure at least one content filter setting (category, pattern, keyword, or competitor intent)"),f(!1);return}$.length>0&&(r.litellm_params.patterns=$.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action}))),M.length>0&&(r.litellm_params.blocked_words=M.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))),G.length>0&&(r.litellm_params.categories=G.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),q&&J?.brand_self?.length>0&&(r.litellm_params.competitor_intent_config={competitor_intent_type:J.competitor_intent_type??"airline",brand_self:J.brand_self,locations:J.locations?.length>0?J.locations:void 0,competitors:"generic"===J.competitor_intent_type&&J.competitors?.length>0?J.competitors:void 0,policy:J.policy,threshold_high:J.threshold_high,threshold_medium:J.threshold_medium,threshold_low:J.threshold_low})}else if(e.config)try{r.guardrail_info=JSON.parse(e.config)}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}if("llm_as_a_judge"===l){let t=e.criteria||[];if(0===t.length){u.default.fromBackend("Add at least one evaluation criterion"),f(!1);return}let a=t.reduce((e,t)=>e+(Number(t?.weight)||0),0);if(100!==a){u.default.fromBackend(`Criterion weights must sum to 100% (currently ${a}%)`),f(!1);return}r.litellm_params.judge_model=e.judge_model,r.litellm_params.overall_threshold=e.overall_threshold??80,r.litellm_params.on_failure=e.on_failure??"block",r.litellm_params.criteria=t.map(e=>({name:e.name,weight:Number(e.weight),description:e.description||""}))}if("tool_permission"===l){if(0===ef.rules.length){u.default.fromBackend("Add at least one tool permission rule"),f(!1);return}r.litellm_params.rules=ef.rules,r.litellm_params.default_action=ef.default_action,r.litellm_params.on_disallowed_action=ef.on_disallowed_action,ef.violation_message_template&&(r.litellm_params.violation_message_template=ef.violation_message_template)}if(ei(e.provider)&&(void 0!==Y&&Y>0&&(r.litellm_params.end_session_after_n_fails=Y),Z&&"realtime"===W&&(r.litellm_params.on_violation=Z),ed.trim()&&(r.litellm_params.realtime_violation_message=ed.trim())),console.log("values: ",JSON.stringify(e)),I&&y&&"llm_as_a_judge"!==l){let t=ea[y]?.toLowerCase();console.log("providerKey: ",t);let a=I[t]||{},l=new Set;console.log("providerSpecificParams: ",JSON.stringify(a)),Object.keys(a).forEach(e=>{"optional_params"!==e&&l.add(e)}),a.optional_params&&a.optional_params.fields&&Object.keys(a.optional_params.fields).forEach(e=>{l.add(e)}),console.log("allowedParams: ",l),l.forEach(t=>{let a=e[t];(null==a||""===a)&&(a=e.optional_params?.[t]),null!=a&&""!==a&&(r.litellm_params[t]=a)})}if(!a)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(r)),await (0,p.createGuardrailCall)(a,r),u.default.success("Guardrail created successfully"),eS(),d(),t()}catch(e){console.error("Failed to create guardrail:",e),u.default.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}},eA=e=>{if(!_||!ei(y))return null;let t=_.content_filter_settings;return t?(0,l.jsx)(Q,{prebuiltPatterns:t.prebuilt_patterns||[],categories:t.pattern_categories||[],selectedPatterns:$,blockedWords:M,onPatternAdd:e=>E([...$,e]),onPatternRemove:e=>E($.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>{E($.map(a=>a.id===e?{...a,action:t}:a))},onBlockedWordAdd:e=>R([...M,e]),onBlockedWordRemove:e=>R(M.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>{R(M.map(l=>l.id===e?{...l,[t]:a}:l))},contentCategories:t.content_categories||[],selectedContentCategories:G,onContentCategoryAdd:e=>z([...G,e]),onContentCategoryRemove:e=>z(G.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>{z(G.map(l=>l.id===e?{...l,[t]:a}:l))},pendingCategorySelection:D,onPendingCategorySelectionChange:K,accessToken:a,showStep:e,competitorIntentEnabled:q,competitorIntentConfig:J,onCompetitorIntentChange:(e,t)=>{H(e),U(t)}}):null},eO=ei(y)?[{title:"Basic Info",optional:!1},{title:"Topics",optional:!1},{title:"Patterns",optional:!1},{title:"Keywords",optional:!1},{title:"Endpoint Settings (Optional)",optional:!0}]:er(y)?[{title:"Basic Info",optional:!1},{title:"PII Configuration",optional:!1}]:[{title:"Basic Info",optional:!1},{title:"Provider Configuration",optional:!1}];return(0,l.jsx)(s.Modal,{title:null,open:e,onCancel:ek,footer:null,width:1e3,closable:!1,className:"top-8",styles:{body:{padding:0}},children:(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 m-0",children:"Create guardrail"}),(0,l.jsx)("button",{onClick:ek,className:"text-gray-400 hover:text-gray-600 bg-transparent border-none cursor-pointer text-base leading-none p-1",children:"✕"})]}),(0,l.jsx)("div",{className:"overflow-auto px-6 py-4",style:{maxHeight:"calc(80vh - 120px)"},children:(0,l.jsx)(r.Form,{form:x,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1,skip_system_message_choice:"inherit"},children:eO.map((e,t)=>{let s=t{s&&k(t)},style:{minHeight:24},children:[(0,l.jsx)("span",{className:"text-sm",style:{fontWeight:d?600:500,color:d?"#1e293b":s?"#4f46e5":"#94a3b8"},children:e.title}),e.optional&&!d&&(0,l.jsx)("span",{className:"text-[11px] text-slate-400",children:"optional"}),s&&(0,l.jsx)("span",{className:"text-[11px] text-indigo-500 hover:underline",children:"Edit"})]}),d&&(0,l.jsx)("div",{className:"mt-3",children:(()=>{switch(S){case 0:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:ev,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(eW,{value:e,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]}),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{optionLabelProp:"label",mode:"multiple",children:_?.supported_modes?.map(e=>(0,l.jsx)(eW,{value:e,label:e,children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:e}),"pre_call"===e&&(0,l.jsx)(o.Tag,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV[e]})]})},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eW,{value:"pre_call",label:"pre_call",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"pre_call"})," ",(0,l.jsx)(o.Tag,{color:"green",children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.pre_call})]})}),(0,l.jsx)(eW,{value:"during_call",label:"during_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"during_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.during_call})]})}),(0,l.jsx)(eW,{value:"post_call",label:"post_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"post_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.post_call})]})}),(0,l.jsx)(eW,{value:"logging_only",label:"logging_only",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"logging_only"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.logging_only})]})})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: omit role: system from guardrail evaluation input (OpenAI chat + Anthropic messages). The model still receives full messages. Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),!e_&&!ei(y)&&!es(y)&&(0,l.jsx)(ey,{selectedProvider:y,accessToken:a,providerParams:I})]});case 1:if(er(y))return _&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:ew,onActionSelect:eN,entityCategories:_.pii_entity_categories}):null;if(ei(y))return eA("categories");if(es(y))return(0,l.jsx)(eb,{availableModels:eg,form:x});if(!y)return null;if(e_)return(0,l.jsx)(eq,{value:ef,onChange:ej});if(!I)return null;console.log("guardrail_provider_map: ",ea),console.log("selectedProvider: ",y);let e=ea[y]?.toLowerCase(),t=I&&I[e];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null;case 2:if(ei(y))return eA("patterns");return null;case 3:if(ei(y))return eA("keywords");return null;case 4:return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Configure settings for a specific call type. Most guardrails don't need this — skip it unless you're using a specific endpoint like ",(0,l.jsx)("code",{children:"/v1/realtime"}),"."]})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Call type"}),(0,l.jsx)(n.Select,{placeholder:"Select a call type",value:W||void 0,onChange:e=>{V(e),ep(!1)},style:{width:260},allowClear:!0,options:[{value:"realtime",label:"/v1/realtime"}]}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"More call types coming soon."})]}),"realtime"===W&&(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>ep(e=>!e),className:"w-full flex items-center justify-between px-4 py-3 bg-gray-50 hover:bg-gray-100 text-sm font-medium text-gray-700",children:[(0,l.jsx)("span",{children:"/v1/realtime settings"}),(0,l.jsx)("svg",{className:`w-4 h-4 text-gray-500 transition-transform ${eu?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),eu&&(0,l.jsxs)("div",{className:"space-y-5 px-4 py-4 border-t border-gray-200",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"End session after X violations"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Automatically close the session after this many guardrail violations. Leave empty to never auto-close."}),(0,l.jsx)("input",{type:"number",min:1,placeholder:"e.g. 3",value:Y??"",onChange:e=>X(e.target.value?parseInt(e.target.value,10):void 0),className:"border border-gray-300 rounded px-3 py-1.5 text-sm w-32"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"On violation"}),(0,l.jsx)("div",{className:"space-y-2",children:["warn","end_session"].map(e=>(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"on_violation",value:e,checked:Z===e,onChange:()=>en(e),className:"mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"warn"===e?"Warn":"End session"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 m-0",children:"warn"===e?"Bot speaks the message, session continues":"Bot speaks the message, connection closes immediately"})]})]},e))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message the user hears"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"What the bot says aloud when this guardrail fires. Falls back to the default violation message if empty."}),(0,l.jsx)("textarea",{rows:3,placeholder:"e.g. I'm not able to continue this conversation. Please contact us at 1-800-774-2678.",value:ed,onChange:e=>ec(e.target.value),className:"border border-gray-300 rounded px-3 py-2 text-sm w-full resize-none"})]})]})]})]});default:return null}})()})]})]},t)})})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 px-6 py-3 border-t border-gray-200",children:[(0,l.jsx)(c.Button,{onClick:ek,children:"Cancel"}),S>0&&(0,l.jsx)(c.Button,{onClick:()=>{k(S-1)},children:"Previous"}),S{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(g?.provider||null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({});(0,m.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);b(e)}catch(e){console.error("Error fetching guardrail settings:",e),u.default.fromBackend("Failed to load guardrail settings")}})()},[a]),(0,m.useEffect)(()=>{g?.pii_entities_config&&Object.keys(g.pii_entities_config).length>0&&(w(Object.keys(g.pii_entities_config)),C(g.pii_entities_config))},[g]);let S=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},k=(e,t)=>{C(a=>({...a,[e]:t}))},I=async()=>{try{f(!0);let e=await x.validateFields(),l=ea[e.provider],r=c&&"object"==typeof c?{...c}:{};r.guardrail=l,r.mode=e.mode,r.default_on=e.default_on;let i=e.skip_system_message_choice;"yes"===i?r.skip_system_message_in_guardrail=!0:"no"===i?r.skip_system_message_in_guardrail=!1:delete r.skip_system_message_in_guardrail;let s={};if("PresidioPII"===e.provider&&v.length>0){let e={};v.forEach(t=>{e[t]=N[t]||"MASK"}),r.pii_entities_config=e}else if(e.config)try{let t=JSON.parse(e.config);"Bedrock"===e.provider&&t?(t.guardrail_id&&(r.guardrailIdentifier=t.guardrail_id),t.guardrail_version&&(r.guardrailVersion=t.guardrail_version)):s=t}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}let n={guardrail_id:d,guardrail:{guardrail_name:e.guardrail_name,litellm_params:r,guardrail_info:s}};if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(n));let m=`/guardrails/${d}`,g=await fetch(m,{method:"PUT",headers:{[(0,p.getGlobalLitellmHeaderName)()]:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!g.ok){let e=await g.text();throw Error(e||"Failed to update guardrail")}u.default.success("Guardrail updated successfully"),o(),t()}catch(e){console.error("Failed to update guardrail:",e),u.default.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}};return(0,l.jsx)(s.Modal,{title:"Edit Guardrail",open:e,onCancel:t,footer:null,width:700,children:(0,l.jsxs)(r.Form,{form:x,layout:"vertical",initialValues:g,children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(tt.TextInput,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:e=>{j(e),x.setFieldsValue({config:void 0}),w([]),C({})},disabled:!0,optionLabelProp:"label",children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(tr,{value:e,label:t,children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{children:_?.supported_modes?.map(e=>(0,l.jsx)(tr,{value:e,children:e},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tr,{value:"pre_call",children:"pre_call"}),(0,l.jsx)(tr,{value:"post_call",children:"post_call"})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,l.jsx)(D.Switch,{})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: whether role: system content is omitted from guardrail input (LLM still receives full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(tr,{value:"inherit",children:"Use global default"}),(0,l.jsx)(tr,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(tr,{value:"no",children:"No — always include in scan"})]})}),(()=>{if(!y)return null;if("PresidioPII"===y)return _&&y&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:S,onActionSelect:k,entityCategories:_.pii_entity_categories}):null;switch(y){case"Aporia":return(0,l.jsx)(r.Form.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_aporia_api_key",
+ "project_name": "your_project_name"
+}`})});case"AimSecurity":return(0,l.jsx)(r.Form.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_aim_api_key"
+}`})});case"Bedrock":return(0,l.jsx)(r.Form.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "guardrail_id": "your_guardrail_id",
+ "guardrail_version": "your_guardrail_version"
+}`})});case"GuardrailsAI":return(0,l.jsx)(r.Form.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_guardrails_api_key",
+ "guardrail_id": "your_guardrail_id"
+}`})});case"LakeraAI":return(0,l.jsx)(r.Form.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_lakera_api_key"
+}`})});case"PromptInjection":return(0,l.jsx)(r.Form.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "threshold": 0.8
+}`})});default:return(0,l.jsx)(r.Form.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "key1": "value1",
+ "key2": "value2"
+}`})})}})(),(0,l.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:I,loading:h,children:"Update Guardrail"})]})]})})};var ts=((a={}).DB="db",a.CONFIG="config",a);e.s(["default",0,({guardrailsList:e,isLoading:t,onDeleteClick:a,accessToken:r,onGuardrailUpdated:i,isAdmin:s=!1,onGuardrailClick:n})=>{let[o,d]=(0,m.useState)([{id:"created_at",desc:!0}]),[c,u]=(0,m.useState)(!1),[p,g]=(0,m.useState)(null),x=e=>e?new Date(e).toLocaleString():"-",h=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,l.jsx)(ej.Tooltip,{title:String(e.getValue()||""),children:(0,l.jsx)(e4.Button,{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 overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?`${String(e.getValue()).slice(0,7)}...`:""})})},{header:"Name",accessorKey:"guardrail_name",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.guardrail_name,children:(0,l.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:({row:e})=>{let{logo:t,displayName:a}=ed(e.original.litellm_params.guardrail);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:`${a} logo`,className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)("span",{className:"text-xs",children:a})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:({row:e})=>{let t=e.original;return(0,l.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(e7.Badge,{color:t.litellm_params?.default_on?"green":"gray",className:"text-xs font-normal",size:"xs",children:t.litellm_params?.default_on?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.created_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.updated_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.updated_at)})})}},{id:"actions",header:"Actions",cell:({row:e})=>{let t=e.original,r=t.guardrail_definition_location===ts.CONFIG;return(0,l.jsx)("div",{className:"flex space-x-2",children:r?(0,l.jsx)(ej.Tooltip,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,l.jsx)(e2.Icon,{"data-testid":"config-delete-icon",icon:e5.TrashIcon,size:"sm",className:"cursor-not-allowed text-gray-400",title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.","aria-label":"Delete guardrail (config)"})}):(0,l.jsx)(ej.Tooltip,{title:"Delete guardrail",children:(0,l.jsx)(e2.Icon,{icon:e5.TrashIcon,size:"sm",onClick:()=>t.guardrail_id&&a(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],f=(0,e9.useReactTable)({data:e,columns:h,state:{sorting:o},onSortingChange:d,getCoreRowModel:(0,te.getCoreRowModel)(),getSortedRowModel:(0,te.getSortedRowModel)(),enableSorting:!0});return(0,l.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)(eY.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,l.jsx)(eZ.TableHead,{children:f.getHeaderGroups().map(e=>(0,l.jsx)(e1.TableRow,{children:e.headers.map(e=>(0,l.jsx)(e0.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,e9.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,l.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,l.jsx)(e8.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,l.jsx)(e3.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,l.jsx)(e6.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,l.jsx)(eQ.TableBody,{children:t?(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eX.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"Loading..."})})})}):e.length>0?f.getRowModel().rows.map(e=>(0,l.jsx)(e1.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,l.jsx)(eX.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,e9.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eX.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"No guardrails found"})})})})})]})}),p&&(0,l.jsx)(ti,{visible:c,onClose:()=>u(!1),accessToken:r,onSuccess:()=>{u(!1),g(null),i()},guardrailId:p.guardrail_id||"",fullLitellmParams:p.litellm_params,initialValues:{guardrail_name:p.guardrail_name||"",provider:Object.keys(ea).find(e=>ea[e]===p?.litellm_params.guardrail)||"",mode:p.litellm_params.mode,default_on:p.litellm_params.default_on,pii_entities_config:p.litellm_params.pii_entities_config,skip_system_message_choice:ec(p.litellm_params?.skip_system_message_in_guardrail),...p.guardrail_info}})]})}],782719);var tn=e.i(500330),to=e.i(245094),eN=eN,td=e.i(530212),tc=e.i(350967),tm=e.i(197647),tu=e.i(653824),tp=e.i(881073),tg=e.i(404206),tx=e.i(723731),th=e.i(629569),tf=e.i(678784),ty=e.i(118366),tj=e.i(560445);let{Text:t_}=d.Typography,{Option:tb}=n.Select,tv=({categories:e,onActionChange:t,onSeverityChange:a,onRemove:r,readOnly:i=!1})=>{let s=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(t_,{strong:!0,children:e}),e!==t.category&&(0,l.jsx)("div",{children:(0,l.jsx)(t_,{type:"secondary",style:{fontSize:12},children:t.category})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>i?(0,l.jsx)(o.Tag,{color:{high:"red",medium:"orange",low:"yellow"}[e],children:e.toUpperCase()}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>a?.(t.id,e),style:{width:150},size:"small",children:[(0,l.jsx)(tb,{value:"high",children:"High"}),(0,l.jsx)(tb,{value:"medium",children:"Medium"}),(0,l.jsx)(tb,{value:"low",children:"Low"})]})},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>i?(0,l.jsx)(o.Tag,{color:"BLOCK"===e?"red":"blue",children:e}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>t?.(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(tb,{value:"BLOCK",children:"Block"}),(0,l.jsx)(tb,{value:"MASK",children:"Mask"})]})}];return(i||s.push({title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r?.(t.id),children:"Delete"})}),0===e.length)?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No categories configured."}):(0,l.jsx)(I.Table,{dataSource:e,columns:s,rowKey:"id",pagination:!1,size:"small"})},tw=({patterns:e,blockedWords:t,categories:a=[],readOnly:r=!0,onPatternActionChange:i,onPatternRemove:s,onBlockedWordUpdate:n,onBlockedWordRemove:o,onCategoryActionChange:d,onCategorySeverityChange:c,onCategoryRemove:m})=>{if(0===e.length&&0===t.length&&0===a.length)return null;let u=()=>{};return(0,l.jsxs)(l.Fragment,{children:[a.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Content Categories"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[a.length," categories configured"]})]}),(0,l.jsx)(tv,{categories:a,onActionChange:r?void 0:d,onSeverityChange:r?void 0:c,onRemove:r?void 0:m,readOnly:r})]}),e.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[e.length," patterns configured"]})]}),(0,l.jsx)(T,{patterns:e,onActionChange:r?u:i||u,onRemove:r?u:s||u})]}),t.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[t.length," keywords configured"]})]}),(0,l.jsx)(F,{keywords:t,onActionChange:r?u:n||u,onRemove:r?u:o||u})]})]})},{Text:tN}=d.Typography,tC=({guardrailData:e,guardrailSettings:t,isEditing:a,accessToken:r,onDataChange:i,onUnsavedChanges:s})=>{let[n,o]=(0,m.useState)([]),[d,c]=(0,m.useState)([]),[u,p]=(0,m.useState)([]),[g,x]=(0,m.useState)([]),[h,f]=(0,m.useState)([]),[y,j]=(0,m.useState)([]),[_,b]=(0,m.useState)(!1),[v,w]=(0,m.useState)(null),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(e?.litellm_params?.patterns){let t=e.litellm_params.patterns.map((e,t)=>({id:`pattern-${t}`,type:"prebuilt"===e.pattern_type?"prebuilt":"custom",name:e.pattern_name||e.name,display_name:e.display_name,pattern:e.pattern,action:e.action||"BLOCK"}));o(t),x(t)}else o([]),x([]);if(e?.litellm_params?.blocked_words){let t=e.litellm_params.blocked_words.map((e,t)=>({id:`word-${t}`,keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));c(t),f(t)}else c([]),f([]);if(e?.litellm_params?.categories?.length>0){let a=t?.content_filter_settings?.content_categories?Object.fromEntries(t.content_filter_settings.content_categories.map(e=>[e.name,e])):{},l=e.litellm_params.categories.map((e,t)=>{let l=a[e.category];return{id:`category-${t}`,category:e.category,display_name:l?.display_name??e.category,action:e.action||"BLOCK",severity_threshold:e.severity_threshold||"medium"}});p(l),j(l)}else p([]),j([]);let a=e?.litellm_params?.competitor_intent_config;if(a&&"object"==typeof a){let e=!!(a.brand_self&&Array.isArray(a.brand_self)&&a.brand_self.length>0),t={competitor_intent_type:a.competitor_intent_type??"airline",brand_self:Array.isArray(a.brand_self)?a.brand_self:[],locations:Array.isArray(a.locations)?a.locations:[],competitors:Array.isArray(a.competitors)?a.competitors:[],policy:a.policy??{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:"number"==typeof a.threshold_high?a.threshold_high:.7,threshold_medium:"number"==typeof a.threshold_medium?a.threshold_medium:.45,threshold_low:"number"==typeof a.threshold_low?a.threshold_low:.3};b(e),w(t),C(e),k(t)}else b(!1),w(null),C(!1),k(null)},[e,t?.content_filter_settings?.content_categories]),(0,m.useEffect)(()=>{i&&i(n,d,u,_,v)},[n,d,u,_,v,i]);let I=m.default.useMemo(()=>{let e=JSON.stringify(n)!==JSON.stringify(g),t=JSON.stringify(d)!==JSON.stringify(h),a=JSON.stringify(u)!==JSON.stringify(y),l=_!==N||JSON.stringify(v)!==JSON.stringify(S);return e||t||a||l},[n,d,u,_,v,g,h,y,N,S]);return((0,m.useEffect)(()=>{a&&s&&s(I)},[I,a,s]),e?.litellm_params?.guardrail!=="litellm_content_filter")?null:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"Content Filter Configuration"}),I&&(0,l.jsx)(tj.Alert,{type:"warning",showIcon:!0,className:"mb-4",message:(0,l.jsx)(tN,{children:'You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,l.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,l.jsx)(Q,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:n,blockedWords:d,onPatternAdd:e=>o([...n,e]),onPatternRemove:e=>o(n.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>o(n.map(a=>a.id===e?{...a,action:t}:a)),onBlockedWordAdd:e=>c([...d,e]),onBlockedWordRemove:e=>c(d.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>c(d.map(l=>l.id===e?{...l,[t]:a}:l)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r,contentCategories:t.content_filter_settings.content_categories||[],selectedContentCategories:u,onContentCategoryAdd:e=>p([...u,e]),onContentCategoryRemove:e=>p(u.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>p(u.map(l=>l.id===e?{...l,[t]:a}:l)),competitorIntentEnabled:_,competitorIntentConfig:v,onCompetitorIntentChange:(e,t)=>{b(e),w(t)}})})]}):(0,l.jsx)(tw,{patterns:n,blockedWords:d,categories:u,readOnly:!0})};var tS=e.i(788191),tk=e.i(245704),tI=e.i(518617);let tA={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};var tO=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tA}))}),tP=e.i(987432);let tT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M892 772h-80v-80c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v80h-80c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h80v80c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-80h80c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM373.5 498.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.8-1.7-203.2 89.2-203.2 200 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.8-1.1 6.4-4.8 5.9-8.8zM824 472c0-109.4-87.9-198.3-196.9-200C516.3 270.3 424 361.2 424 472c0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C357 742.6 326 814.8 324 891.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.5C505.8 695.7 563 672 624 672c110.4 0 200-89.5 200-200zm-109.5 90.5C690.3 586.7 658.2 600 624 600s-66.3-13.3-90.5-37.5a127.26 127.26 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-.1 34.2-13.4 66.3-37.6 90.5z"}}]},name:"usergroup-add",theme:"outlined"};var tL=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tT}))}),tB=e.i(872934);let{Panel:tF}=$.Collapse,{TextArea:t$}=i.Input,tE={empty:{name:"Empty Template",code:`async def apply_guardrail(inputs, request_data, input_type):
+ # inputs: {texts, images, tools, tool_calls, structured_messages, model}
+ # request_data: {model, user_id, team_id, end_user_id, metadata}
+ # input_type: "request" or "response"
+ return allow()`},blockSSN:{name:"Block SSN",code:`def apply_guardrail(inputs, request_data, input_type):
+ for text in inputs["texts"]:
+ if regex_match(text, r"\\d{3}-\\d{2}-\\d{4}"):
+ return block("SSN detected")
+ return allow()`},redactEmail:{name:"Redact Emails",code:`def apply_guardrail(inputs, request_data, input_type):
+ pattern = r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
+ modified = []
+ for text in inputs["texts"]:
+ modified.append(regex_replace(text, pattern, "[EMAIL REDACTED]"))
+ return modify(texts=modified)`},blockSQL:{name:"Block SQL Injection",code:`def apply_guardrail(inputs, request_data, input_type):
+ if input_type != "request":
+ return allow()
+ for text in inputs["texts"]:
+ if contains_code_language(text, ["sql"]):
+ return block("SQL code not allowed")
+ return allow()`},validateJSON:{name:"Validate JSON",code:`def apply_guardrail(inputs, request_data, input_type):
+ if input_type != "response":
+ return allow()
+
+ schema = {"type": "object", "required": ["name", "value"]}
+
+ for text in inputs["texts"]:
+ obj = json_parse(text)
+ if obj is None:
+ return block("Invalid JSON response")
+ if not json_schema_valid(obj, schema):
+ return block("Response missing required fields")
+ return allow()`},externalAPI:{name:"External API Check (async)",code:`async def apply_guardrail(inputs, request_data, input_type):
+ # Call an external moderation API (async for non-blocking)
+ for text in inputs["texts"]:
+ response = await http_post(
+ "https://api.example.com/moderate",
+ body={"text": text, "user_id": request_data["user_id"]},
+ headers={"Authorization": "Bearer YOUR_API_KEY"},
+ timeout=10
+ )
+
+ if not response["success"]:
+ # API call failed, allow by default or block
+ return allow()
+
+ if response["body"].get("flagged"):
+ return block(response["body"].get("reason", "Content flagged"))
+
+ return allow()`}},tM={"Return Values":[{name:"allow()",desc:"Let request/response through"},{name:"block(reason)",desc:"Reject with message"},{name:"modify(texts=[], images=[], tool_calls=[])",desc:"Transform content"}],"HTTP Requests (async)":[{name:"await http_request(url, method, headers, body)",desc:"Make async HTTP request"},{name:"await http_get(url, headers)",desc:"Async GET request"},{name:"await http_post(url, body, headers)",desc:"Async POST request"}],"Regex Functions":[{name:"regex_match(text, pattern)",desc:"Returns True if pattern found"},{name:"regex_replace(text, pattern, replacement)",desc:"Replace all matches"},{name:"regex_find_all(text, pattern)",desc:"Return list of matches"}],"JSON Functions":[{name:"json_parse(text)",desc:"Parse JSON string, returns None on error"},{name:"json_stringify(obj)",desc:"Convert to JSON string"},{name:"json_schema_valid(obj, schema)",desc:"Validate against JSON schema"}],"URL Functions":[{name:"extract_urls(text)",desc:"Extract all URLs from text"},{name:"is_valid_url(url)",desc:"Check if URL is valid"},{name:"all_urls_valid(text)",desc:"Check all URLs in text are valid"}],"Code Detection":[{name:"detect_code(text)",desc:"Returns True if code detected"},{name:"detect_code_languages(text)",desc:"Returns list of detected languages"},{name:'contains_code_language(text, ["sql"])',desc:"Check for specific languages"}],"Text Utilities":[{name:"contains(text, substring)",desc:"Check if substring exists"},{name:"contains_any(text, [substr1, substr2])",desc:"Check if any substring exists"},{name:"word_count(text)",desc:"Count words"},{name:"char_count(text)",desc:"Count characters"},{name:"lower(text) / upper(text) / trim(text)",desc:"String transforms"}]},tR=[{value:"pre_call",label:"pre_call (Request)"},{value:"post_call",label:"post_call (Response)"},{value:"during_call",label:"during_call (Parallel)"},{value:"logging_only",label:"logging_only"},{value:"pre_mcp_call",label:"pre_mcp_call (Before MCP Tool Call)"},{value:"post_mcp_call",label:"post_mcp_call (After MCP Tool Call)"},{value:"during_mcp_call",label:"during_mcp_call (During MCP Tool Call)"}],tG=({visible:e,onClose:t,onSuccess:a,accessToken:r,editData:i})=>{let o=!!i,[d,c]=(0,m.useState)(""),[g,x]=(0,m.useState)(["pre_call"]),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)("empty"),[_,b]=(0,m.useState)(tE.empty.code),[v,w]=(0,m.useState)(!1),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(!1),I={texts:["Hello, my SSN is 123-45-6789"],images:[],tools:[{type:"function",function:{name:"get_weather",description:"Get the current weather in a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"}},required:["location"]}}}],tool_calls:[],structured_messages:[{role:"system",content:"You are a helpful assistant."},{role:"user",content:"Hello, my SSN is 123-45-6789"}],model:"gpt-4"},A={texts:["The weather in San Francisco is 72°F and sunny."],images:[],tools:[],tool_calls:[{id:"call_abc123",type:"function",function:{name:"get_weather",arguments:'{"location": "San Francisco"}'}}],structured_messages:[],model:"gpt-4"},O={texts:['Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'],images:[],tools:[{type:"function",function:{name:"read_wiki_structure",description:"Read the structure of a GitHub repository (MCP tool passed as OpenAI tool)",parameters:{type:"object",properties:{repoName:{type:"string",description:"Repository name, e.g. BerriAI/litellm"}},required:["repoName"]}}}],tool_calls:[{id:"call_mcp_001",type:"function",function:{name:"read_wiki_structure",arguments:'{"repoName": "BerriAI/litellm"}'}}],structured_messages:[{role:"user",content:'Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'}],model:"mcp-tool-call"},[P,T]=(0,m.useState)(JSON.stringify(I,null,2)),[L,B]=(0,m.useState)(null),[F,E]=(0,m.useState)(null),M=(0,m.useRef)(null),R=e=>null==e?["pre_call"]:Array.isArray(e)?e.length?e:["pre_call"]:[e];(0,m.useEffect)(()=>{e&&(i?(c(i.guardrail_name||""),x(R(i.litellm_params?.mode)),f(i.litellm_params?.default_on||!1),b(i.litellm_params?.custom_code||tE.empty.code),j("")):(c(""),x(["pre_call"]),f(!1),j("empty"),b(tE.empty.code)),B(null),k(!1))},[e,i]);let G=async e=>{try{await navigator.clipboard.writeText(e),E(e),setTimeout(()=>E(null),2e3)}catch(e){console.error("Failed to copy:",e)}},z=async()=>{if(!d.trim())return void u.default.fromBackend("Please enter a guardrail name");if(!_.trim())return void u.default.fromBackend("Please enter custom code");if(!r)return void u.default.fromBackend("No access token available");w(!0);try{if(o&&i){let e={litellm_params:{custom_code:_}};d!==i.guardrail_name&&(e.guardrail_name=d);let t=R(i.litellm_params?.mode);(g.length!==t.length||g.some((e,a)=>e!==t[a]))&&(e.litellm_params.mode=g),h!==i.litellm_params?.default_on&&(e.litellm_params.default_on=h),await (0,p.updateGuardrailCall)(r,i.guardrail_id,e),u.default.success("Custom code guardrail updated successfully")}else await (0,p.createGuardrailCall)(r,{guardrail_name:d,litellm_params:{guardrail:"custom_code",mode:g,default_on:h,custom_code:_},guardrail_info:{}}),u.default.success("Custom code guardrail created successfully");a(),t()}catch(e){console.error("Failed to save guardrail:",e),u.default.fromBackend(`Failed to ${o?"update":"create"} guardrail: `+(e instanceof Error?e.message:String(e)))}finally{w(!1)}},K=async()=>{if(!r)return void B({error:"No access token available"});C(!0),B(null);try{let e;try{e=JSON.parse(P)}catch(e){B({error:"Invalid test input JSON"}),C(!1);return}e.texts||(e.texts=[]);let t=["pre_call","pre_mcp_call"],a=["post_call","post_mcp_call"],l=g.some(e=>t.includes(e))?"request":g.some(e=>a.includes(e))?"response":"request",i=await (0,p.testCustomCodeGuardrail)(r,{custom_code:_,test_input:e,input_type:l,request_data:{model:"test-model",metadata:{}}});i.success&&i.result?B(i.result):i.error?B({error:i.error,error_type:i.error_type}):B({error:"Unknown error occurred"})}catch(e){console.error("Failed to test custom code:",e),B({error:e instanceof Error?e.message:"Failed to test custom code"})}finally{C(!1)}},q=_.split("\n").length;return(0,l.jsxs)(s.Modal,{open:e,onCancel:t,footer:null,width:1400,className:"custom-code-modal",closable:!0,destroyOnClose:!0,children:[(0,l.jsxs)("div",{className:"flex flex-col h-[80vh]",children:[(0,l.jsxs)("div",{className:"pb-4 border-b border-gray-200",children:[(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:o?"Edit Custom Guardrail":"Create Custom Guardrail"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Define custom logic using Python-like syntax"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4 py-4 border-b border-gray-100",children:[(0,l.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Guardrail Name"}),(0,l.jsx)(tt.TextInput,{value:d,onValueChange:c,placeholder:"e.g., block-pii-custom"})]}),(0,l.jsxs)("div",{className:"w-[280px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Mode (can select multiple)"}),(0,l.jsx)(n.Select,{mode:"multiple",value:g,onChange:x,options:tR,className:"w-full",size:"middle",placeholder:"Select modes"})]}),(0,l.jsxs)("div",{className:"w-[180px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Template"}),(0,l.jsx)(n.Select,{value:y,onChange:e=>{j(e),b(tE[e].code)},className:"w-full",size:"middle",dropdownRender:e=>(0,l.jsxs)(l.Fragment,{children:[e,(0,l.jsx)(eG.Divider,{style:{margin:"8px 0"}}),(0,l.jsxs)("div",{style:{padding:"8px 12px",cursor:"pointer",color:"#1890ff",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},onClick:e=>{e.preventDefault(),window.open("https://models.litellm.ai/guardrails","_blank")},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f0f0f0"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,l.jsx)(tL,{}),(0,l.jsx)("span",{children:"Browse Community templates"}),(0,l.jsx)(tB.ExportOutlined,{style:{fontSize:"10px"}})]})]}),children:(0,l.jsx)(n.Select.OptGroup,{label:"STANDARD",children:Object.entries(tE).map(([e,t])=>(0,l.jsx)(n.Select.Option,{value:e,children:t.name},e))})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pt-5",children:[(0,l.jsx)("span",{className:"text-sm text-gray-600",children:"Default On"}),(0,l.jsx)(D.Switch,{checked:h,onChange:f})]})]}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-hidden mt-4 gap-6",children:[(0,l.jsxs)("div",{className:"flex-[2] flex flex-col min-w-0 overflow-y-auto",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2 flex-shrink-0",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Python Logic"}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Restricted environment (no imports)"})]}),(0,l.jsxs)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e] flex-shrink-0",style:{minHeight:"300px",maxHeight:"400px"},children:[(0,l.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-12 bg-[#1e1e1e] border-r border-gray-700 text-right pr-3 pt-3 select-none overflow-hidden",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6"},children:Array.from({length:Math.max(q,20)},(e,t)=>(0,l.jsx)("div",{className:"text-gray-500 h-[22.4px]",children:t+1},t+1))}),(0,l.jsx)("textarea",{ref:M,value:_,onChange:e=>b(e.target.value),onKeyDown:e=>{if("Tab"===e.key){e.preventDefault();let t=e.currentTarget,a=t.selectionStart,l=t.selectionEnd;b(_.substring(0,a)+" "+_.substring(l)),setTimeout(()=>{t.selectionStart=t.selectionEnd=a+4},0)}},spellCheck:!1,className:"w-full h-full pl-14 pr-4 pt-3 pb-3 resize-none focus:outline-none bg-transparent text-gray-200",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6",tabSize:4}})]}),(0,l.jsx)($.Collapse,{activeKey:S?["test"]:[],onChange:e=>k(e.includes("test")),className:"mt-3 bg-white border border-gray-200 rounded-lg flex-shrink-0",expandIcon:({isActive:e})=>(0,l.jsx)(tO,{rotate:90*!!e}),children:(0,l.jsx)(tF,{header:(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,l.jsx)(tS.PlayCircleOutlined,{className:"text-blue-500"}),"Test Your Guardrail"]}),children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600",children:"Test Input (JSON)"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs text-gray-500",children:"Load example:"}),(0,l.jsx)("button",{type:"button",onClick:()=>T(JSON.stringify(I,null,2)),className:"px-2 py-1 text-xs rounded border border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 transition-colors",children:"Pre-call"}),(0,l.jsx)("button",{type:"button",onClick:()=>T(JSON.stringify(O,null,2)),className:"px-2 py-1 text-xs rounded border border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 transition-colors",children:"Pre MCP"}),(0,l.jsx)("button",{type:"button",onClick:()=>T(JSON.stringify(A,null,2)),className:"px-2 py-1 text-xs rounded border border-green-200 bg-green-50 text-green-700 hover:bg-green-100 transition-colors",children:"Post-call"})]})]}),(0,l.jsx)("div",{className:"mb-2 p-2 bg-gray-50 rounded text-xs text-gray-600 border border-gray-200",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"texts"}),": Message content (always)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"images"}),": Base64 images (vision)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tools"}),": Tool definitions ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"}),", MCP as OpenAI tool ",(0,l.jsx)("span",{className:"text-purple-600",children:"(pre_mcp_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tool_calls"}),": LLM tool calls ",(0,l.jsx)("span",{className:"text-green-600",children:"(post_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"structured_messages"}),": Full messages ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"model"}),": Model name (always)"]})]})}),(0,l.jsx)(t$,{value:P,onChange:e=>T(e.target.value),rows:8,className:"font-mono text-xs",placeholder:'{"texts": ["test message"], ...}'})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{size:"xs",onClick:K,disabled:N,icon:tS.PlayCircleOutlined,children:N?"Running...":"Run Test"}),L&&(0,l.jsx)("div",{className:`flex items-center gap-2 text-sm ${L.error?"text-red-600":"allow"===L.action?"text-green-600":"block"===L.action?"text-orange-600":"text-blue-600"}`,children:L.error?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{}),(0,l.jsxs)("span",{children:[L.error_type&&(0,l.jsxs)("span",{className:"font-medium",children:["[",L.error_type,"] "]}),L.error]})]}):"allow"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Allowed"]}):"block"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{})," Blocked: ",L.reason]}):"modify"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Modified",L.texts&&L.texts.length>0&&(0,l.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:["→ ",L.texts[0].substring(0,50),L.texts[0].length>50?"...":""]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," ",L.action||"Unknown"]})})]})]})},"test")}),(0,l.jsxs)("div",{className:"mt-3 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-lg flex items-center justify-between flex-shrink-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"bg-blue-100 rounded-full p-2",children:(0,l.jsx)(tL,{className:"text-blue-600 text-lg"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Built a useful guardrail?"}),(0,l.jsx)("div",{className:"text-xs text-gray-600",children:"Share it with the community and help others build faster"})]})]}),(0,l.jsx)(e4.Button,{size:"xs",onClick:()=>window.open("https://github.com/BerriAI/litellm-guardrails","_blank"),icon:tB.ExportOutlined,className:"bg-blue-600 hover:bg-blue-700 text-white border-0",children:"Contribute Template"})]})]}),(0,l.jsxs)("div",{className:"w-[300px] flex-shrink-0 overflow-auto border-l border-gray-200 pl-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)("span",{className:"font-semibold text-gray-700",children:"Available Primitives"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Click to copy functions to clipboard"}),(0,l.jsx)($.Collapse,{defaultActiveKey:["Return Values"],className:"primitives-collapse bg-transparent border-0",expandIconPosition:"end",children:Object.entries(tM).map(([e,t])=>(0,l.jsx)(tF,{header:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e}),className:"bg-white mb-2 rounded-lg border border-gray-200",children:(0,l.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,l.jsx)("button",{onClick:()=>G(e.name),className:`w-full text-left px-2 py-2 rounded transition-colors ${F===e.name?"bg-green-100":"bg-gray-50 hover:bg-blue-50"}`,children:F===e.name?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-mono text-green-700",children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Copied!"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-xs font-mono text-gray-800",children:e.name}),(0,l.jsx)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:e.desc})]})},e.name))})},e))})]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-gray-200",children:[(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Changes are auto-saved to local draft"}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:z,loading:v,disabled:v||!d.trim(),icon:tP.SaveOutlined,children:o?"Update Guardrail":"Save Guardrail"})]})]})]}),(0,l.jsx)("style",{children:`
+ .custom-code-modal .ant-modal-content {
+ padding: 24px;
+ }
+ .custom-code-modal .ant-modal-close {
+ top: 20px;
+ right: 20px;
+ }
+ .primitives-collapse .ant-collapse-item {
+ border: none !important;
+ }
+ .primitives-collapse .ant-collapse-header {
+ padding: 8px 12px !important;
+ }
+ .primitives-collapse .ant-collapse-content-box {
+ padding: 8px 12px !important;
+ }
+ `})]})};e.s(["default",0,({guardrailId:e,onClose:t,accessToken:a,isAdmin:s})=>{let o,[d,g]=(0,m.useState)(null),[x,h]=(0,m.useState)(null),[f,y]=(0,m.useState)(!0),[j,_]=(0,m.useState)(!1),[b]=r.Form.useForm(),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(null),[I,A]=(0,m.useState)({}),[O,P]=(0,m.useState)(!1),T={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[L,B]=(0,m.useState)(T),[F,$]=(0,m.useState)(!1),[E,M]=(0,m.useState)(!1),R=m.default.useRef({patterns:[],blockedWords:[],categories:[]}),G=(0,m.useCallback)((e,t,a,l,r)=>{R.current={patterns:e,blockedWords:t,categories:a||[],competitorIntentEnabled:l,competitorIntentConfig:r}},[]),z=async()=>{try{if(y(!0),!a)return;let t=await (0,p.getGuardrailInfo)(a,e);if(g(t),t.litellm_params?.pii_entities_config){let e=t.litellm_params.pii_entities_config;if(w([]),C({}),Object.keys(e).length>0){let t=[],a={};Object.entries(e).forEach(([e,l])=>{t.push(e),a[e]="string"==typeof l?l:"MASK"}),w(t),C(a)}}else w([]),C({})}catch(e){u.default.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{y(!1)}},D=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailProviderSpecificParams)(a);h(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},K=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);k(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,m.useEffect)(()=>{D()},[a]),(0,m.useEffect)(()=>{z(),K()},[e,a]),(0,m.useEffect)(()=>{if(d&&b){let e={...d.litellm_params||{}};delete e.skip_system_message_in_guardrail,b.setFieldsValue({guardrail_name:d.guardrail_name,...e,skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}})}},[d,x,b]);let q=(0,m.useCallback)(()=>{d?.litellm_params?.guardrail==="tool_permission"?B({rules:d.litellm_params?.rules||[],default_action:(d.litellm_params?.default_action||"deny").toLowerCase(),on_disallowed_action:(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),violation_message_template:d.litellm_params?.violation_message_template||""}):B(T),$(!1)},[d]);(0,m.useEffect)(()=>{q()},[q]);let H=async t=>{try{if(!a)return;let o={litellm_params:{}};t.guardrail_name!==d.guardrail_name&&(o.guardrail_name=t.guardrail_name),t.default_on!==d.litellm_params?.default_on&&(o.litellm_params.default_on=t.default_on);let c=ec(d.litellm_params?.skip_system_message_in_guardrail),m=t.skip_system_message_choice;void 0!==m&&m!==c&&("inherit"===m?o.litellm_params.skip_system_message_in_guardrail=null:"yes"===m?o.litellm_params.skip_system_message_in_guardrail=!0:o.litellm_params.skip_system_message_in_guardrail=!1);let g=d.guardrail_info,h=t.guardrail_info?JSON.parse(t.guardrail_info):void 0;JSON.stringify(g)!==JSON.stringify(h)&&(o.guardrail_info=h);let f=d.litellm_params?.pii_entities_config||{},y={};if(v.forEach(e=>{y[e]=N[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(y)&&(o.litellm_params.pii_entities_config=y),d.litellm_params?.guardrail==="litellm_content_filter"&&O){var l,r,i,s,n;let e,t=(l=R.current.patterns||[],r=R.current.blockedWords||[],i=R.current.categories||[],s=R.current.competitorIntentEnabled,n=R.current.competitorIntentConfig,e={patterns:l.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action})),blocked_words:r.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))},void 0!==i&&(e.categories=i.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),s&&n&&n.brand_self.length>0&&(e.competitor_intent_config={competitor_intent_type:n.competitor_intent_type,brand_self:n.brand_self,locations:n.locations?.length?n.locations:void 0,competitors:"generic"===n.competitor_intent_type&&n.competitors?.length?n.competitors:void 0,policy:n.policy,threshold_high:n.threshold_high,threshold_medium:n.threshold_medium,threshold_low:n.threshold_low}),e);o.litellm_params.patterns=t.patterns,o.litellm_params.blocked_words=t.blocked_words,o.litellm_params.categories=t.categories,o.litellm_params.competitor_intent_config=t.competitor_intent_config??null}if(d.litellm_params?.guardrail==="tool_permission"){let e=d.litellm_params?.rules||[],t=L.rules||[],a=JSON.stringify(e)!==JSON.stringify(t),l=(d.litellm_params?.default_action||"deny").toLowerCase(),r=(L.default_action||"deny").toLowerCase(),i=l!==r,s=(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),n=(L.on_disallowed_action||"block").toLowerCase(),c=s!==n,m=d.litellm_params?.violation_message_template||"",u=L.violation_message_template||"",p=m!==u;(F||a||i||c||p)&&(o.litellm_params.rules=t,o.litellm_params.default_action=r,o.litellm_params.on_disallowed_action=n,o.litellm_params.violation_message_template=u||null)}let j=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);console.log("values: ",JSON.stringify(t)),console.log("currentProvider: ",j);let b=d.litellm_params?.guardrail==="tool_permission";if(x&&j&&!b){let e=x[ea[j]?.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(e)),Object.keys(e).forEach(e=>{"optional_params"!==e&&a.add(e)}),e.optional_params&&e.optional_params.fields&&Object.keys(e.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{if("patterns"===e||"blocked_words"===e||"categories"===e)return;let a=t[e];(null==a||""===a)&&(a=t.optional_params?.[e]);let l=d.litellm_params?.[e];JSON.stringify(a)!==JSON.stringify(l)&&(null!=a&&""!==a?o.litellm_params[e]=a:null!=l&&""!==l&&(o.litellm_params[e]=null))})}if(0===Object.keys(o.litellm_params).length&&delete o.litellm_params,0===Object.keys(o).length){u.default.info("No changes detected"),_(!1);return}await (0,p.updateGuardrailCall)(a,e,o),u.default.success("Guardrail updated successfully"),P(!1),z(),_(!1)}catch(e){console.error("Error updating guardrail:",e),u.default.fromBackend("Failed to update guardrail")}};if(f)return(0,l.jsx)("div",{className:"p-4",children:"Loading..."});if(!d)return(0,l.jsx)("div",{className:"p-4",children:"Guardrail not found"});let J=e=>e?new Date(e).toLocaleString():"-",{logo:U,displayName:W}=ed(d.litellm_params?.guardrail||""),V=async(e,t)=>{await (0,tn.copyToClipboard)(e)&&(A(e=>({...e,[t]:!0})),setTimeout(()=>{A(e=>({...e,[t]:!1}))},2e3))},Y="config"===d.guardrail_definition_location;return(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Button,{type:"text",icon:(0,l.jsx)(td.ArrowLeftIcon,{className:"w-4 h-4"}),onClick:t,className:"mb-4",children:"Back to Guardrails"}),(0,l.jsx)(th.Title,{children:d.guardrail_name||"Unnamed Guardrail"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(eR.Text,{className:"text-gray-500 font-mono",children:d.guardrail_id}),(0,l.jsx)(c.Button,{type:"text",size:"small",icon:I["guardrail-id"]?(0,l.jsx)(tf.CheckIcon,{size:12}):(0,l.jsx)(ty.CopyIcon,{size:12}),onClick:()=>V(d.guardrail_id,"guardrail-id"),className:`left-2 z-10 transition-all duration-200 ${I["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,l.jsxs)(tu.TabGroup,{children:[(0,l.jsxs)(tp.TabList,{className:"mb-4",children:[(0,l.jsx)(tm.Tab,{children:"Overview"},"overview"),s?(0,l.jsx)(tm.Tab,{children:"Settings"},"settings"):(0,l.jsx)(l.Fragment,{})]}),(0,l.jsxs)(tx.TabPanels,{children:[(0,l.jsxs)(tg.TabPanel,{children:[(0,l.jsxs)(tc.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Provider"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[U&&(0,l.jsx)("img",{src:U,alt:`${W} logo`,className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)(th.Title,{children:W})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Mode"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:d.litellm_params?.mode||"-"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Default On":"Default Off"})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Created At"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:J(d.created_at)}),(0,l.jsxs)(eR.Text,{children:["Last Updated: ",J(d.updated_at)]})]})]})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsx)(eR.Text,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(d.litellm_params?.pii_entities_config).map(([e,t])=>(0,l.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-medium text-gray-900",children:e}),(0,l.jsx)(eR.Text,{className:"flex-1",children:(0,l.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${"MASK"===t?"text-blue-600":"text-red-600"}`,children:["MASK"===t?(0,l.jsx)(eN.default,{}):(0,l.jsx)(eC.StopOutlined,{}),String(t)]})})]},e))})]})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsx)(eq,{value:L,disabled:!0})}),d.litellm_params?.guardrail==="custom_code"&&d.litellm_params?.custom_code&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)(eR.Text,{className:"font-medium text-lg",children:"Custom Code"})]}),s&&!Y&&(0,l.jsx)(c.Button,{size:"small",icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"})]}),(0,l.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e]",children:(0,l.jsx)("pre",{className:"p-4 text-sm text-gray-200 overflow-x-auto",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace"},children:(0,l.jsx)("code",{children:d.litellm_params.custom_code})})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!1,accessToken:a})]}),s&&(0,l.jsx)(tg.TabPanel,{children:(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(th.Title,{children:"Guardrail Settings"}),Y&&(0,l.jsx)(ej.Tooltip,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})}),!j&&!Y&&(d.litellm_params?.guardrail==="custom_code"?(0,l.jsx)(c.Button,{icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"}):(0,l.jsx)(c.Button,{onClick:()=>_(!0),children:"Edit Settings"}))]}),j?(0,l.jsxs)(r.Form,{form:b,onFinish:H,initialValues:{guardrail_name:d.guardrail_name,...(o={...d.litellm_params||{}},delete o.skip_system_message_in_guardrail,o),skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}},layout:"vertical",children:[(0,l.jsx)(r.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter guardrail name"})}),(0,l.jsx)(r.Form.Item,{label:"Default On",name:"default_on",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{label:"Skip system messages in guardrail",name:"skip_system_message_choice",tooltip:"Unified guardrails: omit role: system from guardrail input (LLM still gets full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),d.litellm_params?.guardrail==="presidio"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"PII Protection"}),(0,l.jsx)("div",{className:"mb-6",children:S&&(0,l.jsx)(eE,{entities:S.supported_entities,actions:S.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onActionSelect:(e,t)=>{C(a=>({...a,[e]:t}))},entityCategories:S.pii_entity_categories})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!0,accessToken:a,onDataChange:G,onUnsavedChanges:P}),(d.litellm_params?.guardrail==="tool_permission"||x)&&(0,l.jsx)(eG.Divider,{orientation:"left",children:"Provider Settings"}),d.litellm_params?.guardrail==="tool_permission"?(0,l.jsx)(eq,{value:L,onChange:B}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey,{selectedProvider:Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail)||null,accessToken:a,providerParams:x,value:d.litellm_params}),x&&(()=>{let e=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);if(!e)return null;let t=x[ea[e]?.toLowerCase()];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:d.litellm_params}):null})()]}),(0,l.jsx)(eG.Divider,{orientation:"left",children:"Advanced Settings"}),(0,l.jsx)(r.Form.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,l.jsx)(i.Input.TextArea,{rows:5})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,l.jsx)(c.Button,{onClick:()=>{_(!1),P(!1),q()},children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail ID"}),(0,l.jsx)("div",{className:"font-mono",children:d.guardrail_id})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail Name"}),(0,l.jsx)("div",{children:d.guardrail_name||"Unnamed Guardrail"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Provider"}),(0,l.jsx)("div",{children:W})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Mode"}),(0,l.jsx)("div",{children:d.litellm_params?.mode||"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Default On"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Yes":"No"})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Created At"}),(0,l.jsx)("div",{children:J(d.created_at)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Last Updated"}),(0,l.jsx)("div",{children:J(d.updated_at)})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eq,{value:L,disabled:!0})]})]})})]})]}),(0,l.jsx)(tG,{visible:E,onClose:()=>M(!1),onSuccess:()=>{M(!1),z()},accessToken:a,editData:d?{guardrail_id:d.guardrail_id,guardrail_name:d.guardrail_name,litellm_params:d.litellm_params}:null})]})}],969641);var tz=e.i(573421),tD=e.i(19732),tK=e.i(928685),tq=e.i(166406),tH=e.i(637235),tJ=e.i(755151),tU=e.i(240647);let{Text:tW}=d.Typography,tV=function({results:e,errors:t}){let[a,r]=(0,m.useState)(new Set),i=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),r(t)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return e||t?(0,l.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),e&&e.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-green-50 border-green-200",children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>i(e.guardrailName),children:[t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"}),(0,l.jsx)(tk.CheckCircleOutlined,{className:"text-green-600 text-lg"}),(0,l.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tH.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!t&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tq.CopyOutlined,onClick:async()=>{await s(e.response_text)?u.default.success("Result copied to clipboard"):u.default.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,l.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,l.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,l.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,l.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),t&&t.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-red-50 border-red-200",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>i(e.guardrailName),children:t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"})}),(0,l.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,l.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>i(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tH.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!t&&(0,l.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null},{TextArea:tY}=i.Input,{Text:tQ}=d.Typography,tX=function({guardrailNames:e,onSubmit:t,isLoading:a,results:r,errors:i,onClose:s}){let[n,o]=(0,m.useState)(""),d=()=>{n.trim()?t(n):u.default.fromBackend("Please enter text to test")},c=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},p=async()=>{await c(n)?u.default.success("Input copied to clipboard"):u.default.fromBackend("Failed to copy input")};return(0,l.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,l.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,l.jsx)("div",{className:"flex items-center space-x-3",children:(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,l.jsx)("div",{className:"inline-flex items-center space-x-1 bg-blue-50 px-3 py-1 rounded-md border border-blue-200",children:(0,l.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",e.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,l.jsx)(ej.Tooltip,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,l.jsx)(eD.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),n&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tq.CopyOutlined,onClick:p,children:"Copy Input"})]}),(0,l.jsx)(tY,{value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),d())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,l.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Press ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Shift+Enter"})," for new line"]}),(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Characters: ",n.length]})]})]}),(0,l.jsx)("div",{className:"pt-2",children:(0,l.jsx)(e4.Button,{onClick:d,loading:a,disabled:!n.trim(),className:"w-full",children:a?`Testing ${e.length} guardrail${e.length>1?"s":""}...`:`Test ${e.length} guardrail${e.length>1?"s":""}`})})]}),(0,l.jsx)(tV,{results:r,errors:i})]})]})};e.s(["default",0,({guardrailsList:e,isLoading:t,accessToken:a,onClose:r})=>{let[s,n]=(0,m.useState)(new Set),[o,c]=(0,m.useState)(""),[g,x]=(0,m.useState)([]),[f,y]=(0,m.useState)([]),[j,_]=(0,m.useState)(!1),b=e.filter(e=>e.guardrail_name?.toLowerCase().includes(o.toLowerCase())),v=async e=>{if(0===s.size||!a)return;_(!0),x([]),y([]);let t=[],l=[];await Promise.all(Array.from(s).map(async r=>{let i=Date.now();try{let l=await (0,p.applyGuardrail)(a,r,e,null,null),s=Date.now()-i;t.push({guardrailName:r,response_text:l.response_text,latency:s})}catch(t){let e=Date.now()-i;console.error(`Error testing guardrail ${r}:`,t),l.push({guardrailName:r,error:t,latency:e})}})),x(t),y(l),_(!1),t.length>0&&u.default.success(`${t.length} guardrail${t.length>1?"s":""} applied successfully`),l.length>0&&u.default.fromBackend(`${l.length} guardrail${l.length>1?"s":""} failed`)};return(0,l.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,l.jsx)(h.Card,{className:"h-full",styles:{body:{padding:0,height:"100%"}},children:(0,l.jsxs)("div",{className:"flex h-full",children:[(0,l.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,l.jsx)(i.Input,{prefix:(0,l.jsx)(tK.SearchOutlined,{}),placeholder:"Search guardrails...",value:o,onChange:e=>c(e.target.value)})]})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto",children:t?(0,l.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,l.jsx)(eh.Spin,{})}):0===b.length?(0,l.jsx)("div",{className:"p-4",children:(0,l.jsx)(ez.Empty,{description:o?"No guardrails match your search":"No guardrails available"})}):(0,l.jsx)(tz.List,{dataSource:b,renderItem:e=>(0,l.jsx)(tz.List.Item,{onClick:()=>{var t;let a;e.guardrail_name&&(t=e.guardrail_name,(a=new Set(s)).has(t)?a.delete(t):a.add(t),n(a))},style:{paddingLeft:24,paddingRight:16},className:`cursor-pointer hover:bg-gray-50 transition-colors ${s.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"}`,children:(0,l.jsx)(tz.List.Item.Meta,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(tD.ExperimentOutlined,{className:"text-gray-400"}),(0,l.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,l.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Type: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,l.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,l.jsxs)(d.Typography.Text,{className:"text-xs text-gray-600",children:[s.size," of ",b.length," selected"]})})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(d.Typography.Title,{level:2,className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===s.size?(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(tD.ExperimentOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-center text-gray-500 max-w-md",children:"Choose one or more guardrails from the left sidebar to start testing and comparing results."})]}):(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(tX,{guardrailNames:Array.from(s),onSubmit:v,results:g.length>0?g:null,errors:f.length>0?f:null,isLoading:j,onClose:()=>n(new Set)})})})]})]})})})}],476993),e.s([],824296),e.s(["CustomCodeModal",0,tG],64352);let tZ="../ui/assets/logos/",t0=[{id:"cf_denied_financial",name:"Denied Financial Advice",description:"Detects requests for personalized financial advice, investment recommendations, or financial planning.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:207,latency:"<0.1ms"}},{id:"cf_denied_insults",name:"Insults & Personal Attacks",description:"Detects insults, name-calling, and personal attacks directed at the chatbot, staff, or other people.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:299,latency:"<0.1ms"}},{id:"cf_denied_legal",name:"Denied Legal Advice",description:"Detects requests for unauthorized legal advice, case analysis, or legal recommendations.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_denied_medical",name:"Denied Medical Advice",description:"Detects requests for medical diagnosis, treatment recommendations, or health advice.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_harmful_violence",name:"Harmful Violence",description:"Detects content related to violence, criminal planning, attacks, and violent threats.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_self_harm",name:"Harmful Self-Harm",description:"Detects content related to self-harm, suicide, and dangerous self-destructive behavior.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_child_safety",name:"Harmful Child Safety",description:"Detects content that could endanger child safety or exploit minors.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_illegal_weapons",name:"Harmful Illegal Weapons",description:"Detects content related to illegal weapons manufacturing, distribution, or acquisition.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_bias_gender",name:"Bias: Gender",description:"Detects gender-based discrimination, stereotypes, and biased language.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_racial",name:"Bias: Racial",description:"Detects racial discrimination, stereotypes, and racially biased content.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_religious",name:"Bias: Religious",description:"Detects religious discrimination, intolerance, and religiously biased content.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_sexual_orientation",name:"Bias: Sexual Orientation",description:"Detects discrimination based on sexual orientation and related biased content.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_prompt_injection_jailbreak",name:"Prompt Injection: Jailbreak",description:"Detects jailbreak attempts designed to bypass AI safety guidelines and restrictions.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_data_exfil",name:"Prompt Injection: Data Exfiltration",description:"Detects attempts to extract sensitive data through prompt manipulation.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_sql",name:"Prompt Injection: SQL",description:"Detects SQL injection attempts embedded in prompts.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_malicious_code",name:"Prompt Injection: Malicious Code",description:"Detects attempts to inject malicious code through prompts.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_system_prompt",name:"Prompt Injection: System Prompt",description:"Detects attempts to extract or override system prompts.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_toxic_abuse",name:"Toxic & Abusive Language",description:"Detects toxic, abusive, and hateful language across multiple languages (EN, AU, DE, ES, FR).",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Toxicity"]},{id:"cf_patterns",name:"Pattern Matching",description:"Detect and block sensitive data patterns like SSNs, credit card numbers, API keys, and custom regex patterns.",category:"litellm",subcategory:"Patterns",logo:`${tZ}litellm_logo.jpg`,tags:["PII","Regex","Data Protection"]},{id:"cf_keywords",name:"Keyword Blocking",description:"Block or mask content containing specific keywords or phrases. Upload custom word lists or add individual terms.",category:"litellm",subcategory:"Keywords",logo:`${tZ}litellm_logo.jpg`,tags:["Keywords","Blocklist"]},{id:"block_code_execution",name:"Block Code Execution",description:"Detects markdown fenced code blocks in requests and responses. Block or mask executable code (e.g. Python, JavaScript, Bash) by language with configurable confidence.",category:"litellm",subcategory:"Code Safety",logo:`${tZ}litellm_logo.jpg`,tags:["Code","Safety","Prompt Injection"]},{id:"cf_competitor_intent",name:"Competitor Name Blocking",description:"Block or reframe competitor comparison and ranking intent. Detect when users ask to compare or recommend competitors (airline or generic competitor lists).",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Competitor","Topic Blocker"]},{id:"presidio",name:"Presidio PII",description:"Microsoft Presidio for PII detection and anonymization. Supports 30+ entity types with configurable actions.",category:"partner",logo:`${tZ}microsoft_azure.svg`,tags:["PII","Microsoft"],providerKey:"PresidioPII"},{id:"bedrock",name:"Bedrock Guardrail",description:"AWS Bedrock Guardrails for content filtering, topic avoidance, and sensitive information detection.",category:"partner",logo:`${tZ}bedrock.svg`,tags:["AWS","Content Safety"],providerKey:"Bedrock"},{id:"lakera",name:"Lakera",description:"AI security platform protecting against prompt injections, data leakage, and harmful content.",category:"partner",logo:`${tZ}lakeraai.jpeg`,tags:["Security","Prompt Injection"],providerKey:"Lakera"},{id:"openai_moderation",name:"OpenAI Moderation",description:"OpenAI's content moderation API for detecting harmful content across multiple categories.",category:"partner",logo:`${tZ}openai_small.svg`,tags:["Content Moderation","OpenAI"]},{id:"google_model_armor",name:"Google Cloud Model Armor",description:"Google Cloud's model protection service for safe and responsible AI deployments.",category:"partner",logo:`${tZ}google.svg`,tags:["Google Cloud","Safety"]},{id:"guardrails_ai",name:"Guardrails AI",description:"Open-source framework for adding structural, type, and quality guarantees to LLM outputs.",category:"partner",logo:`${tZ}guardrails_ai.jpeg`,tags:["Open Source","Validation"]},{id:"zscaler",name:"Zscaler AI Guard",description:"Enterprise AI security from Zscaler for monitoring and protecting AI/ML workloads.",category:"partner",logo:`${tZ}zscaler.svg`,tags:["Enterprise","Security"]},{id:"panw",name:"PANW Prisma AIRS",description:"Palo Alto Networks Prisma AI Runtime Security for securing AI applications in production.",category:"partner",logo:`${tZ}palo_alto_networks.jpeg`,tags:["Enterprise","Security"]},{id:"noma",name:"Noma Security",description:"AI security platform for detecting and preventing AI-specific threats and vulnerabilities.",category:"partner",logo:`${tZ}noma_security.png`,tags:["Security","Threat Detection"]},{id:"aporia",name:"Aporia AI",description:"Real-time AI guardrails for hallucination detection, topic control, and policy enforcement.",category:"partner",logo:`${tZ}aporia.png`,tags:["Hallucination","Policy"]},{id:"aim",name:"AIM Guardrail",description:"AIM Security guardrails for comprehensive AI threat detection and mitigation.",category:"partner",logo:`${tZ}aim_security.jpeg`,tags:["Security","Threat Detection"]},{id:"prompt_security",name:"Prompt Security",description:"Protect against prompt injection attacks, data leakage, and other LLM security threats.",category:"partner",logo:`${tZ}prompt_security.png`,tags:["Prompt Injection","Security"]},{id:"lasso",name:"Lasso Guardrail",description:"Content moderation and safety guardrails for responsible AI deployments.",category:"partner",logo:`${tZ}lasso.png`,tags:["Content Moderation"]},{id:"pangea",name:"Pangea Guardrail",description:"Pangea's AI guardrails for secure, compliant, and trustworthy AI applications.",category:"partner",logo:`${tZ}pangea.png`,tags:["Compliance","Security"]},{id:"enkryptai",name:"EnkryptAI",description:"AI security and governance platform for enterprise AI safety and compliance.",category:"partner",logo:`${tZ}enkrypt_ai.avif`,tags:["Enterprise","Governance"]},{id:"javelin",name:"Javelin Guardrails",description:"AI gateway with built-in guardrails for secure and compliant AI operations.",category:"partner",logo:`${tZ}javelin.png`,tags:["Gateway","Security"]},{id:"pillar",name:"Pillar Guardrail",description:"AI safety platform for monitoring, testing, and securing AI systems.",category:"partner",logo:`${tZ}pillar.jpeg`,tags:["Monitoring","Safety"]},{id:"akto",name:"Akto Guardrail",description:"AI security platform from Akto.io with automatic monitoring and guardrails for AI/ML applications.",category:"partner",logo:`${tZ}akto.svg`,tags:["Security","Safety","Monitoring"]},{id:"promptguard",name:"PromptGuard",description:"AI security gateway with prompt injection detection, PII redaction, topic filtering, entity blocklists, and hallucination detection. Self-hostable with drop-in proxy integration.",category:"partner",logo:`${tZ}promptguard.svg`,tags:["Security","Prompt Injection","PII"],providerKey:"Promptguard",eval:{f1:94.9,precision:100,recall:90.4,testCases:5384,latency:"~150ms"}},{id:"xecguard",name:"XecGuard",description:"CyCraft XecGuard AI security gateway. Multi-policy scanning (prompt injection, harmful content, PII, system-prompt enforcement) plus RAG context grounding.",category:"partner",logo:`${tZ}xecguard.svg`,tags:["Security","Policy","Grounding","RAG"],providerKey:"Xecguard"}];e.s(["ALL_CARDS",0,t0],230312)},826910,e=>{"use strict";var t=e.i(201072);e.s(["CheckCircleFilled",()=>t.default])},487304,168118,e=>{"use strict";var t=e.i(843476),a=e.i(271645),l=e.i(464571),r=e.i(326373),i=e.i(653496),s=e.i(755151),n=e.i(646563),o=e.i(245094),d=e.i(764205),c=e.i(185357),m=e.i(782719),u=e.i(708347),p=e.i(969641),g=e.i(476993),x=e.i(727749),h=e.i(127952),f=e.i(180766);e.i(824296);var y=e.i(64352),j=e.i(311451),_=e.i(928685),b=e.i(266537),v=e.i(230312),w=e.i(826910);let N=({src:e,name:l})=>{let[r,i]=(0,a.useState)(!1);return r||!e?(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:6,backgroundColor:"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:600,color:"#6b7280",flexShrink:0},children:l?.charAt(0)||"?"}):(0,t.jsx)("img",{src:e,alt:"",style:{width:28,height:28,borderRadius:6,objectFit:"contain",flexShrink:0},onError:()=>i(!0)})},C=({card:e,onClick:l})=>{let[r,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{onClick:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,border:r?"1px solid #93c5fd":"1px solid #e5e7eb",backgroundColor:"#ffffff",padding:"20px 20px 16px 20px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",display:"flex",flexDirection:"column",minHeight:170,boxShadow:r?"0 1px 6px rgba(59,130,246,0.08)":"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[(0,t.jsx)(N,{src:e.logo,name:e.name}),(0,t.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"#111827",lineHeight:1.3},children:e.name})]}),(0,t.jsx)("p",{className:"line-clamp-3",style:{fontSize:12,color:"#6b7280",lineHeight:1.6,margin:0,flex:1},children:e.description}),e.eval&&(0,t.jsxs)("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)(w.CheckCircleFilled,{style:{color:"#16a34a",fontSize:12}}),(0,t.jsxs)("span",{style:{fontSize:11,color:"#16a34a",fontWeight:500},children:["F1: ",e.eval.f1,"% · ",e.eval.testCases," test cases"]})]})]})};var S=e.i(447566);let k={cf_denied_financial:{provider:"LitellmContentFilter",categoryName:"denied_financial_advice",guardrailNameSuggestion:"Denied Financial Advice",mode:"pre_call",defaultOn:!1},cf_denied_legal:{provider:"LitellmContentFilter",categoryName:"denied_legal_advice",guardrailNameSuggestion:"Denied Legal Advice",mode:"pre_call",defaultOn:!1},cf_denied_medical:{provider:"LitellmContentFilter",categoryName:"denied_medical_advice",guardrailNameSuggestion:"Denied Medical Advice",mode:"pre_call",defaultOn:!1},cf_denied_insults:{provider:"LitellmContentFilter",categoryName:"denied_insults",guardrailNameSuggestion:"Insults & Personal Attacks",mode:"pre_call",defaultOn:!1},cf_harmful_violence:{provider:"LitellmContentFilter",categoryName:"harmful_violence",guardrailNameSuggestion:"Harmful Violence",mode:"pre_call",defaultOn:!1},cf_harmful_self_harm:{provider:"LitellmContentFilter",categoryName:"harmful_self_harm",guardrailNameSuggestion:"Harmful Self-Harm",mode:"pre_call",defaultOn:!1},cf_harmful_child_safety:{provider:"LitellmContentFilter",categoryName:"harmful_child_safety",guardrailNameSuggestion:"Harmful Child Safety",mode:"pre_call",defaultOn:!1},cf_harmful_illegal_weapons:{provider:"LitellmContentFilter",categoryName:"harmful_illegal_weapons",guardrailNameSuggestion:"Harmful Illegal Weapons",mode:"pre_call",defaultOn:!1},cf_bias_gender:{provider:"LitellmContentFilter",categoryName:"bias_gender",guardrailNameSuggestion:"Bias: Gender",mode:"pre_call",defaultOn:!1},cf_bias_racial:{provider:"LitellmContentFilter",categoryName:"bias_racial",guardrailNameSuggestion:"Bias: Racial",mode:"pre_call",defaultOn:!1},cf_bias_religious:{provider:"LitellmContentFilter",categoryName:"bias_religious",guardrailNameSuggestion:"Bias: Religious",mode:"pre_call",defaultOn:!1},cf_bias_sexual_orientation:{provider:"LitellmContentFilter",categoryName:"bias_sexual_orientation",guardrailNameSuggestion:"Bias: Sexual Orientation",mode:"pre_call",defaultOn:!1},cf_prompt_injection_jailbreak:{provider:"LitellmContentFilter",categoryName:"prompt_injection_jailbreak",guardrailNameSuggestion:"Prompt Injection: Jailbreak",mode:"pre_call",defaultOn:!1},cf_prompt_injection_data_exfil:{provider:"LitellmContentFilter",categoryName:"prompt_injection_data_exfiltration",guardrailNameSuggestion:"Prompt Injection: Data Exfiltration",mode:"pre_call",defaultOn:!1},cf_prompt_injection_sql:{provider:"LitellmContentFilter",categoryName:"prompt_injection_sql",guardrailNameSuggestion:"Prompt Injection: SQL",mode:"pre_call",defaultOn:!1},cf_prompt_injection_malicious_code:{provider:"LitellmContentFilter",categoryName:"prompt_injection_malicious_code",guardrailNameSuggestion:"Prompt Injection: Malicious Code",mode:"pre_call",defaultOn:!1},cf_prompt_injection_system_prompt:{provider:"LitellmContentFilter",categoryName:"prompt_injection_system_prompt",guardrailNameSuggestion:"Prompt Injection: System Prompt",mode:"pre_call",defaultOn:!1},cf_toxic_abuse:{provider:"LitellmContentFilter",categoryName:"harm_toxic_abuse",guardrailNameSuggestion:"Toxic & Abusive Language",mode:"pre_call",defaultOn:!1},cf_patterns:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Pattern Matching",mode:"pre_call",defaultOn:!1},cf_keywords:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Keyword Blocking",mode:"pre_call",defaultOn:!1},block_code_execution:{provider:"BlockCodeExecution",guardrailNameSuggestion:"Block Code Execution",mode:"pre_call",defaultOn:!1},cf_competitor_intent:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Competitor Name Blocking",mode:"pre_call",defaultOn:!1},presidio:{provider:"PresidioPII",guardrailNameSuggestion:"Presidio PII",mode:"pre_call",defaultOn:!1},bedrock:{provider:"Bedrock",guardrailNameSuggestion:"Bedrock Guardrail",mode:"pre_call",defaultOn:!1},lakera:{provider:"Lakera",guardrailNameSuggestion:"Lakera",mode:"pre_call",defaultOn:!1},openai_moderation:{provider:"OpenaiModeration",guardrailNameSuggestion:"OpenAI Moderation",mode:"pre_call",defaultOn:!1},google_model_armor:{provider:"ModelArmor",guardrailNameSuggestion:"Google Cloud Model Armor",mode:"pre_call",defaultOn:!1},guardrails_ai:{provider:"GuardrailsAi",guardrailNameSuggestion:"Guardrails AI",mode:"pre_call",defaultOn:!1},zscaler:{provider:"ZscalerAiGuard",guardrailNameSuggestion:"Zscaler AI Guard",mode:"pre_call",defaultOn:!1},panw:{provider:"PanwPrismaAirs",guardrailNameSuggestion:"PANW Prisma AIRS",mode:"pre_call",defaultOn:!1},noma:{provider:"Noma",guardrailNameSuggestion:"Noma Security",mode:"pre_call",defaultOn:!1},aporia:{provider:"AporiaAi",guardrailNameSuggestion:"Aporia AI",mode:"pre_call",defaultOn:!1},aim:{provider:"Aim",guardrailNameSuggestion:"AIM Guardrail",mode:"pre_call",defaultOn:!1},prompt_security:{provider:"PromptSecurity",guardrailNameSuggestion:"Prompt Security",mode:"pre_call",defaultOn:!1},lasso:{provider:"Lasso",guardrailNameSuggestion:"Lasso Guardrail",mode:"pre_call",defaultOn:!1},pangea:{provider:"Pangea",guardrailNameSuggestion:"Pangea Guardrail",mode:"pre_call",defaultOn:!1},enkryptai:{provider:"Enkryptai",guardrailNameSuggestion:"EnkryptAI",mode:"pre_call",defaultOn:!1},javelin:{provider:"Javelin",guardrailNameSuggestion:"Javelin Guardrails",mode:"pre_call",defaultOn:!1},pillar:{provider:"Pillar",guardrailNameSuggestion:"Pillar Guardrail",mode:"pre_call",defaultOn:!1},akto:{provider:"Akto",guardrailNameSuggestion:"Akto Guardrail",mode:"pre_call",defaultOn:!1},promptguard:{provider:"Promptguard",guardrailNameSuggestion:"PromptGuard",mode:"pre_call",defaultOn:!1},xecguard:{provider:"Xecguard",guardrailNameSuggestion:"XecGuard",mode:"pre_call",defaultOn:!1}},I=({card:e,onBack:r,accessToken:i,onGuardrailCreated:s})=>{let[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)("overview"),u=[{property:"Provider",value:"litellm"===e.category?"LiteLLM Content Filter":"Partner Guardrail"},...e.subcategory?[{property:"Subcategory",value:e.subcategory}]:[],..."litellm"===e.category?[{property:"Cost",value:"$0 / request"}]:[],..."litellm"===e.category?[{property:"External Dependencies",value:"None"}]:[],..."litellm"===e.category?[{property:"Latency",value:e.eval?.latency||"<1ms"}]:[]],p=e.eval?[{metric:"Precision",value:`${e.eval.precision}%`},{metric:"Recall",value:`${e.eval.recall}%`},{metric:"F1 Score",value:`${e.eval.f1}%`},{metric:"Test Cases",value:String(e.eval.testCases)},{metric:"False Positives",value:"0"},{metric:"False Negatives",value:"0"},{metric:"Latency (p50)",value:e.eval.latency}]:[],g=[{key:"overview",label:"Overview"},...e.eval?[{key:"eval",label:"Eval Results"}]:[]];return(0,t.jsxs)("div",{style:{maxWidth:960,margin:"0 auto"},children:[(0,t.jsxs)("div",{onClick:r,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(S.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:e.name})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:8},children:[(0,t.jsx)("img",{src:e.logo,alt:"",style:{width:40,height:40,borderRadius:8,objectFit:"contain"},onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name})]}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 20px 0",lineHeight:1.6},children:e.description}),(0,t.jsx)("div",{style:{display:"flex",gap:10,marginBottom:32},children:(0,t.jsx)(l.Button,{onClick:()=>o(!0),style:{borderRadius:20,padding:"4px 20px",height:36,borderColor:"#dadce0",color:"#1a73e8",fontWeight:500,fontSize:14},children:"Create Guardrail"})}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:g.map(e=>(0,t.jsx)("div",{onClick:()=>m(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 12px 0"},children:"Overview"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#3c4043",lineHeight:1.7,margin:"0 0 32px 0"},children:e.description}),(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Guardrail Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Details are as follows"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:200},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:u.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},a))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Guardrail ID"}),(0,t.jsxs)("div",{style:{fontSize:13,color:"#202124",wordBreak:"break-all"},children:["litellm/",e.id]})]}),(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Type"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#202124"},children:"litellm"===e.category?"Content Filter":"Partner"})]}),e.tags.length>0&&(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.tags.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]})]})]}),"eval"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 16px 0"},children:"Eval Results"}),(0,t.jsxs)("table",{style:{width:"100%",maxWidth:560,borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Metric"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Value"})]})}),(0,t.jsx)("tbody",{children:p.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#3c4043"},children:e.metric}),(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#202124",fontWeight:500},children:e.value})]},a))})]})]}),(0,t.jsx)(c.default,{visible:n,onClose:()=>o(!1),accessToken:i,onSuccess:()=>{o(!1),s()},preset:k[e.id]})]})},A=({accessToken:e,onGuardrailCreated:l})=>{let[r,i]=(0,a.useState)(""),[s,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),c=v.ALL_CARDS.filter(e=>{if(!r)return!0;let t=r.toLowerCase();return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))}),m=c.filter(e=>"litellm"===e.category),u=c.filter(e=>"partner"===e.category);return s?(0,t.jsx)(I,{card:s,onBack:()=>n(null),accessToken:e,onGuardrailCreated:l}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{marginBottom:24},children:(0,t.jsx)(j.Input,{size:"large",placeholder:"Search guardrails",prefix:(0,t.jsx)(_.SearchOutlined,{style:{color:"#9ca3af"}}),value:r,onChange:e=>i(e.target.value),style:{borderRadius:8}})}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:0},children:"LiteLLM Content Filter"}),(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:14,color:"#1a73e8",cursor:"pointer"},onClick:()=>d(!o),children:o?(0,t.jsx)(t.Fragment,{children:"Show less"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.ArrowRightOutlined,{style:{fontSize:12}}),`Show all (${m.length})`]})})]}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Built-in guardrails powered by LiteLLM. Zero latency, no external dependencies, no additional cost."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:(o?m:m.slice(0,10)).map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:"0 0 4px 0"},children:"Partner Guardrails"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Third-party guardrail integrations from leading AI security providers."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:u.map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]})]})};var O=e.i(988846),P=e.i(837007),T=e.i(409797),L=e.i(54131),B=e.i(995926),F=e.i(678784),$=e.i(634831),E=e.i(438100),M=e.i(302202),R=e.i(328196),G=e.i(879664);e.s(["InfoIcon",()=>G.default],168118);var G=G,z=e.i(212931),D=e.i(808613),K=e.i(199133),q=e.i(663435),H=e.i(954616),J=e.i(912598),U=e.i(135214),W=e.i(243652);let V=async(e,t)=>{let a=(0,d.getProxyBaseUrl)(),l=`${a}/guardrails/register`,r=await fetch(l,{method:"POST",headers:{[(0,d.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.json().catch(()=>({})),t=(0,d.deriveErrorMessage)(e);throw(0,d.handleError)(t),Error(t)}return r.json()},Y=(0,W.createQueryKeys)("guardrails");function Q(e){var t;let a=e.litellm_params??{},l=e.guardrail_info??{},r=a.headers,i=Array.isArray(r)?r.map(e=>({key:(e.key??e.name??"").toString(),value:String(e.value??"")})):"object"==typeof r&&null!==r?Object.entries(r).map(([e,t])=>({key:e,value:String(t??"")})):[],s=a.api_base??a.url??"",n=l.model??a.model??"—",o=a.forward_api_key??!0,d=Array.isArray(a.extra_headers)?a.extra_headers.filter(e=>"string"==typeof e):[];return{id:e.guardrail_id,team:e.team_id??"—",name:e.guardrail_name,endpoint:s,status:"pending_review"===(t=e.status)?"pending":"active"===t||"rejected"===t?t:"active",model:n,forwardKey:o,description:l.description??"",method:a.method??"POST",customHeaders:i,extraHeaders:d,submittedAt:function(e){if(!e)return"—";try{let t=new Date(e);return isNaN(t.getTime())?e:t.toISOString().slice(0,10)}catch{return e}}(e.submitted_at),submittedBy:e.submitted_by_email??e.submitted_by_user_id??"—",mode:a.mode,unreachable_fallback:a.unreachable_fallback,additionalProviderParams:a.additional_provider_specific_params,guardrailType:a.guardrail}}let X={active:{label:"Active",bg:"bg-green-50",text:"text-green-700",dot:"bg-green-500"},pending:{label:"Pending Review",bg:"bg-yellow-50",text:"text-yellow-700",dot:"bg-yellow-500"},rejected:{label:"Rejected",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"}},Z={"ML Platform":"bg-purple-100 text-purple-700","Data Science":"bg-blue-100 text-blue-700",Security:"bg-red-100 text-red-700","Customer Success":"bg-orange-100 text-orange-700",Legal:"bg-gray-100 text-gray-700",Finance:"bg-green-100 text-green-700"};function ee({label:e,value:a,color:l}){return(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg px-4 py-3",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${l}`,children:a}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e})]})}function et({enabled:e,onToggle:a}){return(0,t.jsx)("button",{type:"button",onClick:a,role:"switch","aria-checked":e,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${e?"bg-blue-500":"bg-gray-200"}`,children:(0,t.jsx)("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ${e?"translate-x-4":"translate-x-0.5"}`})})}function ea({guardrail:e,isSelected:a,isHeadersExpanded:l,onSelect:r,onToggleForwardKey:i,onToggleHeaders:s,onApprove:n,onReject:o}){let d=X[e.status],c=Z[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsxs)("div",{className:`bg-white border rounded-lg p-4 transition-all ${a?"border-blue-400 ring-1 ring-blue-200":"border-gray-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${c}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${d.bg} ${d.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${d.dot}`}),d.label]})]}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-2 line-clamp-1",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(M.ServerIcon,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-gray-500 font-mono truncate",children:e.endpoint})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-gray-500",children:[(0,t.jsxs)("span",{children:["Model: ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.model})]}),(0,t.jsxs)("span",{children:["Submitted:"," ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.submittedAt})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:"Forward API Key"}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:i})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs border border-gray-300 text-gray-600 hover:bg-gray-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:a?"Close":"Review"}),"pending"===e.status&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:n,className:"text-xs bg-green-500 hover:bg-green-600 text-white px-3 py-1.5 rounded-md transition-colors font-medium",children:"Approve"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"text-xs border border-red-300 text-red-600 hover:bg-red-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:"Reject"})]})]})]})]}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[(0,t.jsxs)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-700 transition-colors",children:[l?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5"}):(0,t.jsx)(T.ChevronDownIcon,{className:"h-3.5 w-3.5"}),"Static headers",e.customHeaders.length>0&&(0,t.jsx)("span",{className:"ml-1 bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),l&&(0,t.jsx)("div",{className:"mt-2",children:0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic",children:"No static headers configured."}):(0,t.jsx)("div",{className:"space-y-1",children:e.customHeaders.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-mono",children:[(0,t.jsx)("span",{className:"text-gray-500 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.key}),(0,t.jsx)("span",{className:"text-gray-400",children:":"}),(0,t.jsx)("span",{className:"text-gray-700 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.value})]},`${e.key}-${a}`))})})]})]})}function el({label:e,children:a}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),(0,t.jsx)("div",{children:a})]})}function er({guardrail:e,onClose:l,onApprove:r,onReject:i,onToggleForwardKey:s,onUpdateCustomHeaders:n,onUpdateExtraHeaders:o}){let[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[p,g]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),f=X[e.status],y=Z[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsx)("div",{className:"w-96 flex-shrink-0 bg-white overflow-auto",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${y}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${f.bg} ${f.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${f.dot}`}),f.label]})]}),(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["Submitted by ",e.submittedBy," on ",e.submittedAt]})]}),(0,t.jsx)("button",{type:"button",onClick:l,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close detail panel",children:(0,t.jsx)(B.XIcon,{className:"h-4 w-4"})})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-5",children:e.description}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(el,{label:"Endpoint",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"text-xs font-mono text-gray-700 break-all",children:e.endpoint}),(0,t.jsx)("a",{href:e.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-blue-500 flex-shrink-0",children:(0,t.jsx)($.ExternalLinkIcon,{className:"h-3.5 w-3.5"})})]})}),(0,t.jsx)(el,{label:"Method",children:(0,t.jsx)("span",{className:"text-xs font-mono font-medium text-gray-700 bg-gray-100 px-2 py-0.5 rounded",children:e.method})}),(0,t.jsxs)("div",{className:"border border-blue-100 bg-blue-50 rounded-lg p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(E.KeyIcon,{className:"h-3.5 w-3.5 text-blue-500"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-blue-800",children:"Forward LiteLLM API Key"})]}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:s})]}),(0,t.jsxs)("p",{className:"text-xs text-blue-700 leading-relaxed",children:["When enabled, the caller's LiteLLM API key is forwarded as an"," ",(0,t.jsx)("code",{className:"font-mono bg-blue-100 px-1 rounded",children:"Authorization"})," ","header to your guardrail endpoint. This allows your guardrail to authenticate model calls using the original caller's credentials."]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Static headers"}),e.customHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Sent with every request to the guardrail."}),0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No static headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.customHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsxs)("span",{className:"text-gray-700 truncate",children:[a.key,": ",a.value]}),(0,t.jsx)("button",{type:"button",onClick:()=>n(e.customHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a.key}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a.key}-${l}`))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:"Header name (e.g. X-API-Key)",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"Value",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=p.trim(),a=x.trim();t&&!e.customHeaders.some(e=>e.key.toLowerCase()===t.toLowerCase())&&(n([...e.customHeaders,{key:t,value:a}]),g(""),h(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors flex-shrink-0",children:"Add"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Forward client headers"}),e.extraHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.extraHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Allowed header names to forward from the client request to the guardrail (e.g. x-request-id)."}),0===e.extraHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No forward client headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.extraHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-gray-700 truncate",children:a}),(0,t.jsx)("button",{type:"button",onClick:()=>o(e.extraHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a}-${l}`))}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"e.g. x-request-id",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=m.trim().toLowerCase();a&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(a)&&(o([...e.extraHeaders,a]),u(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=m.trim().toLowerCase();t&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(t)&&(o([...e.extraHeaders,t]),u(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors",children:"Add"})]})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(!d),className:"w-full flex items-center justify-between px-3 py-2 text-left text-xs font-semibold text-gray-700 bg-gray-50 hover:bg-gray-100 transition-colors",children:[(0,t.jsx)("span",{children:"Equivalent config"}),d?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5 text-gray-500"}):(0,t.jsx)(T.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-500"})]}),d&&(0,t.jsx)("pre",{className:"p-3 text-xs font-mono text-gray-700 bg-white border-t border-gray-200 overflow-x-auto whitespace-pre-wrap break-all",children:function(e){let t=["litellm_settings:"," guardrails:",` - guardrail_name: "${e.name.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`," litellm_params:",` guardrail: ${e.guardrailType??"generic_guardrail_api"}`,` mode: ${e.mode??"pre_call"} # or post_call, during_call`,` api_base: ${e.endpoint||"https://your-guardrail-api.com"}`," api_key: os.environ/YOUR_GUARDRAIL_API_KEY # optional",` unreachable_fallback: ${e.unreachable_fallback??"fail_closed"} # default: fail_closed. Set to fail_open to proceed if the guardrail endpoint is unreachable.`,` forward_api_key: ${e.forwardKey}`];if(e.model&&"—"!==e.model&&t.push(` model: "${e.model}" # LLM model name sent to the guardrail for context`),e.customHeaders.length>0)for(let a of(t.push(" headers: # static headers (sent with every request)"),e.customHeaders))t.push(` ${a.key}: "${String(a.value).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`);if(e.extraHeaders.length>0)for(let a of(t.push(" extra_headers: # forward these client request headers to the guardrail"),e.extraHeaders))t.push(` - ${a}`);if(e.additionalProviderParams&&Object.keys(e.additionalProviderParams).length>0)for(let[a,l]of(t.push(" additional_provider_specific_params:"),Object.entries(e.additionalProviderParams))){let e="string"==typeof l?`"${l}"`:String(l);t.push(` ${a}: ${e}`)}return t.join("\n")}(e)})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,t.jsx)(G.default,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 mt-0.5"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 leading-relaxed",children:["This guardrail runs on a separate instance. It receives the user request and forwards the result to the next step in the pipeline. See"," ",(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/adding_provider/generic_guardrail_api",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:"LiteLLM Generic Guardrail API docs"})," ","for configuration details."]})]})]}),(0,t.jsxs)("div",{className:"mt-5 pt-4 border-t border-gray-100 space-y-2",children:[(0,t.jsxs)("button",{type:"button",className:"w-full flex items-center justify-center gap-2 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)($.ExternalLinkIcon,{className:"h-4 w-4"}),"Test Endpoint"]}),"pending"===e.status&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:r,className:"flex-1 flex items-center justify-center gap-1.5 bg-green-500 hover:bg-green-600 text-white text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(F.CheckIcon,{className:"h-4 w-4"}),"Approve"]}),(0,t.jsxs)("button",{type:"button",onClick:i,className:"flex-1 flex items-center justify-center gap-1.5 border border-red-300 text-red-600 hover:bg-red-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(B.XIcon,{className:"h-4 w-4"}),"Reject"]})]})]})]})})}function ei({action:e,guardrailName:a,onConfirm:l,onCancel:r}){let i="approve"===e;return(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-50",children:(0,t.jsxs)("div",{className:"bg-white rounded-xl shadow-xl p-6 max-w-sm w-full mx-4",children:[(0,t.jsx)("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mb-4 ${i?"bg-green-100":"bg-red-100"}`,children:i?(0,t.jsx)(F.CheckIcon,{className:"h-5 w-5 text-green-600"}):(0,t.jsx)(R.AlertCircleIcon,{className:"h-5 w-5 text-red-600"})}),(0,t.jsx)("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:i?"Approve Guardrail":"Reject Guardrail"}),(0,t.jsxs)("p",{className:"text-sm text-gray-500 mb-5",children:["Are you sure you want to ",e," ",(0,t.jsxs)("span",{className:"font-medium text-gray-700",children:['"',a,'"']}),"?"," ",i?"This will make it active and available for use.":"This will mark it as rejected and notify the team."]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"flex-1 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:l,className:`flex-1 text-white text-sm font-medium py-2 rounded-md transition-colors ${i?"bg-green-500 hover:bg-green-600":"bg-red-500 hover:bg-red-600"}`,children:i?"Approve":"Reject"})]})]})})}function es({accessToken:e}){let[l,r]=(0,a.useState)([]),[i,s]=(0,a.useState)({total:0,pending_review:0,active:0,rejected:0}),[n,o]=(0,a.useState)(""),[c,m]=(0,a.useState)("all"),[u,p]=(0,a.useState)(null),[g,h]=(0,a.useState)(new Set),[f,y]=(0,a.useState)(null),[_,b]=(0,a.useState)(!0),[v,w]=(0,a.useState)(null),[N,C]=(0,a.useState)(""),[S,k]=(0,a.useState)(!1),[I]=D.Form.useForm(),A=(()=>{let{accessToken:e}=(0,U.default)(),t=(0,J.useQueryClient)();return(0,H.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return V(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Y.all})}})})();(0,a.useEffect)(()=>{let e=setTimeout(()=>C(n),300);return()=>clearTimeout(e)},[n]);let T=(0,a.useCallback)(async()=>{if(!e)return void b(!1);b(!0),w(null);try{let t="all"===c?void 0:"pending"===c?"pending_review":c,a=await (0,d.listGuardrailSubmissions)(e,{status:t,search:N.trim()||void 0});r(a.submissions.map(Q)),s(a.summary)}catch(e){w(e instanceof Error?e.message:"Failed to load submissions"),r([])}finally{b(!1)}},[e,c,N]);(0,a.useEffect)(()=>{T()},[T]);let L=l.find(e=>e.id===u)??null,B=i.total,F=i.pending_review,$=i.active,E=i.rejected;async function M(t){if(!e)return;let a=l.find(e=>e.id===t);if(!a)return;let i=!a.forwardKey;try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{forward_api_key:i}}),r(e=>e.map(e=>e.id===t?{...e,forwardKey:i}:e)),x.default.success(i?"Forward API key enabled":"Forward API key disabled")}catch{x.default.fromBackend("Failed to update forward API key")}}async function R(t,a){if(!e)return;let l={};for(let{key:e,value:t}of a)e.trim()&&(l[e.trim()]=t);try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{headers:l}}),r(e=>e.map(e=>e.id===t?{...e,customHeaders:a.filter(e=>e.key.trim())}:e)),x.default.success("Static headers updated")}catch{x.default.fromBackend("Failed to update static headers")}}async function G(t,a){if(e)try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{extra_headers:a}}),r(e=>e.map(e=>e.id===t?{...e,extraHeaders:a}:e)),x.default.success("Forward client headers updated")}catch{x.default.fromBackend("Failed to update forward client headers")}}async function W(t){if(e)try{await (0,d.approveGuardrailSubmission)(e,t),y(null),u===t&&p(null),await T(),x.default.success("Guardrail approved")}catch{x.default.fromBackend("Failed to approve guardrail")}}async function X(t){if(e)try{await (0,d.rejectGuardrailSubmission)(e,t),y(null),u===t&&p(null),await T(),x.default.success("Guardrail rejected")}catch{x.default.fromBackend("Failed to reject guardrail")}}return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:`flex-1 min-w-0 p-6 overflow-auto ${L?"border-r border-gray-200":""}`,children:[(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[(0,t.jsx)(ee,{label:"Total Submitted",value:B,color:"text-gray-900"}),(0,t.jsx)(ee,{label:"Pending Review",value:F,color:"text-yellow-600"}),(0,t.jsx)(ee,{label:"Active",value:$,color:"text-green-600"}),(0,t.jsx)(ee,{label:"Rejected",value:E,color:"text-red-600"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(O.SearchIcon,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,t.jsx)("input",{type:"text",placeholder:"Search guardrails...",value:n,onChange:e=>o(e.target.value),className:"w-full pl-9 pr-4 py-2 border border-gray-200 rounded-md text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"})]}),(0,t.jsxs)("select",{value:c,onChange:e=>m(e.target.value),className:"border border-gray-200 rounded-md px-3 py-2 text-sm text-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 bg-white",children:[(0,t.jsx)("option",{value:"all",children:"All Status"}),(0,t.jsx)("option",{value:"pending",children:"Pending Review"}),(0,t.jsx)("option",{value:"active",children:"Active"}),(0,t.jsx)("option",{value:"rejected",children:"Rejected"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>k(!0),className:"ml-auto flex items-center gap-2 bg-blue-500 hover:bg-blue-600 text-white text-sm font-medium px-4 py-2 rounded-md transition-colors",children:[(0,t.jsx)(P.PlusIcon,{className:"h-4 w-4"}),"Add Guardrail"]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[_&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-500 text-sm",children:"Loading submissions…"}),v&&(0,t.jsx)("div",{className:"text-center py-12 text-red-600 text-sm",children:v}),!_&&!v&&0===l.length&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-400 text-sm",children:"No guardrails match your filters."}),!_&&!v&&l.map(e=>(0,t.jsx)(ea,{guardrail:e,isSelected:u===e.id,isHeadersExpanded:g.has(e.id),onSelect:()=>p(u===e.id?null:e.id),onToggleForwardKey:()=>M(e.id),onToggleHeaders:()=>{var t;return t=e.id,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},onApprove:()=>y({id:e.id,action:"approve"}),onReject:()=>y({id:e.id,action:"reject"})},e.id))]})]}),L&&(0,t.jsx)(er,{guardrail:L,onClose:()=>p(null),onApprove:()=>y({id:L.id,action:"approve"}),onReject:()=>y({id:L.id,action:"reject"}),onToggleForwardKey:()=>M(L.id),onUpdateCustomHeaders:e=>R(L.id,e),onUpdateExtraHeaders:e=>G(L.id,e)}),f&&(0,t.jsx)(ei,{action:f.action,guardrailName:l.find(e=>e.id===f.id)?.name??"",onConfirm:()=>"approve"===f.action?W(f.id):X(f.id),onCancel:()=>y(null)}),(0,t.jsxs)(z.Modal,{title:"Submit Guardrail for Review",open:S,onCancel:()=>{k(!1),I.resetFields()},onOk:()=>I.submit(),okText:"Submit for Review",children:[(0,t.jsx)("div",{className:"rounded-md bg-blue-50 border border-blue-200 px-4 py-3 text-sm text-blue-800 mb-4",children:"Your guardrail will be sent for admin review before it becomes active."}),(0,t.jsxs)(D.Form,{form:I,layout:"vertical",initialValues:{mode:"pre_call"},onFinish:async e=>{let t={...e.extra_litellm_params?JSON.parse(e.extra_litellm_params):{},guardrail:"generic_guardrail_api",mode:e.mode,api_base:e.api_base};try{await A.mutateAsync({team_id:e.team_id,guardrail_name:e.guardrail_name,litellm_params:t,guardrail_info:e.guardrail_info?JSON.parse(e.guardrail_info):void 0}),x.default.success("Guardrail submitted for review"),k(!1),I.resetFields(),T()}catch{}},children:[(0,t.jsx)(D.Form.Item,{label:"Team",name:"team_id",rules:[{required:!0,message:"Select a team"}],children:(0,t.jsx)(q.default,{})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Enter a guardrail name"}],children:(0,t.jsx)(j.Input,{placeholder:"e.g. pii-detection"})}),(0,t.jsx)(D.Form.Item,{label:"Mode",name:"mode",rules:[{required:!0,message:"Select a mode"}],children:(0,t.jsxs)(K.Select,{children:[(0,t.jsx)(K.Select.Option,{value:"pre_call",children:"Pre Call"}),(0,t.jsx)(K.Select.Option,{value:"post_call",children:"Post Call"}),(0,t.jsx)(K.Select.Option,{value:"during_call",children:"During Call"})]})}),(0,t.jsx)(D.Form.Item,{label:"API Base URL",name:"api_base",rules:[{required:!0,message:"Enter the API base URL"},{type:"url",message:"Must be a valid URL"}],children:(0,t.jsx)(j.Input,{placeholder:"https://your-guardrail-api.com/v1/check",className:"font-mono"})}),(0,t.jsx)(D.Form.Item,{label:"Additional litellm_params (optional)",name:"extra_litellm_params",tooltip:"JSON object merged into litellm_params. e.g. forward_api_key, headers, model, unreachable_fallback",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{let e=JSON.parse(t);if("object"!=typeof e||Array.isArray(e))return Promise.reject("Must be a JSON object");return Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"forward_api_key": true, "headers": {"X-Custom": "value"}}'})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Info (optional)",name:"guardrail_info",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"description": "Detects PII in requests"}'})})]})]})]})}e.s(["default",0,({accessToken:e,userRole:j})=>{let[_,b]=(0,a.useState)([]),[v,w]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),[S,k]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[P,T]=(0,a.useState)(null),[L,B]=(0,a.useState)(!1),[F,$]=(0,a.useState)(null),E=!!j&&(0,u.isAdminRole)(j),M=async()=>{if(e){k(!0);try{let t=await (0,d.getGuardrailsList)(e);console.log(`guardrails: ${JSON.stringify(t)}`),b(t.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{k(!1)}}};(0,a.useEffect)(()=>{M()},[e]);let R=()=>{M()},G=async()=>{if(P&&e){O(!0);try{await (0,d.deleteGuardrailCall)(e,P.guardrail_id),x.default.success(`Guardrail "${P.guardrail_name}" deleted successfully`),await M()}catch(e){console.error("Error deleting guardrail:",e),x.default.fromBackend("Failed to delete guardrail")}finally{O(!1),B(!1),T(null)}}},z=P&&P.litellm_params?(0,f.getGuardrailLogoAndName)(P.litellm_params.guardrail).displayName:void 0;return(0,t.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,t.jsx)(i.Tabs,{defaultActiveKey:"submitted",items:[...E?[{key:"garden",label:"Guardrail Garden",children:(0,t.jsx)(A,{accessToken:e,onGuardrailCreated:R})},{key:"guardrails",label:"Guardrails",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)(r.Dropdown,{menu:{items:[{key:"provider",icon:(0,t.jsx)(n.PlusOutlined,{}),label:"Add Provider Guardrail",onClick:()=>{F&&$(null),w(!0)}},{key:"custom_code",icon:(0,t.jsx)(o.CodeOutlined,{}),label:"Create Custom Code Guardrail",onClick:()=>{F&&$(null),C(!0)}}]},trigger:["click"],disabled:!e,children:(0,t.jsxs)(l.Button,{disabled:!e,children:["+ Add New Guardrail ",(0,t.jsx)(s.DownOutlined,{className:"ml-2"})]})})}),F?(0,t.jsx)(p.default,{guardrailId:F,onClose:()=>$(null),accessToken:e,isAdmin:E}):(0,t.jsx)(m.default,{guardrailsList:_,isLoading:S,onDeleteClick:(e,t)=>{T(_.find(t=>t.guardrail_id===e)||null),B(!0)},accessToken:e,onGuardrailUpdated:M,isAdmin:E,onGuardrailClick:e=>$(e)}),(0,t.jsx)(c.default,{visible:v,onClose:()=>{w(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(y.CustomCodeModal,{visible:N,onClose:()=>{C(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(h.default,{isOpen:L,title:"Delete Guardrail",message:`Are you sure you want to delete guardrail: ${P?.guardrail_name}? This action cannot be undone.`,resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:P?.guardrail_name},{label:"ID",value:P?.guardrail_id,code:!0},{label:"Provider",value:z},{label:"Mode",value:P?.litellm_params.mode},{label:"Default On",value:P?.litellm_params.default_on?"Yes":"No"}],onCancel:()=>{B(!1),T(null)},onOk:G,confirmLoading:I})]})},{key:"playground",label:"Test Playground",disabled:!e,children:(0,t.jsx)(g.default,{guardrailsList:_,isLoading:S,accessToken:e,onClose:()=>{}})}]:[],{key:"submitted",label:"Submitted Guardrails",children:(0,t.jsx)(es,{accessToken:e})}]})})}],487304)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/17816faaae727f81.js b/litellm/proxy/_experimental/out/_next/static/chunks/17816faaae727f81.js
new file mode 100644
index 0000000000..4b48fc668b
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/17816faaae727f81.js
@@ -0,0 +1,3 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,517442,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(592968);let l=e=>e>=.8?"text-green-600":"text-yellow-600",r=({entities:e})=>{let[a,r]=(0,s.useState)(!0),[i,n]=(0,s.useState)({});return e&&0!==e.length?(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>r(!a),children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${a?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",e.length,")"]})]}),a&&(0,t.jsx)("div",{className:"space-y-2",children:e.map((e,s)=>{let a=i[s]||!1;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>{n(e=>({...e,[s]:!e[s]}))},children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${a?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,t.jsxs)("span",{className:`font-mono ${l(e.score)}`,children:["Score: ",e.score.toFixed(2)]})]}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),a&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,t.jsx)("span",{children:e.entity_type})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,t.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,t.jsx)("span",{className:l(e.score),children:e.score.toFixed(2)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,t.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,t.jsxs)("div",{className:"flex overflow-hidden",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,t.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,t.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]}):null},i=(e,s="slate")=>(0,t.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block ${{green:"bg-green-100 text-green-800",red:"bg-red-100 text-red-800",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-100 text-slate-800",amber:"bg-amber-100 text-amber-800"}[s]}`,children:e}),n=e=>e?i("detected","red"):i("not detected","slate"),o=({title:e,count:a,defaultOpen:l=!0,right:r,children:i})=>{let[n,o]=(0,s.useState)(l);return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>o(e=>!e),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${n?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h5",{className:"font-medium",children:[e," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]}),(0,t.jsx)("div",{children:r})]}),n&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:i})]})},d=({label:e,children:s,mono:a})=>(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:e}),(0,t.jsx)("span",{className:a?"font-mono text-sm break-all":"",children:s})]}),c=()=>(0,t.jsx)("div",{className:"my-3 border-t"}),x=({response:e})=>{if(!e)return null;let s=e.outputs??e.output??[],a="GUARDRAIL_INTERVENED"===e.action?"red":"green",l=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.guardrailCoverage?.textCharacters&&i(`text guarded ${e.guardrailCoverage.textCharacters.guarded??0}/${e.guardrailCoverage.textCharacters.total??0}`,"blue"),e.guardrailCoverage?.images&&i(`images guarded ${e.guardrailCoverage.images.guarded??0}/${e.guardrailCoverage.images.total??0}`,"blue")]}),r=e.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(e.usage).map(([e,s])=>"number"==typeof s?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[e,": ",s]},e):null)});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d,{label:"Action:",children:i(e.action??"N/A",a)}),e.actionReason&&(0,t.jsx)(d,{label:"Action Reason:",children:e.actionReason}),e.blockedResponse&&(0,t.jsx)(d,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:e.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d,{label:"Coverage:",children:l}),(0,t.jsx)(d,{label:"Usage:",children:r})]})]}),s.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap",children:e.text??(0,t.jsx)("em",{children:"(non-text output)"})})},s))})]})]}),e.assessments?.length?(0,t.jsx)("div",{className:"space-y-3",children:e.assessments.map((e,s)=>{let a=(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.wordPolicy&&i("word","slate"),e.contentPolicy&&i("content","slate"),e.topicPolicy&&i("topic","slate"),e.sensitiveInformationPolicy&&i("sensitive-info","slate"),e.contextualGroundingPolicy&&i("contextual-grounding","slate"),e.automatedReasoningPolicy&&i("automated-reasoning","slate")]});return(0,t.jsxs)(o,{title:`Assessment #${s+1}`,defaultOpen:!0,right:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e.invocationMetrics?.guardrailProcessingLatency!=null&&i(`${e.invocationMetrics.guardrailProcessingLatency} ms`,"amber"),a]}),children:[e.wordPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Word Policy"}),(e.wordPolicy.customWords?.length??0)>0&&(0,t.jsx)(o,{title:"Custom Words",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.customWords.map((e,s)=>(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match})]}),n(e.detected)]},s))})}),(e.wordPolicy.managedWordLists?.length??0)>0&&(0,t.jsx)(o,{title:"Managed Word Lists",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.managedWordLists.map((e,s)=>(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match}),e.type&&i(e.type,"slate")]}),n(e.detected)]},s))})})]}),e.contentPolicy?.filters?.length?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Content Policy"}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"min-w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-gray-600",children:[(0,t.jsx)("th",{className:"py-1 pr-4",children:"Type"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Action"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Detected"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Strength"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Confidence"})]})}),(0,t.jsx)("tbody",{children:e.contentPolicy.filters.map((e,s)=>(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.type??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:i(e.action??"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:n(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.filterStrength??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.confidence??"—"})]},s))})]})})]}):null,e.contextualGroundingPolicy?.filters?.length?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Contextual Grounding"}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"min-w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-gray-600",children:[(0,t.jsx)("th",{className:"py-1 pr-4",children:"Type"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Action"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Detected"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Score"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Threshold"})]})}),(0,t.jsx)("tbody",{children:e.contextualGroundingPolicy.filters.map((e,s)=>(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.type??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:i(e.action??"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:n(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.score??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.threshold??"—"})]},s))})]})})]}):null,e.sensitiveInformationPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Sensitive Information"}),(e.sensitiveInformationPolicy.piiEntities?.length??0)>0&&(0,t.jsx)(o,{title:"PII Entities",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.piiEntities.map((e,s)=>(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),e.type&&i(e.type,"slate"),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]}),n(e.detected)]},s))})}),(e.sensitiveInformationPolicy.regexes?.length??0)>0&&(0,t.jsx)(o,{title:"Custom Regexes",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.regexes.map((e,s)=>(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-2 bg-gray-50 rounded gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:e.name??"regex"}),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.regex})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[n(e.detected),e.match&&(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]})]},s))})})]}),e.topicPolicy?.topics?.length?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Topic Policy"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.topicPolicy.topics.map((e,s)=>(0,t.jsx)("div",{className:"px-3 py-1.5 bg-gray-50 rounded-md text-xs",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:e.name??"topic"}),e.type&&i(e.type,"slate"),n(e.detected)]})},s))})]}):null,e.invocationMetrics&&(0,t.jsx)(o,{title:"Invocation Metrics",defaultOpen:!1,children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d,{label:"Latency (ms)",children:e.invocationMetrics.guardrailProcessingLatency??"—"}),(0,t.jsx)(d,{label:"Coverage:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.invocationMetrics.guardrailCoverage?.textCharacters&&i(`text ${e.invocationMetrics.guardrailCoverage.textCharacters.guarded??0}/${e.invocationMetrics.guardrailCoverage.textCharacters.total??0}`,"blue"),e.invocationMetrics.guardrailCoverage?.images&&i(`images ${e.invocationMetrics.guardrailCoverage.images.guarded??0}/${e.invocationMetrics.guardrailCoverage.images.total??0}`,"blue")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(d,{label:"Usage:",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.invocationMetrics.usage&&Object.entries(e.invocationMetrics.usage).map(([e,s])=>"number"==typeof s?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[e,": ",s]},e):null)})})})]})}),e.automatedReasoningPolicy?.findings?.length?(0,t.jsx)(o,{title:"Automated Reasoning Findings",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.automatedReasoningPolicy.findings.map((e,s)=>(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-2 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)},s))})}):null]},s)})}):null,(0,t.jsx)(o,{title:"Raw Bedrock Guardrail Response",defaultOpen:!1,children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)})})]})},m=(e,s="slate")=>(0,t.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block ${{green:"bg-green-100 text-green-800",red:"bg-red-100 text-red-800",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-100 text-slate-800",amber:"bg-amber-100 text-amber-800"}[s]}`,children:e}),u=({title:e,count:a,defaultOpen:l=!0,children:r})=>{let[i,n]=(0,s.useState)(l);return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>n(e=>!e),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${i?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h5",{className:"font-medium",children:[e," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]})}),i&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:r})]})},p=({label:e,children:s,mono:a})=>(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:e}),(0,t.jsx)("span",{className:a?"font-mono text-sm break-all":"",children:s})]}),h=({response:e})=>{if(!e||"string"==typeof e)return"string"==typeof e&&e?(0,t.jsx)("div",{className:"bg-white rounded-lg border border-red-200 p-4",children:(0,t.jsxs)("div",{className:"text-red-800",children:[(0,t.jsx)("h5",{className:"font-medium mb-2",children:"Error"}),(0,t.jsx)("p",{className:"text-sm",children:e})]})}):null;let s=Array.isArray(e)?e:[];if(0===s.length)return(0,t.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:(0,t.jsx)("div",{className:"text-gray-600 text-sm",children:"No detections found"})});let a=s.filter(e=>"pattern"===e.type),l=s.filter(e=>"blocked_word"===e.type),r=s.filter(e=>"category_keyword"===e.type),i=s.filter(e=>"BLOCK"===e.action).length,n=s.filter(e=>"MASK"===e.action).length,o=s.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(p,{label:"Total Detections:",children:(0,t.jsx)("span",{className:"font-semibold",children:o})}),(0,t.jsx)(p,{label:"Actions:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[i>0&&m(`${i} blocked`,"red"),n>0&&m(`${n} masked`,"blue"),0===i&&0===n&&m("passed","green")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(p,{label:"By Type:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[a.length>0&&m(`${a.length} patterns`,"slate"),l.length>0&&m(`${l.length} keywords`,"slate"),r.length>0&&m(`${r.length} categories`,"slate")]})})})]})}),a.length>0&&(0,t.jsx)(u,{title:"Patterns Matched",count:a.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:a.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Pattern:",children:e.pattern_name||"unknown"})}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Action:",children:m(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),l.length>0&&(0,t.jsx)(u,{title:"Blocked Words Detected",count:l.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:l.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(p,{label:"Keyword:",mono:!0,children:e.keyword||"unknown"}),e.description&&(0,t.jsx)(p,{label:"Description:",children:e.description})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Action:",children:m(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),r.length>0&&(0,t.jsx)(u,{title:"Category Keywords Detected",count:r.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:r.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(p,{label:"Category:",children:e.category||"unknown"}),(0,t.jsx)(p,{label:"Keyword:",mono:!0,children:e.keyword||"unknown"}),e.severity&&(0,t.jsx)(p,{label:"Severity:",children:m(e.severity,"high"===e.severity?"red":"medium"===e.severity?"amber":"slate")})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Action:",children:m(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),(0,t.jsx)(u,{title:"Raw Detection Data",defaultOpen:!1,children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(s,null,2)})})]})};var g=e.i(764205);let f=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"7",stroke:"#16A34A",strokeWidth:"1.5",fill:"#F0FDF4"}),(0,t.jsx)("path",{d:"M5 8l2 2 4-4",stroke:"#16A34A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"7",stroke:"#DC2626",strokeWidth:"1.5",fill:"#FEF2F2"}),(0,t.jsx)("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"#DC2626",strokeWidth:"1.5",strokeLinecap:"round"})]}),j=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"animate-spin",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"#D1D5DB",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M8 2a6 6 0 0 1 6 6",stroke:"#6366F1",strokeWidth:"2",strokeLinecap:"round"})]}),b=({title:e,data:l,loading:r,error:i})=>{let[n,o]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg bg-white",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>o(!n),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r?(0,t.jsx)(j,{}):i?(0,t.jsx)(a.Tooltip,{title:i,children:(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"--"})}):l?.compliant?(0,t.jsx)(f,{}):(0,t.jsx)(y,{}),(0,t.jsx)("span",{className:"font-medium text-sm text-gray-900",children:e})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!r&&!i&&l&&(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold uppercase ${l.compliant?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,children:l.compliant?"COMPLIANT":"NON-COMPLIANT"}),i&&(0,t.jsx)("span",{className:"px-2 py-0.5 rounded text-[11px] font-medium bg-gray-100 text-gray-500 border border-gray-200",children:"UNAVAILABLE"}),(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:`transition-transform ${n?"rotate-180":""}`,children:(0,t.jsx)("path",{d:"M6 8l4 4 4-4",stroke:"#6B7280",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-gray-100 px-4 py-3",children:[r&&(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Checking compliance..."}),i&&(0,t.jsx)("p",{className:"text-sm text-red-600",children:i}),l&&(0,t.jsx)("div",{className:"space-y-2",children:l.checks.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:e.passed?(0,t.jsx)(f,{}):(0,t.jsx)(y,{})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:e.check_name}),(0,t.jsx)("span",{className:"text-[10px] font-mono text-gray-400",children:e.article})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:e.detail})]})]},s))})]})]})},v=({accessToken:e,logEntry:a})=>{let[l,r]=(0,s.useState)(null),[i,n]=(0,s.useState)(null),[o,d]=(0,s.useState)(!1),[c,x]=(0,s.useState)(!1),[m,u]=(0,s.useState)(null),[p,h]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(!e||!a.request_id)return;let t={request_id:a.request_id,user_id:a.user,model:a.model,timestamp:a.startTime,guardrail_information:a.metadata?.guardrail_information};d(!0),u(null),(0,g.checkEuAiActCompliance)(e,t).then(r).catch(e=>u(e.message||"Failed to check EU AI Act compliance")).finally(()=>d(!1)),x(!0),h(null),(0,g.checkGdprCompliance)(e,t).then(n).catch(e=>h(e.message||"Failed to check GDPR compliance")).finally(()=>x(!1))},[e,a]),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4",children:"Regulatory Compliance"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(b,{title:"EU AI Act",data:l,loading:o,error:m}),(0,t.jsx)(b,{title:"GDPR",data:i,loading:c,error:p})]})]})},_=new Set(["presidio","bedrock","litellm_content_filter"]),N=(e,t)=>{if(null==e)return!1;if("string"==typeof e)return e===t;if(Array.isArray(e))return e.includes(t);if("object"==typeof e&&"default"in e){let s=e.default;if("string"==typeof s)return s===t;if(Array.isArray(s))return s.some(e=>"string"==typeof e&&e===t)}return!1},w=e=>Object.values(e.masked_entity_count||{}).reduce((e,t)=>e+("number"==typeof t?t:0),0),S=e=>"success"===(e.guardrail_status??"").toLowerCase(),k=e=>e.policy_template||e.guardrail_name,T=()=>(0,t.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,t.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#EEF2FF"}),(0,t.jsx)("path",{d:"M20 10l8 4v6c0 5.25-3.4 10.15-8 11.5C15.4 30.15 12 25.25 12 20v-6l8-4z",stroke:"#6366F1",strokeWidth:"1.5",fill:"none"}),(0,t.jsx)("path",{d:"M16 20l3 3 5-6",stroke:"#6366F1",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}),C=({className:e})=>(0,t.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",className:e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"10",stroke:"#16A34A",strokeWidth:"1.5",fill:"#F0FDF4"}),(0,t.jsx)("path",{d:"M7 11l3 3 5-6",stroke:"#16A34A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),L=({className:e})=>(0,t.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",className:e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"10",stroke:"#DC2626",strokeWidth:"1.5",fill:"#FEF2F2"}),(0,t.jsx)("path",{d:"M8 8l6 6M14 8l-6 6",stroke:"#DC2626",strokeWidth:"1.5",strokeLinecap:"round"})]}),E=()=>(0,t.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"10",stroke:"#3B82F6",strokeWidth:"1.5",fill:"#EFF6FF"}),(0,t.jsx)("path",{d:"M9 7.5l6 3.5-6 3.5V7.5z",fill:"#3B82F6"})]}),M=()=>(0,t.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:(0,t.jsx)("circle",{cx:"11",cy:"11",r:"5",fill:"#9CA3AF"})}),A=({expanded:e})=>(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:`transition-transform ${e?"rotate-180":""}`,children:(0,t.jsx)("path",{d:"M6 8l4 4 4-4",stroke:"#6B7280",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),D=()=>(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,t.jsx)("path",{d:"M8 2v8m0 0l-3-3m3 3l3-3M3 12h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),R=({matchDetails:e})=>e&&0!==e.length?(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsxs)("h5",{className:"text-sm font-medium mb-2 text-gray-700",children:["Match Details (",e.length,")"]}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b text-left text-gray-500",children:[(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Method"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Action"}),(0,t.jsx)("th",{className:"pb-2 font-medium",children:"Detail"})]})}),(0,t.jsx)("tbody",{children:e.map((e,s)=>(0,t.jsxs)("tr",{className:"border-b border-gray-100",children:[(0,t.jsx)("td",{className:"py-2 pr-4",children:e.type}),(0,t.jsx)("td",{className:"py-2 pr-4",children:(0,t.jsx)("span",{className:"px-2 py-0.5 bg-slate-100 text-slate-700 rounded text-xs",children:e.detection_method??"-"})}),(0,t.jsx)("td",{className:"py-2 pr-4",children:(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${"BLOCK"===e.action_taken?"bg-red-100 text-red-800":"bg-blue-50 text-blue-700"}`,children:e.action_taken??"-"})}),(0,t.jsxs)("td",{className:"py-2 font-mono text-xs text-gray-600 break-all",children:[e.category?`[${e.category}] `:"",e.snippet??"-"]})]},s))})]})})]}):null,O=({response:e})=>{let[a,l]=(0,s.useState)(!1);return(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>l(!a),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(A,{expanded:a}),(0,t.jsx)("h5",{className:"font-medium text-sm ml-1",children:"Raw Guardrail Response"})]})}),a&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)})})]})})},I=({entries:e})=>{let a=(0,s.useMemo)(()=>[...e].sort((e,t)=>(e.start_time??0)-(t.start_time??0)),[e]),l=(0,s.useMemo)(()=>{if(0===a.length)return[];let e=a[0].start_time,t=[];t.push({type:"request",label:"Request received",offsetMs:0});let s=a.filter(e=>N(e.guardrail_mode,"pre_call")),l=a.filter(e=>N(e.guardrail_mode,"post_call")||N(e.guardrail_mode,"logging_only")),r=a.filter(e=>N(e.guardrail_mode,"during_call"));for(let a of s){let s=Math.round((a.end_time-e)*1e3);t.push({type:"guardrail",label:`Pre-call guardrail: ${k(a)}`,offsetMs:s,status:S(a)?"PASSED":"FAILED",isSuccess:S(a)})}let i=s.length>0?Math.max(...s.map(e=>e.end_time)):e,n=Math.round((((l.length>0?Math.min(...l.map(e=>e.start_time)):void 0)??i+1)-e)*1e3);for(let s of(t.push({type:"llm",label:"LLM call",offsetMs:n}),r)){let a=Math.round((s.end_time-e)*1e3);t.push({type:"guardrail",label:`During-call guardrail: ${k(s)}`,offsetMs:a,status:S(s)?"PASSED":"FAILED",isSuccess:S(s)})}for(let s of l){let a=Math.round((s.end_time-e)*1e3);t.push({type:"guardrail",label:`Post-call guardrail: ${k(s)}`,offsetMs:a,status:S(s)?"PASSED":"FAILED",isSuccess:S(s)})}let o=Math.round((Math.max(...a.map(e=>e.end_time))-e)*1e3)+1;return t.push({type:"response",label:"Response returned",offsetMs:o}),t},[a]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4",children:"Request Lifecycle"}),(0,t.jsx)("div",{className:"relative",children:l.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-start gap-3 relative",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:"request"===e.type||"response"===e.type?(0,t.jsx)(M,{}):"llm"===e.type?(0,t.jsx)(E,{}):e.isSuccess?(0,t.jsx)(C,{}):(0,t.jsx)(L,{})}),s{let l,i,[n,o]=(0,s.useState)(!1),d=S(e),c=w(e),m=k(e),u=(l=Math.round(1e3*e.duration),`${l}ms`),p=null==(i=(e=>{if(null==e)return null;if("string"==typeof e)return e;if(Array.isArray(e)){let t=e[0];return"string"==typeof t?t:null}if("object"==typeof e&&"default"in e){let t=e.default;if("string"==typeof t)return t;if(Array.isArray(t)){let e=t[0];return"string"==typeof e?e:null}}return null})(e.guardrail_mode))||""===i?"—":i.replace(/_/g,"-").toUpperCase(),g=(e=>{if(!S(e))return null;if(null!=e.risk_score)return e.risk_score;let t=w(e),s=e.patterns_checked??0,a=e.confidence_score??0;if(0===s&&0===a)return 0;let l=7*(s>0?t/s:0)+3*a;return t>0&&l<2&&(l=2),Math.min(10,Math.round(10*l)/10)})(e),f=e.guardrail_provider??"presidio",y=e.guardrail_response,j=Array.isArray(y)?y:[],b="bedrock"!==f||null===y||"object"!=typeof y||Array.isArray(y)?void 0:y,v=null!=e.patterns_checked?`${c}/${e.patterns_checked} matched`:c>0?`${c} matched`:null;return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg bg-white",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>o(!n),children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:d?(0,t.jsx)(C,{}):(0,t.jsx)(L,{})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"font-semibold text-gray-900 text-sm truncate",children:m}),(0,t.jsx)("span",{className:"px-2 py-0.5 border border-blue-200 bg-blue-50 text-blue-700 rounded text-[11px] font-semibold uppercase flex-shrink-0",children:p}),(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold uppercase flex-shrink-0 ${d?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,children:d?"PASSED":"FAILED"}),v&&(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-[11px] font-medium flex-shrink-0 ${0===c?"bg-green-50 text-green-700 border border-green-200":"bg-amber-50 text-amber-700 border border-amber-200"}`,children:v}),null!=e.confidence_score&&(0,t.jsxs)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 border border-gray-200 rounded text-[11px] font-medium flex-shrink-0",children:[(100*e.confidence_score).toFixed(0),"% conf"]}),null!=g&&d&&(0,t.jsx)(a.Tooltip,{title:`Risk score: ${g}/10`,children:(0,t.jsxs)("span",{className:`px-2 py-0.5 border rounded text-[11px] font-semibold flex-shrink-0 ${g<=3?"text-green-600 bg-green-50 border-green-200":g<=6?"text-amber-600 bg-amber-50 border-amber-200":"text-red-600 bg-red-50 border-red-200"}`,children:["Risk ",g,"/10"]})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,t.jsx)("span",{className:"text-sm text-gray-500 font-mono",children:u}),e.detection_method&&(0,t.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 border border-gray-200 rounded text-[11px] font-medium",children:e.detection_method.split(",")[0].trim()}),(0,t.jsx)(A,{expanded:n})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-gray-100 px-4 py-3",children:[e.classification&&(0,t.jsxs)("div",{className:"mb-3 bg-gray-50 rounded-lg p-3 space-y-1",children:[(0,t.jsx)("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:"Classification"}),e.classification.category&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Category:"}),(0,t.jsx)("span",{children:e.classification.category})]}),e.classification.article_reference&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Reference:"}),(0,t.jsx)("span",{className:"font-mono",children:e.classification.article_reference})]}),null!=e.classification.confidence&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Confidence:"}),(0,t.jsxs)("span",{children:[(100*e.classification.confidence).toFixed(0),"%"]})]}),e.classification.reason&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Reason:"}),(0,t.jsx)("span",{children:e.classification.reason})]})]}),e.match_details&&e.match_details.length>0&&(0,t.jsx)(R,{matchDetails:e.match_details}),c>0&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:"Masked Entities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(e.masked_entity_count||{}).map(([e,s])=>(0,t.jsxs)("span",{className:"px-2 py-1 bg-blue-50 text-blue-700 rounded text-xs font-medium",children:[e,": ",s]},e))})]}),"presidio"===f&&j.length>0&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(r,{entities:j})}),"bedrock"===f&&b&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(x,{response:b})}),"litellm_content_filter"===f&&y&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(h,{response:y})}),f&&!_.has(f)&&y&&(0,t.jsx)(O,{response:y})]})]})};e.s(["default",0,({data:e,accessToken:a,logEntry:l})=>{let r=(0,s.useMemo)(()=>Array.isArray(e)?e.filter(e=>!!e):e?[e]:[],[e]),i=r.filter(S).length,n=i===r.length,o=(0,s.useMemo)(()=>Math.round(1e3*r.reduce((e,t)=>e+(t.duration??0),0)),[r]);return((0,s.useMemo)(()=>Array.from(new Set(r.map(e=>e.policy_template).filter(Boolean))),[r]),0===r.length)?null:(0,t.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm w-full max-w-full overflow-hidden mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(T,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Guardrails & Policy Compliance"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-500",children:[r.length," guardrail",1!==r.length?"s":""," evaluated"]}),(0,t.jsx)("span",{className:"text-gray-300",children:"|"}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold ${n?"bg-green-50 text-green-700 border border-green-200":"bg-red-50 text-red-700 border border-red-200"}`,children:[n?(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,t.jsx)("path",{d:"M3 6l2.5 2.5L9 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null,i," Passed"]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsx)("div",{className:"text-right",children:(0,t.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:["Total: ",o,"ms overhead"]})}),(0,t.jsxs)("button",{onClick:()=>{let e=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download=`guardrail-compliance-log-${new Date().toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(t)},className:"inline-flex items-center gap-2 px-4 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(D,{}),"Export Compliance Log"]})]})]}),a&&l&&(0,t.jsx)("div",{className:"px-6 py-4 border-b border-gray-100",children:(0,t.jsx)(v,{accessToken:a,logEntry:l})}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-6 py-5",children:(0,t.jsx)(I,{entries:r})}),(0,t.jsxs)("div",{className:"px-6 py-5",children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4",children:"Evaluation Details"}),(0,t.jsx)("div",{className:"space-y-3",children:r.map((e,s)=>(0,t.jsx)(z,{entry:e},`${e.guardrail_name??"guardrail"}-${s}`))})]})]})]})}],517442)},93648,245767,313793,291950,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(560445),l=e.i(207082),r=e.i(135214),i=e.i(500330),n=e.i(871943),o=e.i(360820),d=e.i(94629),c=e.i(152990),x=e.i(682830),m=e.i(269200),u=e.i(942232),p=e.i(977572),h=e.i(427612),g=e.i(64848),f=e.i(496020),y=e.i(592968);function j({keys:e,totalCount:a,isLoading:l,isFetching:r,pageIndex:j,pageSize:b,onPageChange:v}){let[_,N]=(0,s.useState)([{id:"deleted_at",desc:!0}]),[w,S]=(0,s.useState)({pageIndex:j,pageSize:b});s.default.useEffect(()=>{S({pageIndex:j,pageSize:b})},[j,b]);let k=[{id:"token",accessorKey:"token",header:"Key ID",size:150,maxSize:250,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:s||"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block max-w-[200px]",children:s??"-"})})}},{id:"team_alias",accessorKey:"team_alias",header:"Team Alias",size:120,maxSize:180,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>(0,t.jsx)("span",{className:"block max-w-[140px]",children:(0,i.formatNumberWithCommas)(e.getValue(),4)})},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[150px]",children:null===s?"Unlimited":`$${(0,i.formatNumberWithCommas)(s)}`})}},{id:"user_email",accessorKey:"user_email",header:"User Email",size:160,maxSize:250,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block max-w-[250px]",children:s??"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:120,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[200px]",children:s||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,maxSize:140,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:120,maxSize:180,cell:e=>{let s=e.row.original.created_by;return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let s=e.row.original.deleted_at;return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let s=e.row.original.deleted_by;return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})})}}],T=(0,c.useReactTable)({data:e,columns:k,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:_,pagination:w},onSortingChange:N,onPaginationChange:e=>{let t="function"==typeof e?e(w):e;S(t),v(t.pageIndex)},getCoreRowModel:(0,x.getCoreRowModel)(),getSortedRowModel:(0,x.getSortedRowModel)(),getPaginationRowModel:(0,x.getPaginationRowModel)(),enableSorting:!0,manualSorting:!1,manualPagination:!0,pageCount:Math.ceil(a/b)}),{pageIndex:C}=T.getState().pagination,L=C*b+1,E=Math.min((C+1)*b,a),M=`${L} - ${E}`;return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[l||r?(0,t.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,t.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",M," of ",a," results"]}),(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[l||r?(0,t.jsx)("span",{className:"text-sm text-gray-700",children:"Loading..."}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",C+1," of ",T.getPageCount()]}),(0,t.jsx)("button",{onClick:()=>T.previousPage(),disabled:l||r||!T.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,t.jsx)("button",{onClick:()=>T.nextPage(),disabled:l||r||!T.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(m.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:T.getCenterTotalSize()},children:[(0,t.jsx)(h.TableHead,{children:T.getHeaderGroups().map(e=>(0,t.jsx)(f.TableRow,{children:e.headers.map(e=>(0,t.jsx)(g.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,c.flexRender)(e.column.columnDef.header,e.getContext())}),(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(o.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(n.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(d.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${T.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(u.TableBody,{children:l||r?(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:k.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading keys..."})})})}):e.length>0?T.getRowModel().rows.map(e=>(0,t.jsx)(f.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(p.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,c.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:k.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No deleted keys found"})})})})})]})})})})]})})}function b(){let{premiumUser:e}=(0,r.default)(),[i,n]=(0,s.useState)(0),[o]=(0,s.useState)(50),{data:d,isPending:c,isFetching:x}=(0,l.useDeletedKeys)(i+1,o);return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,t.jsx)(a.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted key auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,t.jsx)(j,{keys:d?.keys||[],totalCount:d?.total_count||0,isLoading:c,isFetching:x,pageIndex:i,pageSize:o,onPageChange:n})]})}e.s(["default",()=>b],93648);var v=e.i(785242),_=e.i(389083),N=e.i(599724),w=e.i(355619);function S({teams:e,isLoading:a,isFetching:l}){let[r,j]=(0,s.useState)([{id:"deleted_at",desc:!0}]),b=[{id:"team_alias",accessorKey:"team_alias",header:"Team Name",size:150,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[200px]",children:s||"-"})})}},{id:"team_id",accessorKey:"team_id",header:"Team ID",size:150,maxSize:250,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:s||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created",size:120,maxSize:140,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>{let s=e.row.original.spend;return(0,t.jsx)("span",{className:"block max-w-[140px]",children:void 0!==s?(0,i.formatNumberWithCommas)(s,4):"-"})}},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[150px]",children:null==s?"No limit":`$${(0,i.formatNumberWithCommas)(s)}`})}},{id:"models",accessorKey:"models",header:"Models",size:200,maxSize:300,cell:e=>{let s=e.getValue();return Array.isArray(s)&&0!==s.length?(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[300px]",children:[s.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,t.jsx)(_.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})},s):(0,t.jsx)(_.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(N.Text,{children:e.length>30?`${(0,w.getModelDisplayName)(e).slice(0,30)}...`:(0,w.getModelDisplayName)(e)})},s)),s.length>3&&(0,t.jsx)(_.Badge,{size:"xs",color:"gray",children:(0,t.jsxs)(N.Text,{children:["+",s.length-3," ",s.length-3==1?"more model":"more models"]})})]}):(0,t.jsx)(_.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})})}},{id:"organization_id",accessorKey:"organization_id",header:"Organization",size:150,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[200px]",children:s||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let s=e.row.original.deleted_at;return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let s=e.row.original.deleted_by;return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})})}}],v=(0,c.useReactTable)({data:e,columns:b,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:r},onSortingChange:j,getCoreRowModel:(0,x.getCoreRowModel)(),getSortedRowModel:(0,x.getSortedRowModel)(),enableSorting:!0,manualSorting:!1});return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between w-full mb-4",children:a||l?(0,t.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,t.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",e.length," ",1===e.length?"team":"teams"]})}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(m.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:v.getCenterTotalSize()},children:[(0,t.jsx)(h.TableHead,{children:v.getHeaderGroups().map(e=>(0,t.jsx)(f.TableRow,{children:e.headers.map(e=>(0,t.jsx)(g.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,c.flexRender)(e.column.columnDef.header,e.getContext())}),(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(o.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(n.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(d.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${v.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(u.TableBody,{children:a||l?(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:b.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading teams..."})})})}):e.length>0?v.getRowModel().rows.map(e=>(0,t.jsx)(f.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(p.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,c.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:b.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No deleted teams found"})})})})})]})})})})]})})}function k(){let{premiumUser:e}=(0,r.default)(),{data:s,isPending:l,isFetching:i}=(0,v.useDeletedTeams)(1,100);return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,t.jsx)(a.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted team auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,t.jsx)(S,{teams:s||[],isLoading:l,isFetching:i})]})}e.s(["default",()=>k],245767);var T=e.i(663435);e.s(["default",0,({value:e,onChange:s})=>(0,t.jsx)(T.default,{value:e,onChange:s})],313793);var C=e.i(625901),L=e.i(56456),E=e.i(152473),M=e.i(199133),A=e.i(770914);let{Text:D}=e.i(898586).Typography;e.s(["PaginatedModelSelect",0,({value:e,onChange:a,placeholder:l="Select a model",style:r,pageSize:i=50,allowClear:n=!0,disabled:o=!1})=>{let[d,c]=(0,s.useState)(""),[x,m]=(0,E.useDebouncedState)("",{wait:300}),{data:u,fetchNextPage:p,hasNextPage:h,isFetchingNextPage:g,isLoading:f}=(0,C.useInfiniteModelInfo)(i,x||void 0),y=(0,s.useMemo)(()=>{if(!u?.pages)return[];let e=new Set,t=[];for(let s of u.pages)for(let a of s.data){let s=a.model_info?.id??"",l=a.model_name??"";!s||e.has(s)||(e.add(s),t.push({label:l?`${l} (${s})`:s,value:s,modelName:l,modelId:s}))}return t},[u]);return(0,t.jsx)(M.Select,{value:e||void 0,onChange:e=>{let t="string"==typeof e?e:Array.isArray(e)?e[0]??"":"";a?.(t)},placeholder:l,style:{width:"100%",...r},allowClear:n,disabled:o,showSearch:!0,filterOption:!1,onSearch:e=>{c(e),m(e)},searchValue:d,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&h&&!g&&p()},loading:f,notFoundContent:f?(0,t.jsx)(L.LoadingOutlined,{spin:!0}):"No models found",options:y,optionRender:e=>{let{modelName:s,modelId:a}=e.data;return(0,t.jsx)(t.Fragment,{children:s?(0,t.jsxs)(A.Space,{direction:"vertical",children:[(0,t.jsxs)(A.Space,{direction:"horizontal",children:[(0,t.jsx)(D,{strong:!0,children:"Model name:"}),(0,t.jsx)(D,{ellipsis:!0,children:s})]}),(0,t.jsxs)(D,{ellipsis:!0,type:"secondary",children:["Model ID: ",a]})]}):(0,t.jsxs)(D,{ellipsis:!0,type:"secondary",children:["Model ID: ",a]})})},popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,g&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(L.LoadingOutlined,{spin:!0})})]})})}],291950)},95684,e=>{"use strict";var t=e.i(165370);e.s(["Pagination",()=>t.default])},942161,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(266027),l=e.i(619273),r=e.i(291542),i=e.i(262218),n=e.i(311451),o=e.i(199133),d=e.i(464571),c=e.i(95684),x=e.i(482725),m=e.i(91979),u=e.i(56456),p=e.i(166540),h=e.i(764205),g=e.i(608856),f=e.i(898586),y=e.i(149192),j=e.i(166406),b=e.i(492030),v=e.i(304911);let{Text:_}=f.Typography,N={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},w={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function S({label:e,value:a}){let[l,r]=(0,s.useState)(!1),i=(0,s.useCallback)(async()=>{try{let e=JSON.stringify(a,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t)}r(!0),setTimeout(()=>r(!1),2e3)}catch(e){console.error("Copy failed:",e)}},[a]);return(0,t.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b bg-gray-50",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e}),(0,t.jsx)("button",{onClick:i,className:"p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors",title:"Copy JSON",children:l?(0,t.jsx)(b.CheckOutlined,{className:"text-green-600"}):(0,t.jsx)(j.CopyOutlined,{})})]}),(0,t.jsx)("pre",{className:"p-3 bg-white text-xs font-mono overflow-auto max-h-96 whitespace-pre-wrap break-all m-0",children:JSON.stringify(a,null,2)})]})}function k({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 w-36 shrink-0",children:e}),(0,t.jsx)("span",{className:"text-xs text-gray-900 break-all",children:s})]})}function T({log:e}){let{action:s,table_name:a,before_value:l,updated_values:r}=e,i="LiteLLM_VerificationToken"===a,n="updated"===s||"rotated"===s,o=l,d=r;if(n&&l&&r){let e={},t={};new Set([...Object.keys(l),...Object.keys(r)]).forEach(s=>{JSON.stringify(l[s])!==JSON.stringify(r[s])&&(s in l&&(e[s]=l[s]),s in r&&(t[s]=r[s]))}),Object.keys(l).forEach(s=>{s in r||s in e||(e[s]=l[s],t[s]=void 0)}),Object.keys(r).forEach(s=>{s in l||s in t||(t[s]=r[s],e[s]=void 0)}),o=Object.keys(e).length>0?e:{note:"No differing fields detected"},d=Object.keys(t).length>0?t:{note:"No differing fields detected"}}let c=(e,s)=>{if(!s||0===Object.keys(s).length)return(0,t.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 italic m-0",children:"N/A"})]});if(i&&n){let a=["token","spend","max_budget"];if(Object.keys(s).every(e=>a.includes(e))&&!("note"in s))return(0,t.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,t.jsxs)("div",{className:"px-3 py-3 space-y-1 text-xs",children:[void 0!==s.token&&(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Token:"})," ",s.token??"N/A"]}),void 0!==s.spend&&(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Spend:"})," $",Number(s.spend).toFixed(6)]}),void 0!==s.max_budget&&(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Max Budget:"})," $",Number(s.max_budget).toFixed(6)]})]})]})}return(0,t.jsx)(S,{label:e,value:s})};return(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[c("Before",o),c("After",d)]})}function C({open:e,onClose:s,log:a}){if(!a)return null;let l=N[a.table_name]??a.table_name,r=w[a.action]??"default";return(0,t.jsxs)(g.Drawer,{placement:"right",width:"60%",open:e,onClose:s,closable:!1,mask:!0,maskClosable:!0,styles:{body:{padding:0,display:"flex",flexDirection:"column"},header:{display:"none"}},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b bg-white shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(i.Tag,{color:r,className:"capitalize m-0",children:a.action}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:p.default.utc(a.updated_at).local().format("MMM D, YYYY HH:mm:ss")})]}),(0,t.jsx)("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500","aria-label":"Close",children:(0,t.jsx)(y.CloseOutlined,{})})]}),(0,t.jsxs)("div",{className:"px-6 py-5",children:[(0,t.jsxs)("div",{className:"bg-gray-50 border rounded-lg p-4 mb-5",children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-gray-700 mb-2 uppercase tracking-wide",children:"Details"}),(0,t.jsx)(k,{label:"Table",value:l}),(0,t.jsx)(k,{label:"Object ID",value:(0,t.jsx)(_,{copyable:!0,className:"font-mono text-xs",children:a.object_id})}),(0,t.jsx)(k,{label:"Changed By",value:(0,t.jsx)(v.default,{userId:a.changed_by})}),(0,t.jsx)(k,{label:"API Key (Hash)",value:a.changed_by_api_key?(0,t.jsx)(_,{copyable:!0,className:"font-mono text-xs break-all",children:a.changed_by_api_key}):"—"})]}),(0,t.jsx)(T,{log:a})]})]})}let{Search:L}=n.Input,E={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},M={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function A({userID:e,userRole:n,token:g,accessToken:f,isActive:y,premiumUser:j}){let[b,_]=(0,s.useState)(1),[N,w]=(0,s.useState)(""),[S,k]=(0,s.useState)(""),[T,A]=(0,s.useState)(""),[D,R]=(0,s.useState)(""),[O,I]=(0,s.useState)(void 0),[z,P]=(0,s.useState)(void 0),[B,F]=(0,s.useState)(null),[H,q]=(0,s.useState)(!1),Y=(0,a.useQuery)({queryKey:["audit_logs",b,50,N,S,T,D,O,z],queryFn:async()=>f&&g&&n&&e?(0,h.uiAuditLogsCall)({accessToken:f,page:b,page_size:50,params:{object_id:N||void 0,changed_by:S||void 0,object_key_hash:T||void 0,object_team_id:D||void 0,action:O||void 0,table_name:z||void 0,sort_by:"updated_at",sort_order:"desc"}}):{audit_logs:[],total:0,page:1,page_size:50,total_pages:0},enabled:!!f&&!!g&&!!n&&!!e&&y,placeholderData:l.keepPreviousData}),K=[{title:"Timestamp",dataIndex:"updated_at",key:"updated_at",width:200,render:e=>(0,t.jsx)("span",{className:"font-mono text-xs whitespace-nowrap",children:p.default.utc(e).local().format("MMM D, YYYY HH:mm:ss")})},{title:"Action",dataIndex:"action",key:"action",width:100,render:e=>(0,t.jsx)(i.Tag,{color:M[e]??"default",className:"capitalize",children:e})},{title:"Table",dataIndex:"table_name",key:"table_name",width:130,render:e=>E[e]??e},{title:"Object ID",dataIndex:"object_id",key:"object_id",render:e=>(0,t.jsx)("span",{className:"font-mono text-xs",children:e})},{title:"Changed By",dataIndex:"changed_by",key:"changed_by",width:200,render:e=>(0,t.jsx)(v.default,{userId:e})},{title:"API Key (Hash)",dataIndex:"changed_by_api_key",key:"changed_by_api_key",width:140,render:e=>e?(0,t.jsxs)("span",{className:"font-mono text-xs",children:[e.slice(0,12),"…"]}):"—"}];if(!j)return(0,t.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,t.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,t.jsx)("p",{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)("p",{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:"../ui/assets/audit-logs-preview.png",alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{e.target.style.display="none"}})]});let $=Y.data?.audit_logs??[],U=Y.data?.total??0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Audit Logs"})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(L,{placeholder:"Object ID",allowClear:!0,style:{width:200},onSearch:e=>{w(e),_(1)},onChange:e=>{e.target.value||(w(""),_(1))}}),(0,t.jsx)(L,{placeholder:"Changed By",allowClear:!0,style:{width:180},onSearch:e=>{k(e),_(1)},onChange:e=>{e.target.value||(k(""),_(1))}}),(0,t.jsx)(L,{placeholder:"Team ID",allowClear:!0,style:{width:180},onSearch:e=>{R(e),_(1)},onChange:e=>{e.target.value||(R(""),_(1))}}),(0,t.jsx)(L,{placeholder:"Key Hash",allowClear:!0,style:{width:180},onSearch:e=>{A(e),_(1)},onChange:e=>{e.target.value||(A(""),_(1))}}),(0,t.jsx)(o.Select,{placeholder:"All Actions",allowClear:!0,style:{width:140},options:[{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}],onChange:e=>{I(e),_(1)}}),(0,t.jsx)(o.Select,{placeholder:"All Tables",allowClear:!0,style:{width:150},options:[{label:"Keys",value:"LiteLLM_VerificationToken"},{label:"Teams",value:"LiteLLM_TeamTable"},{label:"Users",value:"LiteLLM_UserTable"},{label:"Organizations",value:"LiteLLM_OrganizationTable"},{label:"Models",value:"LiteLLM_ProxyModelTable"}],onChange:e=>{P(e),_(1)}}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsx)(d.Button,{icon:(0,t.jsx)(m.ReloadOutlined,{spin:Y.isFetching}),onClick:()=>Y.refetch(),disabled:Y.isFetching}),(0,t.jsx)(c.Pagination,{current:b,pageSize:50,total:U,showTotal:e=>`${e} total`,showSizeChanger:!1,size:"small",onChange:e=>_(e)})]})]})]}),(0,t.jsx)(r.Table,{columns:K,dataSource:$,rowKey:"id",loading:{spinning:Y.isLoading,indicator:(0,t.jsx)(x.Spin,{indicator:(0,t.jsx)(u.LoadingOutlined,{spin:!0}),size:"small"})},size:"small",pagination:!1,onRow:e=>({onClick:()=>{F(e),q(!0)},style:{cursor:"pointer"}})})]}),(0,t.jsx)(C,{open:H,onClose:()=>q(!1),log:B})]})}e.s(["default",()=>A],942161)},307582,e=>{"use strict";var t=e.i(843476);e.s(["TimeCell",0,({utcTime:e})=>(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:(e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}})(e)})])},97859,e=>{"use strict";e.s(["AGENT_CALL_TYPES",0,["asend_message"],"ERROR_CODE_OPTIONS",0,[{label:"400 - Bad Request",value:"400"},{label:"401 - Invalid Authentication",value:"401"},{label:"403 - Permission Denied",value:"403"},{label:"404 - Not Found",value:"404"},{label:"408 - Request Timeout",value:"408"},{label:"422 - Unprocessable Entity",value:"422"},{label:"429 - Rate Limited",value:"429"},{label:"500 - Internal Server Error",value:"500"},{label:"502 - Bad Gateway",value:"502"},{label:"503 - Service Unavailable",value:"503"},{label:"529 - Overloaded",value:"529"}],"MCP_CALL_TYPES",0,["call_mcp_tool","list_mcp_tools"],"QUICK_SELECT_OPTIONS",0,[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}]])},245099,e=>{"use strict";var t=e.i(843476),s=e.i(500330),a=(e.i(389083),e.i(994388)),l=e.i(592968);e.i(271645);var r=e.i(916925),i=e.i(446891),n=e.i(307582),o=e.i(97859);let d=({size:e=12})=>(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0 text-gray-400",children:(0,t.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3z"})}),c=({size:e=10})=>(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:(0,t.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),x=({size:e=12})=>(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[(0,t.jsx)("path",{d:"M12 8V4H8"}),(0,t.jsx)("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),(0,t.jsx)("path",{d:"M2 14h2"}),(0,t.jsx)("path",{d:"M20 14h2"}),(0,t.jsx)("path",{d:"M15 13v2"}),(0,t.jsx)("path",{d:"M9 13v2"})]}),m=({count:e})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(d,{}),null!=e?e:"LLM"]}),u=({count:e})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-amber-50 text-amber-700 border border-amber-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(c,{}),null!=e?e:"MCP"]}),p=({count:e})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-violet-50 text-violet-700 border border-violet-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(x,{}),null!=e?e:"Agent"]}),h=({label:e,field:s,sortBy:a,sortOrder:l,onSortChange:r})=>(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)(i.TableHeaderSortDropdown,{sortState:a===s&&l,onSortChange:e=>{!1===e?r("startTime","desc"):r(s,e)}})]}),g=e=>[{header:e?()=>(0,t.jsx)(h,{label:"Time",field:"startTime",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Time",accessorKey:"startTime",cell:e=>(0,t.jsx)(n.TimeCell,{utcTime:e.getValue()})},{header:"Type",id:"type",cell:e=>{let s=e.row.original,a=s.session_total_count||1,r=o.MCP_CALL_TYPES.includes(s.call_type),i=o.AGENT_CALL_TYPES.includes(s.call_type),n=s.session_llm_count??(r||i?0:a),h=s.session_agent_count??(i?a:0),g=s.session_mcp_count??(r?a:0);if(r)return(0,t.jsx)(u,{});if(i&&a<=1)return(0,t.jsx)(p,{});if(a<=1)return(0,t.jsx)(m,{});let f=(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(d,{}),(0,t.jsx)("span",{children:a}),h>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-blue-300",children:"·"}),(0,t.jsx)(x,{size:10})]}),g>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-blue-300",children:"·"}),(0,t.jsx)(c,{})]})]}),y=[n>0&&`${n} LLM`,h>0&&`${h} Agent`,g>0&&`${g} MCP`].filter(Boolean);return(0,t.jsx)(l.Tooltip,{title:y.join(" • "),children:f})}},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,t.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ${s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),r=e.row.original.onSessionClick;return(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||""),children:(0,t.jsx)(a.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>r?.(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||""),children:(0,t.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:e?()=>(0,t.jsx)(h,{label:"Cost",field:"spend",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Cost",accessorKey:"spend",cell:e=>{let a=e.row.original,r=a.mcp_tool_call_count||0,i=a.mcp_tool_call_spend||0;return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(l.Tooltip,{title:`$${String(e.getValue()||0)}`,children:(0,t.jsx)("span",{children:(0,s.getSpendString)(e.getValue()||0)})}),r>0&&i>0&&(0,t.jsxs)("span",{className:"text-[10px] text-amber-600",children:["incl. ",(0,s.getSpendString)(i)," from ",r," MCP"]})]})}},{header:e?()=>(0,t.jsx)(h,{label:"Duration (s)",field:"request_duration_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Duration (s)",accessorKey:"request_duration_ms",cell:e=>{let s=e.getValue();if(null==s)return(0,t.jsx)("span",{children:"-"});let a=(s/1e3).toFixed(2);return(0,t.jsx)(l.Tooltip,{title:`${s}ms`,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:a})})}},{header:e?()=>(0,t.jsx)(h,{label:"TTFT (s)",field:"ttft_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"TTFT (s)",accessorKey:"completionStartTime",cell:e=>{let s=e.row.original,a=e.getValue();if(!a||a===s.endTime)return(0,t.jsx)("span",{children:"-"});let r=new Date(a).getTime()-new Date(s.startTime).getTime();if(r<=0)return(0,t.jsx)("span",{children:"-"});let i=(r/1e3).toFixed(2);return(0,t.jsx)(l.Tooltip,{title:`${r}ms`,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:i})})}},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),a=e.row.original.onKeyHashClick;return(0,t.jsx)(l.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>a?.(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:e?()=>(0,t.jsx)(h,{label:"Model",field:"model",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Model",accessorKey:"model",cell:e=>{let s=e.row.original,a=s.custom_llm_provider,i=String(e.getValue()||"");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:s.metadata?.mcp_tool_call_metadata?.mcp_server_logo_url?s.metadata.mcp_tool_call_metadata.mcp_server_logo_url:a?(0,r.getProviderLogoAndName)(a).logo:"",alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(l.Tooltip,{title:i,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:i})})]})}},{header:e?()=>(0,t.jsx)(h,{label:"Tokens",field:"total_tokens",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,t.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,t.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let a=Object.entries(s),r=a[0],i=a.slice(1);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,t.jsx)(l.Tooltip,{title:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:a.map(([e,s])=>(0,t.jsxs)("span",{children:[e,": ",String(s)]},e))}),children:(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[r[0],": ",String(r[1]),i.length>0&&` +${i.length}`]})})})}}];g(),e.s(["createColumns",0,g],245099)},70969,e=>{"use strict";var t=e.i(843476);e.s(["ConfigInfoMessage",0,({show:e})=>e?(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,t.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,t.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file, or toggle the setting in ",(0,t.jsx)("strong",{children:"Admin Settings → Logging Settings"}),"."]}),(0,t.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:`general_settings:
+ store_model_in_db: true
+ store_prompts_in_spend_logs: true`}),(0,t.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null])},70635,e=>{"use strict";var t=e.i(843476),s=e.i(362024),a=e.i(500330);let l=e=>null==e?"-":`$${(0,a.formatNumberWithCommas)(e,8)}`,r=e=>null==e?"-":`${(100*e).toFixed(2)}%`;e.s(["CostBreakdownViewer",0,({costBreakdown:e,totalSpend:a,promptTokens:i,completionTokens:n,cacheHit:o,rawInputTokens:d,cacheReadTokens:c,cacheCreationTokens:x})=>{let m=o?.toLowerCase()==="true",u=void 0!==i||void 0!==n,p=e?.input_cost!==void 0||e?.output_cost!==void 0,h=e?.additional_costs&&Object.entries(e.additional_costs).some(([,e])=>null!=e&&0!==e);if(!(p||u||h||e&&(void 0!==e.discount_percent&&0!==e.discount_percent||void 0!==e.discount_amount&&0!==e.discount_amount||void 0!==e.margin_percent&&0!==e.margin_percent||void 0!==e.margin_fixed_amount&&0!==e.margin_fixed_amount||void 0!==e.margin_total_amount&&0!==e.margin_total_amount)))return null;let g=e&&(void 0!==e.discount_percent&&0!==e.discount_percent||void 0!==e.discount_amount&&0!==e.discount_amount),f=e&&(void 0!==e.margin_percent&&0!==e.margin_percent||void 0!==e.margin_fixed_amount&&0!==e.margin_fixed_amount||void 0!==e.margin_total_amount&&0!==e.margin_total_amount),y=m?0:e?.input_cost,j=m?0:e?.output_cost,b=m?0:e?.original_cost,v=m?0:e?.total_cost??a;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(s.Collapse,{expandIconPosition:"start",items:[{key:"1",label:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Cost Breakdown"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mr-4",children:[(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Total:"}),(0,t.jsxs)("span",{className:"text-sm font-semibold text-gray-900",children:[l(a),m&&" (Cached)"]})]})]}),children:(0,t.jsxs)("div",{className:"p-6 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2 max-w-2xl",children:[(()=>{if(e?.cache_read_cost!==void 0||e?.cache_creation_cost!==void 0){let s=m?0:(y??0)-(e?.cache_read_cost??0)-(e?.cache_creation_cost??0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Input Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(s),null!=d&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",d.toLocaleString()," tokens)"]})]})]}),(e?.cache_read_cost??0)>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Cache Read Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(m?0:e?.cache_read_cost),(c??0)>0&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",(c??0).toLocaleString()," tokens)"]})]})]}),(e?.cache_creation_cost??0)>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Cache Write Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(m?0:e?.cache_creation_cost),(x??0)>0&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",(x??0).toLocaleString()," tokens)"]})]})]})]})}return(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Input Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(y),void 0!==i&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",i.toLocaleString()," prompt tokens)"]})]})]})})(),(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Output Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(j),void 0!==n&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",n.toLocaleString()," completion tokens)"]})]})]}),e?.tool_usage_cost!==void 0&&e.tool_usage_cost>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Tool Usage Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:l(e.tool_usage_cost)})]}),e?.additional_costs&&Object.entries(e.additional_costs).filter(([,e])=>null!=e&&0!==e).map(([e,s])=>(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsxs)("span",{className:"text-gray-600 font-medium w-1/3",children:[e,":"]}),(0,t.jsx)("span",{className:"text-gray-900",children:l(s)})]},e))]}),!m&&(0,t.jsx)("div",{className:"pt-2 border-t border-gray-100 max-w-2xl",children:(0,t.jsxs)("div",{className:"flex text-sm font-semibold",children:[(0,t.jsx)("span",{className:"text-gray-900 w-1/3",children:"Original LLM Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:l(b)})]})}),(g||f)&&(0,t.jsxs)("div",{className:"pt-2 space-y-2 max-w-2xl",children:[g&&(0,t.jsxs)("div",{className:"space-y-2",children:[void 0!==e.discount_percent&&0!==e.discount_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsxs)("span",{className:"font-medium w-1/3",children:["Discount (",r(e.discount_percent),"):"]}),(0,t.jsxs)("span",{className:"text-gray-900",children:["-",l(e.discount_amount)]})]}),void 0!==e.discount_amount&&void 0===e.discount_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Discount Amount:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:["-",l(e.discount_amount)]})]})]}),f&&(0,t.jsxs)("div",{className:"space-y-2",children:[void 0!==e.margin_percent&&0!==e.margin_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsxs)("span",{className:"font-medium w-1/3",children:["Margin (",r(e.margin_percent),"):"]}),(0,t.jsxs)("span",{className:"text-gray-900",children:["+",l((e.margin_total_amount||0)-(e.margin_fixed_amount||0))]})]}),void 0!==e.margin_fixed_amount&&0!==e.margin_fixed_amount&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Margin:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:["+",l(e.margin_fixed_amount)]})]})]})]}),(0,t.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-200 max-w-2xl",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"font-bold text-sm text-gray-900 w-1/3",children:"Final Calculated Cost:"}),(0,t.jsxs)("span",{className:"text-sm font-bold text-gray-900",children:[l(v),m&&" (Cached)"]})]})})]})}]})})}])},339086,504809,e=>{"use strict";e.i(843476);var t=e.i(271645);e.s([],339086);var s=e.i(166540),a=e.i(764205),l=e.i(266027),r=e.i(633627),i=e.i(374009),n=e.i(700514);let o={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",PUBLIC_MODEL_OR_SEARCH_TOOL:"Public model / search tool",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias",ERROR_CODE:"Error Code",ERROR_MESSAGE:"Error Message"};function d({logs:e,accessToken:d,startTime:c,endTime:x,pageSize:m=n.defaultPageSize,isCustomDate:u,setCurrentPage:p,userID:h,userRole:g,sortBy:f="startTime",sortOrder:y="desc",currentPage:j=1}){let b=(0,t.useMemo)(()=>({[o.TEAM_ID]:"",[o.KEY_HASH]:"",[o.REQUEST_ID]:"",[o.MODEL]:"",[o.PUBLIC_MODEL_OR_SEARCH_TOOL]:"",[o.USER_ID]:"",[o.END_USER]:"",[o.STATUS]:"",[o.KEY_ALIAS]:"",[o.ERROR_CODE]:"",[o.ERROR_MESSAGE]:""}),[]),[v,_]=(0,t.useState)(b),[N,w]=(0,t.useState)(null),S=(0,t.useRef)(0),k=(0,t.useRef)(v),T=(0,t.useRef)(!1),C=(0,t.useCallback)(async(e,t=1)=>{if(!d)return;console.log("Filters being sent to API:",e);let l=Date.now();S.current=l;let r=(0,s.default)(c).utc().format("YYYY-MM-DD HH:mm:ss"),i=u?(0,s.default)(x).utc().format("YYYY-MM-DD HH:mm:ss"):(0,s.default)().utc().format("YYYY-MM-DD HH:mm:ss");try{let s=await (0,a.uiSpendLogsCall)({accessToken:d,start_date:r,end_date:i,page:t,page_size:m,params:{api_key:e[o.KEY_HASH]||void 0,team_id:e[o.TEAM_ID]||void 0,request_id:e[o.REQUEST_ID]||void 0,user_id:e[o.USER_ID]||void 0,end_user:e[o.END_USER]||void 0,status_filter:e[o.STATUS]||void 0,model_id:e[o.MODEL]||void 0,model:e[o.PUBLIC_MODEL_OR_SEARCH_TOOL]||void 0,key_alias:e[o.KEY_ALIAS]||void 0,error_code:e[o.ERROR_CODE]||void 0,error_message:e[o.ERROR_MESSAGE]||void 0,sort_by:f,sort_order:y}});l===S.current&&w({...s,data:s.data??[]})}catch(e){console.error("Error searching users:",e),w({data:[],total:0,page:1,page_size:m,total_pages:0})}},[d,c,x,u,m,f,y]),L=(0,t.useMemo)(()=>(0,i.default)((e,t)=>C(e,t),300),[C]);(0,t.useEffect)(()=>()=>L.cancel(),[L]);let E=(0,t.useMemo)(()=>!!(v[o.KEY_ALIAS]||v[o.KEY_HASH]||v[o.REQUEST_ID]||v[o.USER_ID]||v[o.END_USER]||v[o.ERROR_CODE]||v[o.ERROR_MESSAGE]||v[o.MODEL]||v[o.PUBLIC_MODEL_OR_SEARCH_TOOL]),[v]);(0,t.useEffect)(()=>{k.current=v,T.current=E},[v,E]),(0,t.useEffect)(()=>{T.current&&d&&(L.cancel(),C(k.current,j))},[f,y,j,c,x,u]);let M=(0,t.useMemo)(()=>{if(!e||!e.data)return{data:[],total:0,page:1,page_size:m,total_pages:0};if(E)return e;let t=[...e.data];if(v[o.TEAM_ID]&&(t=t.filter(e=>e.team_id===v[o.TEAM_ID])),v[o.STATUS]&&(t=t.filter(e=>"success"===v[o.STATUS]?!e.status||"success"===e.status:e.status===v[o.STATUS])),v[o.MODEL]&&(t=t.filter(e=>e.model_id===v[o.MODEL])),v[o.PUBLIC_MODEL_OR_SEARCH_TOOL]){let e=v[o.PUBLIC_MODEL_OR_SEARCH_TOOL];t=t.filter(t=>t.model===e)}return v[o.KEY_HASH]&&(t=t.filter(e=>e.api_key===v[o.KEY_HASH])),v[o.END_USER]&&(t=t.filter(e=>e.end_user===v[o.END_USER])),v[o.ERROR_CODE]&&(t=t.filter(e=>{let t=(e.metadata||{}).error_information;return t&&t.error_code===v[o.ERROR_CODE]})),{data:t,total:e.total,page:e.page,page_size:e.page_size,total_pages:e.total_pages}},[e,v,E]),A=(0,t.useMemo)(()=>E?null!==N?N:{data:[],total:0,page:1,page_size:m,total_pages:0}:M,[E,N,M]),{data:D}=(0,l.useQuery)({queryKey:["allTeamsForLogFilters",d],queryFn:async()=>d&&await (0,r.fetchAllTeams)(d)||[],enabled:!!d}),R=(0,t.useCallback)((e=j)=>{E&&d&&(L.cancel(),C(v,e))},[E,d,v,j,C,L]);return{filters:v,filteredLogs:A,hasBackendFilters:E,allTeams:D,handleFilterChange:e=>{_(t=>{let s={...t,...e};for(let e of Object.keys(b))e in s||(s[e]=b[e]);return JSON.stringify(s)!==JSON.stringify(t)&&(p(1),w(null),L(s,1)),s})},handleFilterReset:()=>{_(b),w(null),L.cancel(),p(1)},refetchWithFilters:R}}e.s(["FILTER_KEYS",0,o,"useLogFilterLogic",()=>d],504809)},894660,283086,195116,e=>{"use strict";var t=e.i(801312);e.s(["LeftOutlined",()=>t.default],894660);var s=e.i(475254);let a=(0,s.default)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);e.s(["Sparkles",()=>a],283086);let l=(0,s.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);e.s(["Wrench",()=>l],195116)},257486,624001,207066,337767,237062,e=>{"use strict";var t=e.i(97859);function s(e,s){let a=(s||"").trim();if(t.MCP_CALL_TYPES.includes(e))return a.replace(/^mcp:\s*/i,"").split("/").pop()||a||"mcp_tool";let l=(a.split("/").pop()||a).replace(/-20\d{6}.*$/i,"").replace(/:.*$/,""),r=l.match(/claude-[a-z0-9-]+/i);return r?r[0]:l||"llm_call"}e.s(["getEventDisplayName",()=>s],257486);var a=e.i(843476),l=e.i(464571),r=e.i(770914),i=e.i(262218),n=e.i(592968),o=e.i(898586),d=e.i(149192),c=e.i(536591);e.s(["UpOutlined",()=>c.default],624001);var c=c,x=e.i(755151),m=e.i(166540),u=e.i(916925);let p="16px 24px",h="Escape",g="monospace",f="#f0f0f0",y="#fff";e.s(["API_BASE_MAX_WIDTH",0,200,"COLOR_BACKGROUND",0,y,"COLOR_BG_LIGHT",0,"#fafafa","COLOR_BORDER",0,f,"DEFAULT_MAX_WIDTH",0,180,"DRAWER_CONTENT_PADDING",0,"24px","DRAWER_HEADER_PADDING",0,p,"DRAWER_WIDTH",0,"60%","FONT_FAMILY_MONO",0,g,"FONT_SIZE_HEADER",0,16,"FONT_SIZE_MEDIUM",0,13,"FONT_SIZE_SMALL",0,12,"JSON_MAX_HEIGHT",0,400,"KEY_ESCAPE",0,h,"KEY_J_LOWER",0,"j","KEY_J_UPPER",0,"J","KEY_K_LOWER",0,"k","KEY_K_UPPER",0,"K","METADATA_MAX_HEIGHT",0,300,"SPACING_LARGE",0,12,"SPACING_MEDIUM",0,8,"SPACING_SMALL",0,4,"SPACING_XLARGE",0,16,"TAB_REQUEST",0,"request","TAB_RESPONSE",0,"response"],207066);let{Text:j}=o.Typography;function b({log:e,onClose:t,onPrevious:s,onNext:l,statusLabel:r,statusColor:i,environment:n}){let o=e.custom_llm_provider||"",d=o?(0,u.getProviderLogoAndName)(o):null;return(0,a.jsxs)("div",{style:{padding:p,borderBottom:`1px solid ${f}`,backgroundColor:y,position:"sticky",top:0,zIndex:10},children:[(0,a.jsx)(v,{model:e.model,providerLogo:d?.logo,providerName:d?.displayName}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[(0,a.jsx)(_,{requestId:e.request_id}),(0,a.jsx)(N,{onPrevious:s,onNext:l,onClose:t})]}),(0,a.jsx)(w,{log:e,statusLabel:r,statusColor:i,environment:n})]})}function v({model:e,providerLogo:t,providerName:s}){return(0,a.jsxs)(r.Space,{size:8,style:{marginBottom:8},children:[t&&(0,a.jsx)("img",{src:t,alt:s||"Provider",style:{width:24,height:24},onError:e=>{e.target.style.display="none"}}),(0,a.jsxs)(r.Space,{size:8,direction:"horizontal",children:[(0,a.jsx)(j,{strong:!0,style:{fontSize:14},children:e}),s&&(0,a.jsx)(j,{type:"secondary",style:{fontSize:12},children:s})]})]})}function _({requestId:e}){return(0,a.jsx)("div",{style:{flex:1,minWidth:0},children:(0,a.jsx)(n.Tooltip,{title:e,children:(0,a.jsx)(j,{strong:!0,copyable:{text:e,tooltips:["Copy Request ID","Copied!"]},style:{fontSize:16,fontFamily:g,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:e})})})}function N({onPrevious:e,onNext:t,onClose:s}){let i={border:"1px solid #d9d9d9",borderRadius:4,padding:"0 4px",fontSize:12,fontFamily:"monospace",marginLeft:4,background:"#fafafa"};return(0,a.jsxs)(r.Space,{size:4,split:(0,a.jsx)("div",{style:{width:1,height:20,background:f}}),children:[(0,a.jsxs)(l.Button,{type:"text",size:"small",onClick:e,children:[(0,a.jsx)(c.default,{}),(0,a.jsx)("span",{style:i,children:"K"})]}),(0,a.jsxs)(l.Button,{type:"text",size:"small",onClick:t,children:[(0,a.jsx)(x.DownOutlined,{}),(0,a.jsx)("span",{style:i,children:"J"})]}),(0,a.jsx)(n.Tooltip,{title:"ESC to close",children:(0,a.jsx)(l.Button,{type:"text",icon:(0,a.jsx)(d.CloseOutlined,{}),onClick:s})})]})}function w({log:e,statusLabel:t,statusColor:s,environment:l}){return(0,a.jsxs)(r.Space,{size:12,children:[(0,a.jsx)(i.Tag,{color:s,children:t}),(0,a.jsxs)(i.Tag,{children:["Env: ",l]}),(0,a.jsxs)(r.Space,{size:8,children:[(0,a.jsx)(j,{type:"secondary",style:{fontSize:13},children:(0,m.default)(e.startTime).format("MMM D, YYYY h:mm:ss A")}),(0,a.jsxs)(j,{type:"secondary",style:{fontSize:13},children:["(",(0,m.default)(e.startTime).fromNow(),")"]})]})]})}e.s(["DrawerHeader",()=>b],337767);var S=e.i(271645);function k({isOpen:e,currentLog:t,allLogs:s,onClose:a,onSelectLog:l}){(0,S.useEffect)(()=>{let t=t=>{var s;if(!((s=t.target)instanceof HTMLInputElement||s instanceof HTMLTextAreaElement)&&e)switch(t.key){case h:a();break;case"j":case"J":r();break;case"k":case"K":i()}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,t,s]);let r=()=>{if(!t||!s.length||!l)return;let e=s.findIndex(e=>e.request_id===t.request_id);e{if(!t||!s.length||!l)return;let e=s.findIndex(e=>e.request_id===t.request_id);e>0&&l(s[e-1])};return{selectNextLog:r,selectPreviousLog:i}}e.s(["useKeyboardNavigation",()=>k],237062)},869939,e=>{"use strict";var t=e.i(843476),s=e.i(175712),a=e.i(262218),l=e.i(291542),r=e.i(898586),i=e.i(770914),n=e.i(592968),o=e.i(245704),d=e.i(518617),c=e.i(19732);let{Text:x}=r.Typography;function m({data:e}){let s=Array.isArray(e)?e:[e];return s.length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[(0,t.jsx)(c.ExperimentOutlined,{style:{fontSize:16,color:"#6366f1"}}),(0,t.jsx)(x,{strong:!0,style:{fontSize:15},children:"LLM Judge Results"})]}),s.map((e,s)=>(0,t.jsx)(u,{entry:e},e.eval_id||s))]}):null}function u({entry:e}){let r=e.passed,c=r?"#52c41a":"#ff4d4f",m=(e.verdicts||[]).filter(e=>"overall"!==(e.criterion_name||"").toLowerCase()),u=[{title:"Criterion",dataIndex:"criterion_name",key:"criterion_name",width:160,render:e=>(0,t.jsx)(x,{strong:!0,style:{whiteSpace:"nowrap"},children:e})},{title:"Weight",dataIndex:"weight",key:"weight",width:65,render:e=>null!=e?(0,t.jsxs)(x,{type:"secondary",style:{fontSize:12},children:[e,"%"]}):null},{title:"Score",dataIndex:"score",key:"score",width:65,render:e=>(0,t.jsx)(x,{style:{color:e>=70?"#52c41a":e>=50?"#faad14":"#ff4d4f",fontWeight:600},children:e})},{title:(0,t.jsx)(n.Tooltip,{title:"Score × Weight — how much each criterion contributes to the final score",children:(0,t.jsx)("span",{style:{borderBottom:"1px dashed #aaa",cursor:"help"},children:"Weighted"})}),key:"weighted",width:75,render:(e,s)=>{if(null==s.weight)return null;let a=s.score*s.weight/100;return(0,t.jsx)(x,{type:"secondary",style:{fontSize:12},children:a%1==0?a:a.toFixed(1)})}},{title:"Comment",dataIndex:"reasoning",key:"reasoning",ellipsis:{showTitle:!1},render:e=>(0,t.jsx)(n.Tooltip,{title:e,children:(0,t.jsx)("span",{style:{fontSize:12},children:e})})}];return(0,t.jsxs)(s.Card,{size:"small",className:"mb-3",style:{borderLeft:`3px solid ${c}`},title:(0,t.jsxs)(i.Space,{children:[r?(0,t.jsx)(o.CheckCircleOutlined,{style:{color:"#52c41a"}}):(0,t.jsx)(d.CloseCircleOutlined,{style:{color:"#ff4d4f"}}),(0,t.jsx)(x,{strong:!0,children:e.eval_name}),(0,t.jsx)(a.Tag,{color:r?"success":"error",children:r?"PASSED":"FAILED"}),(0,t.jsx)(n.Tooltip,{title:`Weighted average of all criterion scores. Each criterion has a weight (%) set when the eval was created — higher-weight criteria count more toward the final score.`,children:(0,t.jsxs)(x,{type:"secondary",style:{fontSize:12,cursor:"help",borderBottom:"1px dashed #aaa"},children:[e.overall_score?.toFixed(0)," / 100",null!=e.threshold&&` (threshold: ${e.threshold})`]})})]}),extra:(0,t.jsxs)(i.Space,{size:"small",children:[e.judge_model&&(0,t.jsxs)(x,{type:"secondary",style:{fontSize:12},children:["Judge: ",e.judge_model]}),null!=e.iteration&&(0,t.jsxs)(x,{type:"secondary",style:{fontSize:12},children:["Iter: ",e.iteration+1]})]}),children:[e.eval_error&&(0,t.jsxs)(x,{type:"warning",style:{display:"block",marginBottom:8,fontSize:12},children:["Judge error: ",e.eval_error]}),m.length>0?(0,t.jsx)(l.Table,{dataSource:m,columns:u,pagination:!1,size:"small",rowKey:"criterion_name",scroll:{x:!0},summary:()=>{if(!m.some(e=>null!=e.weight))return null;let e=m.reduce((e,t)=>e+(null!=t.weight?t.score*t.weight/100:0),0);return(0,t.jsxs)(l.Table.Summary.Row,{children:[(0,t.jsx)(l.Table.Summary.Cell,{index:0,children:(0,t.jsx)(x,{strong:!0,style:{fontSize:12},children:"Total"})}),(0,t.jsx)(l.Table.Summary.Cell,{index:1}),(0,t.jsx)(l.Table.Summary.Cell,{index:2}),(0,t.jsx)(l.Table.Summary.Cell,{index:3,children:(0,t.jsx)(x,{strong:!0,style:{fontSize:12,color:c},children:e%1==0?e:e.toFixed(1)})}),(0,t.jsx)(l.Table.Summary.Cell,{index:4})]})}}):(0,t.jsxs)(x,{type:"secondary",style:{fontSize:12},children:["Score: ",e.overall_score?.toFixed(1)," — no per-criterion breakdown available."]})]})}e.s(["default",()=>m])},3565,331052,867612,502626,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(464571),l=e.i(608856),r=e.i(492030),i=e.i(166406),n=e.i(894660),o=e.i(240647),d=e.i(531245),c=e.i(283086),x=e.i(195116),m=e.i(97859),u=e.i(257486),p=e.i(337767),h=e.i(237062),g=e.i(898586),f=e.i(869216),y=e.i(175712),j=e.i(262218),b=e.i(653496),v=e.i(560445),_=e.i(362024),N=e.i(91739),w=e.i(770914),S=e.i(482725),k=e.i(166540),T=e.i(500330),C=e.i(517442),L=e.i(869939),E=e.i(70635),M=e.i(70969),A=e.i(916925);function D({data:e}){let[a,l]=(0,s.useState)({});if(!e||0===e.length)return null;let r=e=>new Date(1e3*e).toLocaleString();return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{defaultActiveKey:["1"],expandIconPosition:"start",items:[{key:"1",label:(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Vector Store Requests"}),children:(0,t.jsx)("div",{className:"p-4",children:e.map((e,s)=>{var i,n;return(0,t.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,t.jsx)("span",{className:"font-mono",children:e.query})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,t.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,t.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:a}=(0,A.getProviderLogoAndName)(e.custom_llm_provider);return(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("img",{src:s,alt:`${a} logo`,className:"h-5 w-5 mr-2"}),a]})})()})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,t.jsx)("span",{children:r(e.start_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,t.jsx)("span",{children:r(e.end_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsx)("span",{children:(i=e.start_time,n=e.end_time,`${((n-i)*1e3).toFixed(2)}ms`)})]})]})]})}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,t.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,r)=>{let i=a[`${s}-${r}`]||!1;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>{let e;return e=`${s}-${r}`,void l(t=>({...t,[e]:!t[e]}))},children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${i?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("span",{className:"font-medium mr-2",children:["Result ",r+1]}),(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,t.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),i&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},r)})})]},s)})})}]})})}e.s(["VectorStoreViewer",()=>D],331052);var R=e.i(592968),O=e.i(207066);let{Text:I}=g.Typography;function z({value:e,maxWidth:s=O.DEFAULT_MAX_WIDTH}){return e?(0,t.jsx)(R.Tooltip,{title:e,children:(0,t.jsx)(I,{copyable:{text:e,tooltips:["Copy","Copied!"]},style:{maxWidth:s,display:"inline-block",verticalAlign:"bottom",fontFamily:O.FONT_FAMILY_MONO,fontSize:O.FONT_SIZE_SMALL},ellipsis:!0,children:e})}):(0,t.jsx)(I,{type:"secondary",children:"-"})}let{Text:P}=g.Typography;function B({prompt:e=0,completion:s=0,total:a=0}){return(0,t.jsxs)(P,{children:[a.toLocaleString()," (",e.toLocaleString()," prompt tokens + ",s.toLocaleString()," completion tokens)"]})}let F=e=>!!e&&e instanceof Date,H=e=>"object"==typeof e&&null!==e,q=e=>!!e&&e instanceof Object&&"function"==typeof e;function Y(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function K(e){let{field:t,value:a,data:l,lastElement:r,openBracket:i,closeBracket:n,level:o,style:d,shouldExpandNode:c,clickToExpandNode:x,outerRef:m,beforeExpandChange:u}=e,p=(0,s.useRef)(!1),[h,g]=(0,s.useState)(()=>c(o,a,t)),f=(0,s.useRef)(null);(0,s.useEffect)(()=>{p.current?g(c(o,a,t)):p.current=!0},[c]);let y=(0,s.useId)();if(0===l.length)return function(e){let{field:t,openBracket:a,closeBracket:l,lastElement:r,style:i}=e;return(0,s.createElement)("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,s.createElement)("span",{className:i.label},Y(t,i.quotesForFieldNames),":"),(0,s.createElement)("span",{className:i.punctuation},a),(0,s.createElement)("span",{className:i.punctuation},l),!r&&(0,s.createElement)("span",{className:i.punctuation},","))}({field:t,openBracket:i,closeBracket:n,lastElement:r,style:d});let j=h?d.collapseIcon:d.expandIcon,b=h?d.ariaLables.collapseJson:d.ariaLables.expandJson,v=o+1,_=l.length-1,N=e=>{h!==e&&(!u||u({level:o,value:a,field:t,newExpandValue:e}))&&g(e)},w=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),N("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let t="ArrowUp"===e.key?-1:1;if(!m.current)return;let s=m.current.querySelectorAll("[role=button]"),a=-1;for(let e=0;e{var e;N(!h);let t=f.current;if(!t)return;let s=null==(e=m.current)?void 0:e.querySelector('[role=button][tabindex="0"]');s&&(s.tabIndex=-1),t.tabIndex=0,t.focus()};return(0,s.createElement)("div",{className:d.basicChildStyle,role:"treeitem","aria-expanded":h,"aria-selected":void 0},(0,s.createElement)("span",{className:j,onClick:S,onKeyDown:w,role:"button","aria-label":b,"aria-expanded":h,"aria-controls":h?y:void 0,ref:f,tabIndex:0===o?0:-1}),(t||""===t)&&(x?(0,s.createElement)("span",{className:d.clickableLabel,onClick:S,onKeyDown:w},Y(t,d.quotesForFieldNames),":"):(0,s.createElement)("span",{className:d.label},Y(t,d.quotesForFieldNames),":")),(0,s.createElement)("span",{className:d.punctuation},i),h?(0,s.createElement)("ul",{id:y,role:"group",className:d.childFieldsContainer},l.map((e,t)=>(0,s.createElement)(V,{key:e[0]||t,field:e[0],value:e[1],style:d,lastElement:t===_,level:v,shouldExpandNode:c,clickToExpandNode:x,beforeExpandChange:u,outerRef:m}))):(0,s.createElement)("span",{className:d.collapsedContent,onClick:S,onKeyDown:w}),(0,s.createElement)("span",{className:d.punctuation},n),!r&&(0,s.createElement)("span",{className:d.punctuation},","))}function $(e){let{field:t,value:s,style:a,lastElement:l,shouldExpandNode:r,clickToExpandNode:i,level:n,outerRef:o,beforeExpandChange:d}=e;return K({field:t,value:s,lastElement:l||!1,level:n,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:r,clickToExpandNode:i,data:Object.keys(s).map(e=>[e,s[e]]),outerRef:o,beforeExpandChange:d})}function U(e){let{field:t,value:s,style:a,lastElement:l,level:r,shouldExpandNode:i,clickToExpandNode:n,outerRef:o,beforeExpandChange:d}=e;return K({field:t,value:s,lastElement:l||!1,level:r,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:i,clickToExpandNode:n,data:s.map(e=>[void 0,e]),outerRef:o,beforeExpandChange:d})}function W(e){let t,{field:a,value:l,style:r,lastElement:i}=e,n=r.otherValue;if(null===l)t="null",n=r.nullValue;else if(void 0===l)t="undefined",n=r.undefinedValue;else if("string"==typeof l||l instanceof String){var o;o=!r.noQuotesForStringValues,t=r.stringifyStringValues?JSON.stringify(l):o?`"${l}"`:l,n=r.stringValue}else if("boolean"==typeof l||l instanceof Boolean)t=l?"true":"false",n=r.booleanValue;else if("number"==typeof l||l instanceof Number)t=l.toString(),n=r.numberValue;else"bigint"==typeof l||l instanceof BigInt?(t=`${l.toString()}n`,n=r.numberValue):t=F(l)?l.toISOString():q(l)?"function() { }":l.toString();return(0,s.createElement)("div",{className:r.basicChildStyle,role:"treeitem","aria-selected":void 0},(a||""===a)&&(0,s.createElement)("span",{className:r.label},Y(a,r.quotesForFieldNames),":"),(0,s.createElement)("span",{className:n},t),!i&&(0,s.createElement)("span",{className:r.punctuation},","))}function V(e){let t=e.value;return Array.isArray(t)?(0,s.createElement)(U,Object.assign({},e)):!H(t)||F(t)||q(t)?(0,s.createElement)(W,Object.assign({},e)):(0,s.createElement)($,Object.assign({},e))}let G={container:"_2IvMF _GzYRV",basicChildStyle:"_2bkNM",childFieldsContainer:"_1BXBN",label:"_1MGIk",clickableLabel:"_2YKJg _1MGIk _1MFti",nullValue:"_2T6PJ",undefinedValue:"_1Gho6",stringValue:"_vGjyY",booleanValue:"_3zQKs",numberValue:"_1bQdo",otherValue:"_1xvuR",punctuation:"_3uHL6 _3eOF8",collapseIcon:"_oLqym _f10Tu _1MFti _1LId0",expandIcon:"_2AXVT _f10Tu _1MFti _1UmXx",collapsedContent:"_2KJWg _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:{collapseJson:"collapse JSON",expandJson:"expand JSON"},stringifyStringValues:!1},J=()=>!0,Q=e=>{let{data:t,style:a=G,shouldExpandNode:l=J,clickToExpandNode:r=!1,beforeExpandChange:i,compactTopLevel:n,...o}=e,d=(0,s.useRef)(null);return(0,s.createElement)("div",Object.assign({"aria-label":"JSON view"},o,{className:a.container,ref:d,role:"tree"}),n&&H(t)?Object.entries(t).map(e=>{let[t,n]=e;return(0,s.createElement)(V,{key:t,field:t,value:n,style:{...G,...a},lastElement:!0,level:1,shouldExpandNode:l,clickToExpandNode:r,beforeExpandChange:i,outerRef:d})}):(0,s.createElement)(V,{value:t,style:{...G,...a},lastElement:!0,level:0,shouldExpandNode:l,clickToExpandNode:r,outerRef:d,beforeExpandChange:i}))};e.s(["JsonView",()=>Q,"defaultStyles",()=>G],867612);let{Text:X}=g.Typography;function Z({data:e}){return e?(0,t.jsx)("div",{style:{maxHeight:O.JSON_MAX_HEIGHT,overflow:"auto",background:O.COLOR_BG_LIGHT,padding:O.SPACING_LARGE,borderRadius:4},children:(0,t.jsx)("div",{className:"[&_[role='tree']]:bg-white [&_[role='tree']]:text-slate-900",children:(0,t.jsx)(Q,{data:e,style:G,clickToExpandNode:!0})})}):(0,t.jsx)(X,{type:"secondary",children:"No data"})}function ee(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function et(e){return Array.isArray(e)?e:e?[e]:[]}function es(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}var ea=e.i(366308),el=e.i(755151),er=e.i(291542);let{Text:ei}=g.Typography;function en({tool:e}){let s=Object.entries(e.parameters?.properties||{}).map(([t,s])=>({key:t,name:t,type:s.type||"any",description:s.description||"-",required:e.parameters?.required?.includes(t)||!1})),a=[{title:"Parameter",dataIndex:"name",key:"name",render:(e,s)=>(0,t.jsxs)(ei,{code:!0,children:[e,s.required&&(0,t.jsx)(ei,{type:"danger",children:"*"})]})},{title:"Type",dataIndex:"type",key:"type",render:e=>(0,t.jsx)(ei,{code:!0,style:{color:"#1890ff"},children:e})},{title:"Description",dataIndex:"description",key:"description",render:e=>(0,t.jsx)(ei,{type:"secondary",children:e})}];return(0,t.jsxs)("div",{children:[e.description&&(0,t.jsx)("div",{style:{marginBottom:16},children:(0,t.jsx)(ei,{style:{lineHeight:1.6,whiteSpace:"pre-wrap"},children:e.description})}),s.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(ei,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"Parameters"}),(0,t.jsx)(er.Table,{dataSource:s,columns:a,pagination:!1,size:"small",bordered:!0})]}),e.called&&e.callData&&(0,t.jsxs)("div",{style:{marginTop:16},children:[(0,t.jsx)(ei,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"Called With"}),(0,t.jsx)("div",{style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:4,padding:12},children:(0,t.jsx)("pre",{style:{margin:0,fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(e.callData.arguments,null,2)})})]})]})}function eo({tool:e}){let s={type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}};return(0,t.jsx)("pre",{style:{margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:12,background:"#fafafa",padding:12,borderRadius:4,maxHeight:300,overflow:"auto"},children:JSON.stringify(s,null,2)})}let{Text:ed}=g.Typography;function ec({tool:e}){let[a,l]=(0,s.useState)("formatted");return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:12},children:[(0,t.jsx)(ed,{type:"secondary",style:{fontSize:12},children:"Description"}),(0,t.jsxs)(N.Radio.Group,{size:"small",value:a,onChange:e=>l(e.target.value),children:[(0,t.jsx)(N.Radio.Button,{value:"formatted",children:"Formatted"}),(0,t.jsx)(N.Radio.Button,{value:"json",children:"JSON"})]})]}),"formatted"===a?(0,t.jsx)(en,{tool:e}):(0,t.jsx)(eo,{tool:e})]})}let{Text:ex}=g.Typography;function em({tool:e}){let[a,l]=(0,s.useState)(!1);return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{onClick:()=>l(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",background:a?"#fafafa":"#fff",transition:"background 0.2s"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)(ea.ToolOutlined,{style:{color:"#8c8c8c",fontSize:14}}),(0,t.jsxs)(ex,{style:{fontSize:14},children:[e.index,". ",e.name]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)(j.Tag,{color:e.called?"blue":"default",children:e.called?"called":"not called"}),a?(0,t.jsx)(el.DownOutlined,{style:{fontSize:12,color:"#8c8c8c"}}):(0,t.jsx)(o.RightOutlined,{style:{fontSize:12,color:"#8c8c8c"}})]})]}),a&&(0,t.jsx)("div",{style:{padding:"16px",borderTop:"1px solid #f0f0f0",background:"#fff"},children:(0,t.jsx)(ec,{tool:e})})]})}let{Text:eu}=g.Typography;function ep({log:e}){let s=function(e){let t,s=!(t=es(e.proxy_server_request||e.messages))||Array.isArray(t)?[]:"object"==typeof t&&t.tools&&Array.isArray(t.tools)?t.tools:[];if(0===s.length)return[];let a=function(e){let t=es(e.response);if(!t||"object"!=typeof t)return[];let s=t.choices;if(Array.isArray(s)&&s.length>0){let e=s[0].message;if(e&&Array.isArray(e.tool_calls))return e.tool_calls}if(Array.isArray(t.content)){let e=t.content.filter(e=>"tool_use"===e.type);if(e.length>0)return e.map(e=>({id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.input||{})}}))}if(Array.isArray(t.tool_calls))return t.tool_calls;if(Array.isArray(t.results)){let e=[];for(let s of t.results)if("response.done"===s.type&&s.response?.output)for(let t of s.response.output)"function_call"===t.type&&e.push({id:t.call_id||"",type:"function",function:{name:t.name||"",arguments:t.arguments||"{}"}});if(e.length>0)return e}return[]}(e),l=new Set(a.map(e=>e.function?.name).filter(Boolean)),r=new Map;return a.forEach(e=>{let t=e.function?.name;t&&r.set(t,{id:e.id,name:t,arguments:function(e){try{return JSON.parse(e)}catch{return{}}}(e.function?.arguments||"{}")})}),s.map((e,t)=>{let s=e.function?.name||e.name||`Tool ${t+1}`;return{index:t+1,name:s,description:e.function?.description||e.description||"",parameters:e.function?.parameters||e.input_schema||{},called:l.has(s),callData:r.get(s)}})}(e);if(0===s.length)return null;let a=s.length,l=s.filter(e=>e.called).length,r=s.slice(0,2).map(e=>e.name).join(", "),i=s.length>2;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{expandIconPosition:"start",items:[{key:"1",label:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Tools"}),(0,t.jsxs)(eu,{type:"secondary",style:{fontSize:14},children:[a," provided, ",l," called"]}),(0,t.jsxs)(eu,{type:"secondary",style:{fontSize:14},children:["• ",r,i&&"..."]})]}),children:(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s.map(e=>(0,t.jsx)(em,{tool:e},e.name))})}]})})}let eh=e=>{if(!e)return{};if("string"==typeof e)try{return JSON.parse(e)}catch{return{raw:e}}return e};var eg=e.i(888259),ef=e.i(264843),ey=e.i(624001);let{Text:ej}=g.Typography;function eb({type:e,tokens:s,cost:l,onCopy:r,isCollapsed:n,onToggleCollapse:o,turnCount:d}){return(0,t.jsxs)("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",borderBottom:n?"none":"1px solid #f0f0f0",background:"#fafafa",cursor:o?"pointer":"default",transition:"background 0.15s ease"},onMouseEnter:e=>{o&&(e.currentTarget.style.background="#f5f5f5")},onMouseLeave:e=>{e.currentTarget.style.background="#fafafa"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[o&&(0,t.jsx)("div",{style:{display:"flex",alignItems:"center"},children:n?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(ey.UpOutlined,{style:{fontSize:10,color:"#8c8c8c"}})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:["input"===e?(0,t.jsx)(ef.MessageOutlined,{style:{color:"#8c8c8c",fontSize:14}}):(0,t.jsx)("span",{style:{fontSize:14,filter:"grayscale(1)",opacity:.6},children:"✨"}),(0,t.jsx)(ej,{style:{fontWeight:500,fontSize:14},children:"input"===e?"Input":"Output"})]}),void 0!==s&&(0,t.jsxs)(ej,{type:"secondary",style:{fontSize:12},children:["Tokens: ",s.toLocaleString()]}),void 0!==l&&(0,t.jsxs)(ej,{type:"secondary",style:{fontSize:12},children:["Cost: $",l.toFixed(6)]}),void 0!==d&&d>0&&(0,t.jsxs)(ej,{type:"secondary",style:{fontSize:12},children:["Turns: ",d]})]}),(0,t.jsx)(R.Tooltip,{title:"Copy",children:(0,t.jsx)(a.Button,{type:"text",size:"small",icon:(0,t.jsx)(i.CopyOutlined,{}),onClick:e=>{e.stopPropagation(),r()}})})]})}let{Text:ev}=g.Typography;function e_({label:e,content:a,defaultExpanded:l=!1}){let[r,i]=(0,s.useState)(l),[n,d]=(0,s.useState)(!1),c=a?.length||0;return a&&0!==c?(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsxs)("div",{onClick:()=>i(!r),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"4px 0",borderRadius:4,background:n?"#f5f5f5":"transparent",transition:"background 0.15s ease",marginBottom:4*!!r},children:[r?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(o.RightOutlined,{style:{fontSize:10,color:"#8c8c8c"}}),(0,t.jsx)(ev,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase"},children:e}),(0,t.jsxs)(ev,{type:"secondary",style:{fontSize:10},children:["(",c.toLocaleString()," chars)"]})]}),(0,t.jsx)("div",{style:{maxHeight:r?"2000px":"0px",overflow:"hidden",transition:"max-height 0.2s ease-out, opacity 0.2s ease-out",opacity:+!!r},children:(0,t.jsx)("div",{style:{paddingLeft:16,fontSize:13,lineHeight:1.7,color:"#262626",borderLeft:"1px solid #f0f0f0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a})})]}):null}let{Text:eN}=g.Typography;function ew({tool:e,compact:s=!1}){return(0,t.jsxs)("div",{style:{background:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:6,padding:s?"6px 10px":"10px 14px",marginTop:8,fontFamily:"monospace",fontSize:12,position:"relative"},children:[(0,t.jsx)("div",{style:{position:"absolute",top:-8,left:12,background:"#fff",padding:"0 6px",fontSize:10,color:"#8c8c8c",border:"1px solid #e9ecef",borderRadius:3},children:"function"}),(0,t.jsx)(eN,{strong:!0,style:{fontSize:13,display:"block",marginBottom:6},children:e.name}),Object.keys(e.arguments).length>0&&(0,t.jsx)("div",{children:Object.entries(e.arguments).map(([e,s])=>(0,t.jsxs)("div",{style:{marginBottom:2},children:[(0,t.jsxs)(eN,{type:"secondary",style:{fontSize:12},children:[e,":"," "]}),(0,t.jsx)(eN,{style:{fontSize:12},children:JSON.stringify(s)})]},e))})]})}let{Text:eS}=g.Typography;function ek({label:e,content:s,toolCalls:a,isCompact:l=!1}){let r=s&&"null"!==s&&s.length>0?s:null,i=a&&a.length>0;return r||i?(0,t.jsxs)("div",{style:{marginBottom:8*!!l},children:[(0,t.jsx)(eS,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase",display:"block",marginBottom:3},children:e}),r&&(0,t.jsx)("div",{style:{fontSize:13,lineHeight:1.7,color:"#262626",whiteSpace:"pre-wrap",wordBreak:"break-word",marginBottom:6*!!i},children:r}),i&&(0,t.jsx)("div",{children:a.map((e,s)=>(0,t.jsx)(ew,{tool:e,compact:l},e.id||s))})]}):null}let{Text:eT}=g.Typography;function eC({messages:e}){let[a,l]=(0,s.useState)(!1),[r,i]=(0,s.useState)(!1);return 0===e.length?null:(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsxs)("div",{onClick:()=>l(!a),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"4px 0",borderRadius:4,background:r?"#f5f5f5":"transparent",transition:"background 0.15s ease",marginBottom:4*!!a},children:[a?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(o.RightOutlined,{style:{fontSize:10,color:"#8c8c8c"}}),(0,t.jsxs)(eT,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase"},children:["HISTORY (",e.length," message",1!==e.length?"s":"",")"]})]}),(0,t.jsx)("div",{style:{maxHeight:a?"2000px":"0px",overflow:"hidden",transition:"max-height 0.2s ease-out, opacity 0.2s ease-out",opacity:+!!a},children:(0,t.jsx)("div",{style:{paddingLeft:16,borderLeft:"1px solid #f0f0f0"},children:e.map((e,s)=>(0,t.jsx)(ek,{label:e.role.toUpperCase(),content:e.content,toolCalls:e.toolCalls,isCompact:!0},s))})})]})}function eL({messages:e,promptTokens:a,inputCost:l}){let[r,i]=(0,s.useState)(!1);if(0===e.length)return null;let n=e.find(e=>"system"===e.role),o=e.filter(e=>"system"!==e.role),d=o.length>0?o[o.length-1]:null,c=o.slice(0,-1);return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,marginBottom:8,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"input",tokens:a,cost:l,onCopy:()=>{let e=d?.content||"";navigator.clipboard.writeText(e),eg.default.success("Input copied")},isCollapsed:r,onToggleCollapse:()=>i(!r)}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsxs)("div",{style:{padding:"12px 16px"},children:[n&&(0,t.jsx)(e_,{label:"SYSTEM",content:n.content,defaultExpanded:!!(n.content&&n.content.length<200)}),c.length>0&&(0,t.jsx)(eC,{messages:c}),d&&(0,t.jsx)(ek,{label:d.role.toUpperCase(),content:d.content,toolCalls:d.toolCalls})]})})]})}let{Text:eE}=g.Typography;function eM({message:e,completionTokens:a,outputCost:l}){let[r,i]=(0,s.useState)(!1),n=()=>{if(!e)return;let t=e.content||"";navigator.clipboard.writeText(t),eg.default.success("Output copied")};return e?(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"output",tokens:a,cost:l,onCopy:n,isCollapsed:r,onToggleCollapse:()=>i(!r)}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsx)("div",{style:{padding:"12px 16px"},children:(0,t.jsx)(ek,{label:"ASSISTANT",content:e.content,toolCalls:e.toolCalls})})})]}):(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"output",tokens:a,cost:l,onCopy:n,isCollapsed:r,onToggleCollapse:()=>i(!r)}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsx)("div",{style:{padding:"12px 16px"},children:(0,t.jsx)(eE,{type:"secondary",style:{fontSize:13,fontStyle:"italic"},children:"No response data available"})})})]})}var eA=e.i(782273),eD=e.i(313603),eR=e.i(793916);let{Text:eO}=g.Typography;function eI({response:e,metrics:s}){let a=e?.results||[],l=e?.usage,r=a.find(e=>"session.created"===e.type||"session.updated"===e.type),i=a.filter(e=>"response.done"===e.type);return(0,t.jsxs)("div",{children:[r?.session&&(0,t.jsx)(ez,{session:r.session,turnCount:i.length}),i.length>0&&(0,t.jsx)(eP,{responses:i.map(e=>e.response).filter(Boolean),totalUsage:l,metrics:s}),!r&&0===i.length&&(0,t.jsx)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,padding:"16px",color:"#8c8c8c",fontStyle:"italic",fontSize:13},children:"No recognized realtime events found"})]})}function ez({session:e,turnCount:a}){let[l,r]=(0,s.useState)(!0);return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,marginBottom:8,overflow:"hidden"},children:[(0,t.jsx)("div",{onClick:()=>r(!l),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",borderBottom:l?"none":"1px solid #f0f0f0",background:"#fafafa",cursor:"pointer",transition:"background 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.background="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.background="#fafafa"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"center"},children:l?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(ey.UpOutlined,{style:{fontSize:10,color:"#8c8c8c"}})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)(eD.SettingOutlined,{style:{color:"#8c8c8c",fontSize:14}}),(0,t.jsx)(eO,{style:{fontWeight:500,fontSize:14},children:"Session"})]}),(0,t.jsx)(eO,{type:"secondary",style:{fontSize:12},children:e.model}),a>0&&(0,t.jsxs)(j.Tag,{color:"purple",style:{margin:0,fontWeight:500},children:[a," ",1===a?"turn":"turns"]}),e.voice&&(0,t.jsxs)(j.Tag,{color:"blue",style:{margin:0},children:[(0,t.jsx)(eA.SoundOutlined,{})," ",e.voice]}),e.modalities&&(0,t.jsx)("div",{style:{display:"flex",gap:4},children:e.modalities.map(e=>(0,t.jsxs)(j.Tag,{style:{margin:0},children:["audio"===e?(0,t.jsx)(eR.AudioOutlined,{}):(0,t.jsx)(ef.MessageOutlined,{})," ",e]},e))})]})}),(0,t.jsx)("div",{style:{maxHeight:l?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!l},children:(0,t.jsxs)("div",{style:{padding:"12px 16px"},children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px 24px",fontSize:13},children:[(0,t.jsx)(eq,{label:"Model",value:e.model}),(0,t.jsx)(eq,{label:"Voice",value:e.voice}),(0,t.jsx)(eq,{label:"Temperature",value:e.temperature}),(0,t.jsx)(eq,{label:"Max Output Tokens",value:e.max_response_output_tokens}),(0,t.jsx)(eq,{label:"Input Audio Format",value:e.input_audio_format}),(0,t.jsx)(eq,{label:"Output Audio Format",value:e.output_audio_format}),e.turn_detection&&(0,t.jsx)(eq,{label:"Turn Detection",value:e.turn_detection.type}),e.tools&&e.tools.length>0&&(0,t.jsx)(eq,{label:"Tools",value:`${e.tools.length} tool(s)`})]}),e.instructions&&(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsx)(eO,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase",display:"block",marginBottom:4},children:"Instructions"}),(0,t.jsx)("div",{style:{fontSize:12,lineHeight:1.6,color:"#595959",background:"#fafafa",padding:"8px 12px",borderRadius:4,border:"1px solid #f0f0f0",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:120,overflowY:"auto"},children:e.instructions})]})]})})]})}function eP({responses:e,totalUsage:a,metrics:l}){let[r,i]=(0,s.useState)(!1),n=a?.total_tokens,o=e.length;return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"output",tokens:l?.completion_tokens??n,cost:l?.output_cost,onCopy:()=>{let t=e.flatMap(e=>(e.output||[]).flatMap(e=>(e.content||[]).map(t=>`${e.role}: ${t.transcript||t.text||""}`))).join("\n");navigator.clipboard.writeText(t)},isCollapsed:r,onToggleCollapse:()=>i(!r),turnCount:o}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsx)("div",{style:{padding:"12px 16px"},children:e.map((e,s)=>(0,t.jsx)(eB,{response:e,index:s},e.id||s))})})]})}function eB({response:e,index:s}){let a=e.output||[],l=e.usage;return(0,t.jsxs)("div",{style:{marginBottom:12,paddingBottom:12,borderBottom:"1px solid #f5f5f5"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,t.jsx)(j.Tag,{color:"completed"===e.status?"green":"orange",style:{margin:0},children:e.status||"unknown"}),l&&(0,t.jsxs)(eO,{type:"secondary",style:{fontSize:11},children:[l.input_tokens??0," in / ",l.output_tokens??0," out tokens"]}),e.conversation_id&&(0,t.jsx)(R.Tooltip,{title:e.conversation_id,children:(0,t.jsxs)(eO,{type:"secondary",style:{fontSize:11,cursor:"help"},children:["conv: ",e.conversation_id.slice(0,12),"..."]})})]}),a.map((e,s)=>(0,t.jsx)(eF,{output:e},e.id||s)),l?.input_token_details&&(0,t.jsx)(eH,{label:"Input",details:l.input_token_details}),l?.output_token_details&&(0,t.jsx)(eH,{label:"Output",details:l.output_token_details})]})}function eF({output:e}){let s=e.content||[];return s.some(e=>e.transcript||e.text)?(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)(eO,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase",display:"block",marginBottom:3},children:e.role?.toUpperCase()||"ASSISTANT"}),s.map((e,s)=>{let a=e.transcript||e.text;return a?(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,marginBottom:4},children:["audio"===e.type&&(0,t.jsx)(eR.AudioOutlined,{style:{color:"#8c8c8c",fontSize:12,marginTop:3,flexShrink:0}}),"text"===e.type&&(0,t.jsx)(ef.MessageOutlined,{style:{color:"#8c8c8c",fontSize:12,marginTop:3,flexShrink:0}}),(0,t.jsx)("div",{style:{fontSize:13,lineHeight:1.7,color:"#262626",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a})]},s):null})]}):null}function eH({label:e,details:s}){let a=Object.entries(s).filter(([,e])=>"number"==typeof e||"object"==typeof e&&null!==e);return 0===a.length?null:(0,t.jsxs)("div",{style:{marginTop:4},children:[(0,t.jsxs)(eO,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase"},children:[e," Token Breakdown"]}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:4},children:a.map(([e,s])=>"number"==typeof s?(0,t.jsxs)(j.Tag,{style:{margin:0},children:[e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),": ",s.toLocaleString()]},e):null)})]})}function eq({label:e,value:s}){return null==s?null:(0,t.jsxs)("div",{children:[(0,t.jsx)(eO,{type:"secondary",style:{fontSize:11},children:e}),(0,t.jsx)("div",{style:{fontSize:13,color:"#262626"},children:String(s)})]})}function eY({request:e,response:s,metrics:a}){let l,r,i;if(s&&s.results&&Array.isArray(s.results)&&0!==s.results.length&&s.results.some(e=>"session.created"===e.type||"session.updated"===e.type||"response.done"===e.type))return(0,t.jsx)(eI,{response:s,metrics:a});let{requestMessages:n,responseMessage:o}=(l=[],e?.messages&&Array.isArray(e.messages)&&e.messages.forEach(e=>{let t;l.push({role:e.role||"user",content:"string"==typeof(t=e.content)?t:Array.isArray(t)?t.map(e=>"string"==typeof e?e:"text"===e.type?e.text:"image_url"===e.type?"[Image]":JSON.stringify(e)).join("\n"):JSON.stringify(t),toolCallId:e.tool_call_id})}),r=null,(i=s?.choices?.[0]?.message)&&(r={role:i.role||"assistant",content:i.content||"",toolCalls:(e=>{if(e&&Array.isArray(e))return e.map(e=>({id:e.id||"",name:e.function?.name||"unknown",arguments:eh(e.function?.arguments)}))})(i.tool_calls)}),{requestMessages:l,responseMessage:r});return(0,t.jsxs)("div",{children:[(0,t.jsx)(eL,{messages:n,promptTokens:a?.prompt_tokens,inputCost:a?.input_cost}),(0,t.jsx)(eM,{message:o,completionTokens:a?.completion_tokens,outputCost:a?.output_cost})]})}let{Text:eK}=g.Typography;function e$({logEntry:e,isLoadingDetails:s=!1,accessToken:a}){var l,r;let i=e.metadata||{},n="failure"===i.status,o=n?i.error_information:null,d=!!(l=e.messages)&&(Array.isArray(l)?l.length>0:"object"==typeof l&&Object.keys(l).length>0),c=!!(r=e.response)&&Object.keys(ee(r)).length>0,x=!d&&!c&&!n&&!s,m=i?.guardrail_information,u=et(m),p=u.length>0,h=u.reduce((e,t)=>{let s=t?.masked_entity_count;return s?e+Object.values(s).reduce((e,t)=>"number"==typeof t?e+t:e,0):e},0),g=0===u.length?"-":1===u.length?u[0]?.guardrail_name??"-":`${u.length} guardrails`,j=i?.eval_information,b=i.vector_store_request_metadata&&Array.isArray(i.vector_store_request_metadata)&&i.vector_store_request_metadata.length>0;return(0,t.jsxs)("div",{style:{padding:`${O.DRAWER_CONTENT_PADDING} ${O.DRAWER_CONTENT_PADDING} 0`},children:[n&&o&&(0,t.jsx)(v.Alert,{type:"error",showIcon:!0,message:"Request Failed",description:(0,t.jsx)(eU,{errorInfo:o}),className:"mb-6"}),e.request_tags&&Object.keys(e.request_tags).length>0&&(0,t.jsx)(eW,{tags:e.request_tags}),(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(y.Card,{title:"Request Details",size:"small",bordered:!1,style:{marginBottom:0},children:(0,t.jsxs)(f.Descriptions,{column:2,size:"small",children:[(0,t.jsx)(f.Descriptions.Item,{label:"Model",children:e.model}),(0,t.jsx)(f.Descriptions.Item,{label:"Provider",children:e.custom_llm_provider||"-"}),(0,t.jsx)(f.Descriptions.Item,{label:"Call Type",children:e.call_type}),(0,t.jsx)(f.Descriptions.Item,{label:"Model ID",children:(0,t.jsx)(z,{value:e.model_id})}),(0,t.jsx)(f.Descriptions.Item,{label:"API Base",children:(0,t.jsx)(z,{value:e.api_base,maxWidth:O.API_BASE_MAX_WIDTH})}),e.requester_ip_address&&(0,t.jsx)(f.Descriptions.Item,{label:"IP Address",children:e.requester_ip_address}),p&&(0,t.jsx)(f.Descriptions.Item,{label:"Guardrail",children:(0,t.jsx)(eV,{label:g,maskedCount:h})})]})})}),(0,t.jsx)(eG,{logEntry:e,metadata:i}),(0,t.jsx)(E.CostBreakdownViewer,{costBreakdown:i?.cost_breakdown,totalSpend:e.spend??0,promptTokens:e.prompt_tokens,completionTokens:e.completion_tokens,cacheHit:e.cache_hit,rawInputTokens:i?.additional_usage_values?.prompt_tokens_details?.text_tokens,cacheReadTokens:i?.additional_usage_values?.cache_read_input_tokens,cacheCreationTokens:i?.additional_usage_values?.cache_creation_input_tokens}),(0,t.jsx)(ep,{log:e}),x&&(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(M.ConfigInfoMessage,{show:x})}),s?(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6 p-8 text-center",children:[(0,t.jsx)(S.Spin,{size:"default"}),(0,t.jsx)("div",{style:{marginTop:8,color:"#999"},children:"Loading request & response data..."})]}):(0,t.jsx)(eJ,{hasResponse:c,hasError:n,getRawRequest:()=>ee(e.proxy_server_request||e.messages),getFormattedResponse:()=>n&&o?{error:{message:o.error_message||"An error occurred",type:o.error_class||"error",code:o.error_code||"unknown",param:null}}:ee(e.response),logEntry:e}),p&&(0,t.jsx)("div",{id:"guardrail-section",children:(0,t.jsx)(C.default,{data:m,accessToken:a??null,logEntry:{request_id:e.request_id,user:e.user,model:e.model,startTime:e.startTime,metadata:e.metadata}})}),null!=j&&(0,t.jsx)(L.default,{data:j}),b&&(0,t.jsx)(D,{data:i.vector_store_request_metadata}),e.metadata&&Object.keys(e.metadata).length>0&&(0,t.jsx)(eX,{metadata:e.metadata}),(0,t.jsx)("div",{style:{height:O.DRAWER_CONTENT_PADDING}})]})}function eU({errorInfo:e}){return(0,t.jsxs)("div",{children:[e.error_code&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eK,{strong:!0,children:"Error Code:"})," ",e.error_code]}),e.error_message&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eK,{strong:!0,children:"Message:"})," ",e.error_message]})]})}function eW({tags:e}){return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden p-4 mb-6",children:[(0,t.jsx)(eK,{strong:!0,style:{display:"block",marginBottom:8,fontSize:16},children:"Tags"}),(0,t.jsx)(w.Space,{size:O.SPACING_MEDIUM,wrap:!0,children:Object.entries(e).map(([e,s])=>(0,t.jsxs)(j.Tag,{children:[e,": ",String(s)]},e))})]})}function eV({label:e,maskedCount:s}){return(0,t.jsxs)(w.Space,{size:O.SPACING_MEDIUM,children:[(0,t.jsx)("a",{onClick:()=>{let e=document.getElementById("guardrail-section");e&&e.scrollIntoView({behavior:"smooth"})},style:{cursor:"pointer"},children:e}),s>0&&(0,t.jsxs)(j.Tag,{color:"blue",children:[s," masked"]})]})}function eG({logEntry:e,metadata:s}){let a=e.completionStartTime,l=a&&a!==e.endTime?new Date(a).getTime()-new Date(e.startTime).getTime():null,r=e.cache_hit||s?.additional_usage_values?.cache_read_input_tokens&&s.additional_usage_values.cache_read_input_tokens>0,i=String(e.cache_hit??"None"),n="true"===i.toLowerCase()?"green":"false"===i.toLowerCase()?"red":"default",o=function(e){let t=e?.additional_usage_values?.prompt_tokens_details?.text_tokens??e?.usage_object?.prompt_tokens_details?.text_tokens;if(null==t)return;let s=Number(t);return Number.isFinite(s)?s:void 0}(s),d="anthropic_messages"===e.call_type&&void 0!==o;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(y.Card,{title:"Metrics",size:"small",style:{marginBottom:0},children:(0,t.jsxs)(f.Descriptions,{column:2,size:"small",children:[d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.Descriptions.Item,{label:"Input Tokens",children:(0,T.formatNumberWithCommas)(o)}),(0,t.jsx)(f.Descriptions.Item,{label:"Output Tokens",children:(0,T.formatNumberWithCommas)(e.completion_tokens)})]}):(0,t.jsx)(f.Descriptions.Item,{label:"Tokens",children:(0,t.jsx)(B,{prompt:e.prompt_tokens,completion:e.completion_tokens,total:e.total_tokens})}),(0,t.jsxs)(f.Descriptions.Item,{label:"Cost",children:["$",(0,T.formatNumberWithCommas)(e.spend||0,8)]}),(0,t.jsxs)(f.Descriptions.Item,{label:"Duration",children:[null!=e.request_duration_ms?(e.request_duration_ms/1e3).toFixed(3):"-"," s"]}),null!=l&&l>0&&(0,t.jsxs)(f.Descriptions.Item,{label:"Time to First Token",children:[(l/1e3).toFixed(3)," s"]}),r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.Descriptions.Item,{label:"Cache Hit",children:(0,t.jsx)(j.Tag,{color:n,children:i})}),s?.additional_usage_values?.cache_read_input_tokens>0&&(0,t.jsx)(f.Descriptions.Item,{label:"Cache Read Tokens",children:(0,T.formatNumberWithCommas)(s.additional_usage_values.cache_read_input_tokens)}),s?.additional_usage_values?.cache_creation_input_tokens>0&&(0,t.jsx)(f.Descriptions.Item,{label:"Cache Creation Tokens",children:(0,T.formatNumberWithCommas)(s.additional_usage_values.cache_creation_input_tokens)})]}),s?.litellm_overhead_time_ms!==void 0&&null!==s.litellm_overhead_time_ms&&(0,t.jsxs)(f.Descriptions.Item,{label:"LiteLLM Overhead",children:[s.litellm_overhead_time_ms.toFixed(2)," ms"]}),(0,t.jsx)(f.Descriptions.Item,{label:"Retries",children:s?.attempted_retries!==void 0&&s?.attempted_retries!==null?s.attempted_retries>0?(0,t.jsxs)(t.Fragment,{children:[s.attempted_retries,void 0!==s.max_retries&&null!==s.max_retries?` / ${s.max_retries}`:""]}):(0,t.jsx)(j.Tag,{color:"green",children:"None"}):"-"}),(0,t.jsx)(f.Descriptions.Item,{label:"Start Time",children:(0,k.default)(e.startTime).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")}),(0,t.jsx)(f.Descriptions.Item,{label:"End Time",children:(0,k.default)(e.endTime).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")})]})})})}function eJ({hasResponse:e,hasError:a,getRawRequest:l,getFormattedResponse:r,logEntry:i}){let[n,o]=(0,s.useState)(O.TAB_REQUEST),[d,c]=(0,s.useState)("pretty"),x=i.spend??0,m=i.prompt_tokens||0,u=i.completion_tokens||0,p=m+u,h=i.metadata?.cost_breakdown,g=h?.input_cost!==void 0&&h?.output_cost!==void 0,f=g?h.input_cost??0:p>0?x*m/p:0,y=g?h.output_cost??0:p>0?x*u/p:0;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{defaultActiveKey:["1"],expandIconPosition:"start",items:[{key:"1",label:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},onClick:e=>{e.target.closest(".ant-radio-group")&&e.stopPropagation()},children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",style:{margin:0},children:"Request & Response"}),(0,t.jsxs)(N.Radio.Group,{size:"small",value:d,onChange:e=>c(e.target.value),children:[(0,t.jsx)(N.Radio.Button,{value:"pretty",children:"Pretty"}),(0,t.jsx)(N.Radio.Button,{value:"json",children:"JSON"})]})]}),children:(0,t.jsx)("div",{children:"pretty"===d?(0,t.jsx)(eY,{request:l(),response:r(),metrics:{prompt_tokens:m,completion_tokens:u,input_cost:f,output_cost:y}}):(0,t.jsx)(b.Tabs,{activeKey:n,onChange:e=>o(e),tabBarExtraContent:(0,t.jsx)(eK,{copyable:{text:JSON.stringify(n===O.TAB_REQUEST?l():r(),null,2),tooltips:["Copy JSON","Copied!"]},disabled:n===O.TAB_RESPONSE&&!e&&!a}),items:[{key:O.TAB_REQUEST,label:"Request",children:(0,t.jsx)("div",{style:{paddingTop:O.SPACING_XLARGE,paddingBottom:O.SPACING_XLARGE},children:(0,t.jsx)(Z,{data:l(),mode:"formatted"})})},{key:O.TAB_RESPONSE,label:"Response",children:(0,t.jsx)("div",{style:{paddingTop:O.SPACING_XLARGE,paddingBottom:O.SPACING_XLARGE},children:e||a?(0,t.jsx)(Z,{data:r(),mode:"formatted"}):(0,t.jsx)("div",{style:{textAlign:"center",padding:20,color:"#999",fontStyle:"italic"},children:"Response data not available"})})}]})})}]})})}function eQ({guardrailEntries:e}){let s=e.every(e=>{let t=e?.guardrail_status||e?.status;return"pass"===t||"passed"===t||"success"===t});return(0,t.jsx)("div",{style:{textAlign:"left",marginBottom:12},children:(0,t.jsxs)("div",{onClick:()=>{let e=document.getElementById("guardrail-section");e&&e.scrollIntoView({behavior:"smooth"})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px",borderRadius:16,cursor:"pointer",fontSize:13,fontWeight:500,backgroundColor:s?"#f0fdf4":"#fef2f2",color:s?"#15803d":"#b91c1c",border:`1px solid ${s?"#bbf7d0":"#fecaca"}`},children:[s?"✓":"✗"," ",e.length," guardrail",1!==e.length?"s":""," evaluated",(0,t.jsx)("span",{style:{fontSize:11,opacity:.7},children:"↓"})]})})}function eX({metadata:e}){return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{defaultActiveKey:["1"],expandIconPosition:"start",items:[{key:"1",label:(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Metadata"}),children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:8},children:(0,t.jsx)(eK,{copyable:{text:JSON.stringify(e,null,2),tooltips:["Copy Metadata","Copied!"]}})}),(0,t.jsx)("pre",{style:{maxHeight:O.METADATA_MAX_HEIGHT,overflowY:"auto",fontSize:O.FONT_SIZE_SMALL,fontFamily:O.FONT_FAMILY_MONO,whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:JSON.stringify(e,null,2)})]})}]})})}var eZ=e.i(764205),e0=e.i(266027),e1=e.i(135214);function e2({row:e,isSelected:s,onClick:a}){let l=m.MCP_CALL_TYPES.includes(e.call_type),r=m.AGENT_CALL_TYPES.includes(e.call_type),i=null!=e.request_duration_ms?(e.request_duration_ms/1e3).toFixed(3):e.startTime&&e.endTime?((Date.parse(e.endTime)-Date.parse(e.startTime))/1e3).toFixed(3):"-";return(0,t.jsxs)("button",{type:"button",className:`w-full text-left pl-8 pr-2 py-1 transition-colors ${s?"bg-blue-50":"hover:bg-slate-100"}`,onClick:a,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[l?(0,t.jsx)(x.Wrench,{size:12,className:"text-slate-500 flex-shrink-0"}):r?(0,t.jsx)(d.Bot,{size:12,className:"text-slate-500 flex-shrink-0"}):(0,t.jsx)(c.Sparkles,{size:12,className:"text-slate-500 flex-shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-medium text-slate-900 truncate",children:(0,u.getEventDisplayName)(e.call_type,e.model)})]}),(0,t.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0 flex items-center gap-1.5 font-mono",children:[(0,t.jsxs)("span",{children:[i,"s"]}),e.spend?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:(0,T.getSpendString)(e.spend)})]}):null,e.total_tokens?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[e.total_tokens," tok"]})]}):null]})]})}function e5({open:e,onClose:d,logEntry:c,sessionId:x,accessToken:u,allLogs:g=[],onSelectLog:f,startTime:y}){let j=!!x,[b,v]=(0,s.useState)(null),[_,N]=(0,s.useState)(!1),[w,S]=(0,s.useState)(!1),{data:k=[]}=(0,e0.useQuery)({queryKey:["sessionLogs",x],queryFn:async()=>{if(!x||!u)return[];let e=await (0,eZ.sessionSpendLogsCall)(u,x);return(e.data||e||[]).map(e=>({...e,request_duration_ms:e.request_duration_ms??Date.parse(e.endTime)-Date.parse(e.startTime)})).sort((e,t)=>{let s=+!!m.MCP_CALL_TYPES.includes(e.call_type),a=+!!m.MCP_CALL_TYPES.includes(t.call_type);return s!==a?s-a:new Date(e.startTime).getTime()-new Date(t.startTime).getTime()})},enabled:!!(e&&j&&x&&u)}),C=(0,s.useMemo)(()=>j?k.length?b?k.find(e=>e.request_id===b)||k[0]:c?.request_id&&k.find(e=>e.request_id===c.request_id)||k[0]:null:c,[j,c,b,k]);(0,s.useEffect)(()=>{j&&k.length&&(b&&k.some(e=>e.request_id===b)||v(c?.request_id&&k.some(e=>e.request_id===c.request_id)?c.request_id:k[0].request_id))},[j,c,b,k]),(0,s.useEffect)(()=>{e?N(!1):(j&&v(null),S(!1))},[e,j]);let{selectNextLog:L,selectPreviousLog:E}=(0,h.useKeyboardNavigation)({isOpen:e,currentLog:C,allLogs:j?k:g,onClose:d,onSelectLog:e=>{j&&v(e.request_id),f?.(e)}}),M=((e,t,s)=>{let{accessToken:a}=(0,e1.default)();return(0,e0.useQuery)({queryKey:["logDetails",e,t,a],queryFn:async()=>a&&e&&t?await (0,eZ.uiSpendLogDetailsCall)(a,e,t):null,enabled:s&&!!a&&!!e&&!!t,staleTime:6e5,gcTime:6e5})})(C?.request_id,y,e&&!!C?.request_id),A=M.data,D=M.isLoading,R=(0,s.useMemo)(()=>C?{...C,messages:A?.messages||C.messages,response:A?.response||C.response,proxy_server_request:A?.proxy_server_request||C.proxy_server_request}:null,[C,A]),I=C?.metadata||{},z="failure"===I.status?"Failure":"Success",P="failure"===I.status?"error":"success",B=I?.user_api_key_team_alias||"default",F=k.reduce((e,t)=>e+(t.spend||0),0),H=k.length>0?new Date(Math.min(...k.map(e=>new Date(e.startTime).getTime()))):null,q=k.length>0?new Date(Math.max(...k.map(e=>new Date(e.endTime).getTime()))):null,Y=H&&q?((q.getTime()-H.getTime())/1e3).toFixed(2):"0.00",K=k.filter(e=>!m.MCP_CALL_TYPES.includes(e.call_type)&&!m.AGENT_CALL_TYPES.includes(e.call_type)).length,$=k.filter(e=>m.AGENT_CALL_TYPES.includes(e.call_type)).length,U=k.filter(e=>m.MCP_CALL_TYPES.includes(e.call_type)).length,W=j?k:C?[C]:[],V=j?x||"":C?.request_id||"",G=V.length>14?`${V.slice(0,11)}...`:V,J=async()=>{if(V)try{await navigator.clipboard.writeText(V),S(!0),setTimeout(()=>S(!1),1200)}catch{}};return C&&R?(0,t.jsx)(l.Drawer,{title:null,placement:"right",onClose:d,open:e,width:O.DRAWER_WIDTH,closable:!1,mask:!0,maskClosable:!0,styles:{body:{padding:0,overflow:"hidden"},header:{display:"none"}},children:(0,t.jsxs)("div",{style:{height:"100%"},className:"flex relative",children:[_?(0,t.jsx)(a.Button,{type:"text",size:"small",icon:(0,t.jsx)(o.RightOutlined,{}),onClick:()=>N(!1),className:"absolute top-2 left-2 z-20 !bg-white !border !border-slate-200 !rounded-md","aria-label":"Expand trace sidebar"}):(0,t.jsx)(a.Button,{type:"text",size:"small",icon:(0,t.jsx)(n.LeftOutlined,{}),onClick:()=>N(!0),className:"absolute top-2 left-2 z-20 !bg-white !border !border-slate-200 !rounded-md","aria-label":"Collapse trace sidebar"}),!_&&(0,t.jsxs)("div",{className:"border-r border-slate-200 bg-slate-50 flex flex-col",style:{width:224},children:[(0,t.jsxs)("div",{className:"pl-12 pr-3 py-2 border-b border-slate-200 bg-white",children:[(0,t.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:j?"Session":"Trace"}),(0,t.jsxs)("div",{className:"font-mono text-[12px] text-slate-900 leading-tight flex items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate",children:G}),(0,t.jsx)("button",{type:"button",onClick:J,className:"text-slate-400 hover:text-slate-600","aria-label":"Copy trace id",children:w?(0,t.jsx)(r.CheckOutlined,{className:"text-[11px]"}):(0,t.jsx)(i.CopyOutlined,{className:"text-[11px]"})})]})]})}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-slate-500 font-mono",children:[W.length," req",[j?K:W.filter(e=>!m.MCP_CALL_TYPES.includes(e.call_type)&&!m.AGENT_CALL_TYPES.includes(e.call_type)).length,j?$:W.filter(e=>m.AGENT_CALL_TYPES.includes(e.call_type)).length,j?U:W.filter(e=>m.MCP_CALL_TYPES.includes(e.call_type)).length].map((e,s)=>{let a=[" LLM"," Agent"," MCP"][s];return e>0?(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"mx-1.5",children:"·"}),e,a]},a):null}),(0,t.jsx)("span",{className:"mx-1.5",children:"·"}),j?(0,T.getSpendString)(F):(0,T.getSpendString)(C.spend||0),j&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"mx-1.5",children:"·"}),Y,"s"]})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[et(I?.guardrail_information).length>0&&(0,t.jsx)("div",{className:"px-3 pt-2",children:(0,t.jsx)(eQ,{guardrailEntries:et(I?.guardrail_information)})}),j?(0,t.jsx)("div",{className:"py-1",children:(0,t.jsxs)("div",{className:"relative pl-2",children:[(0,t.jsx)("div",{className:"absolute left-4 top-1 bottom-1 border-l border-slate-300"}),W.map((e,s)=>{let a=s===W.length-1;return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute left-4 top-3 w-3 border-t border-slate-300"}),a&&(0,t.jsx)("div",{className:"absolute left-4 top-3 bottom-0 w-px bg-slate-50"}),(0,t.jsx)(e2,{row:e,isSelected:e.request_id===C.request_id,onClick:()=>{v(e.request_id),f?.(e)}})]},e.request_id)})]})}):(0,t.jsx)("div",{className:"py-1",children:W.map(e=>(0,t.jsx)(e2,{row:e,isSelected:e.request_id===C.request_id,onClick:()=>f?.(e)},e.request_id))})]})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsx)(p.DrawerHeader,{log:C,onClose:d,onPrevious:E,onNext:L,statusLabel:z,statusColor:P,environment:B}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(e$,{logEntry:R,isLoadingDetails:D,accessToken:u??null})})]})]})}):null}e.s(["LogDetailsDrawer",()=>e5],502626),e.s([],3565)},936190,e=>{"use strict";var t=e.i(843476),s=e.i(619273),a=e.i(266027),l=e.i(912598),r=e.i(166540),i=e.i(271645);e.i(517442),e.i(500330),e.i(122550);var n=e.i(772345),o=e.i(793130),d=e.i(197647),c=e.i(653824),x=e.i(881073),m=e.i(404206),u=e.i(723731),p=e.i(464571),h=e.i(708347),g=e.i(93648),f=e.i(245767),y=e.i(313793),j=e.i(50882),b=e.i(291950),v=e.i(969550),_=e.i(764205),N=e.i(20147),w=e.i(942161),S=e.i(245099);e.i(70969);var k=e.i(97859);e.i(70635),e.i(339086);var T=e.i(504809);e.i(3565);var C=e.i(502626);e.i(727749),e.i(867612);var L=e.i(149121);function E({accessToken:e,token:E,userRole:M,userID:A,premiumUser:D}){let[R,O]=(0,i.useState)(""),[I,z]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[F,H]=(0,i.useState)(1),[q]=(0,i.useState)(50),Y=(0,i.useRef)(null),K=(0,i.useRef)(null),$=(0,i.useRef)(null),[U,W]=(0,i.useState)((0,r.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[V,G]=(0,i.useState)((0,r.default)().format("YYYY-MM-DDTHH:mm")),[J,Q]=(0,i.useState)(!1),[X,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(""),[es,ea]=(0,i.useState)(""),[el,er]=(0,i.useState)(""),[ei,en]=(0,i.useState)(""),[eo,ed]=(0,i.useState)(""),[ec,ex]=(0,i.useState)(null),[em,eu]=(0,i.useState)(null),[ep,eh]=(0,i.useState)(""),[eg,ef]=(0,i.useState)(""),[ey,ej]=(0,i.useState)(M&&h.internalUserRoles.includes(M)),[eb,ev]=(0,i.useState)("request logs"),[e_,eN]=(0,i.useState)(null),[ew,eS]=(0,i.useState)(!1),[ek,eT]=(0,i.useState)(null),[eC,eL]=(0,i.useState)("startTime"),[eE,eM]=(0,i.useState)("desc"),[eA,eD]=(0,i.useState)(!0);(0,l.useQueryClient)();let[eR,eO]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eR))},[eR]);let[eI,ez]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{em&&e&&ex({...(await (0,_.keyInfoV1Call)(e,em)).info,token:em,api_key:em})})()},[em,e]),(0,i.useEffect)(()=>{function e(e){Y.current&&!Y.current.contains(e.target)&&B(!1),K.current&&!K.current.contains(e.target)&&z(!1),$.current&&!$.current.contains(e.target)&&Z(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{M&&h.internalUserRoles.includes(M)&&ej(!0)},[M]);let eP=(0,a.useQuery)({queryKey:["logs","table",F,q,U,V,el,ei,ey?A:null,ep,eo,eC,eE],queryFn:async()=>{if(!e||!E||!M||!A)return{data:[],total:0,page:1,page_size:q,total_pages:0};let t=(0,r.default)(U).utc().format("YYYY-MM-DD HH:mm:ss"),s=J?(0,r.default)(V).utc().format("YYYY-MM-DD HH:mm:ss"):(0,r.default)().utc().format("YYYY-MM-DD HH:mm:ss");return await (0,_.uiSpendLogsCall)({accessToken:e,start_date:t,end_date:s,page:F,page_size:q,params:{api_key:ei||void 0,team_id:el||void 0,user_id:ey?A??void 0:void 0,end_user:eg||void 0,status_filter:ep||void 0,model_id:eo||void 0,sort_by:eC,sort_order:eE}})},enabled:!!e&&!!E&&!!M&&!!A&&"request logs"===eb&&eA,refetchInterval:!!eR&&1===F&&15e3,placeholderData:s.keepPreviousData,refetchIntervalInBackground:!0}),eB=(0,i.useDeferredValue)(eP.isFetching),eF=eP.isFetching||eB,eH=eP.data||{data:[],total:0,page:1,page_size:q||10,total_pages:1},{filters:eq,filteredLogs:eY,hasBackendFilters:eK,allTeams:e$,handleFilterChange:eU,handleFilterReset:eW,refetchWithFilters:eV}=(0,T.useLogFilterLogic)({logs:eH,accessToken:e,startTime:U,endTime:V,pageSize:q,isCustomDate:J,setCurrentPage:H,userID:A,userRole:M,sortBy:eC,sortOrder:eE,currentPage:F}),eG=(0,i.useCallback)(()=>{eW(),W((0,r.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),G((0,r.default)().format("YYYY-MM-DDTHH:mm")),Q(!1),ez({value:24,unit:"hours"}),H(1)},[eW]);if((0,i.useEffect)(()=>{eD(!eK)},[eK]),(0,i.useEffect)(()=>{e&&(eq["Team ID"]?er(eq["Team ID"]):er(""),eh(eq.Status||""),ed(eq.Model||""),ef(eq["End User"]||""),en(eq["Key Hash"]||""))},[eq,e]),!e||!E||!M||!A)return null;let eJ=eY.data.filter(e=>!R||e.request_id.includes(R)||e.model.includes(R)||e.user&&e.user.includes(R)),eQ=eJ.reduce((e,t)=>(t.session_id&&(e[t.session_id]||(e[t.session_id]={llm:0,agent:0,mcp:0}),k.MCP_CALL_TYPES.includes(t.call_type)?e[t.session_id].mcp+=1:k.AGENT_CALL_TYPES.includes(t.call_type)?e[t.session_id].agent+=1:e[t.session_id].llm+=1),e),{}),eX=new Map;for(let e of eJ){if(!e.session_id||1>=(e.session_total_count||1))continue;let t=k.MCP_CALL_TYPES.includes(e.call_type),s=eX.get(e.session_id);s&&(!s.isMcp||t)||eX.set(e.session_id,{requestId:e.request_id,isMcp:t})}let eZ=eJ.map(e=>{let t=e.session_id?eQ[e.session_id]:void 0;return{...e,request_duration_ms:e.request_duration_ms,session_llm_count:t?.llm??void 0,session_mcp_count:t?.mcp??void 0,session_agent_count:t?.agent??void 0,onKeyHashClick:e=>eu(e),onSessionClick:t=>{t&&(eT(t),eN(e),eS(!0))}}}).filter(e=>!e.session_id||1>=(e.session_total_count||1)||eX.get(e.session_id)?.requestId===e.request_id)||[],e0=[{name:"Team ID",label:"Team ID",customComponent:y.default},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",customComponent:b.PaginatedModelSelect},{name:T.FILTER_KEYS.PUBLIC_MODEL_OR_SEARCH_TOOL,label:"Public model / search tool",isSearchable:!1},{name:"Key Alias",label:"Key Alias",customComponent:j.PaginatedKeyAliasSelect},{name:"End User",label:"End User",isSearchable:!0,searchFn:async t=>{if(!e)return[];let s=await (0,_.allEndUsersCall)(e);return(s?.map(e=>e.user_id)||[]).filter(e=>e.toLowerCase().includes(t.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Error Code",label:"Error Code",isSearchable:!0,searchFn:async e=>{if(!e)return k.ERROR_CODE_OPTIONS;let t=e.toLowerCase(),s=k.ERROR_CODE_OPTIONS.filter(e=>e.label.toLowerCase().includes(t));return!k.ERROR_CODE_OPTIONS.some(t=>t.value===e.trim())&&e.trim()&&s.push({label:`Use custom code: ${e.trim()}`,value:e.trim()}),s}},{name:"Key Hash",label:"Key Hash",isSearchable:!1},{name:"Error Message",label:"Error Message",isSearchable:!1}],e1=k.QUICK_SELECT_OPTIONS.find(e=>e.value===eI.value&&e.unit===eI.unit),e2=J?((e,t,s)=>{if(e)return`${(0,r.default)(t).format("MMM D, h:mm A")} - ${(0,r.default)(s).format("MMM D, h:mm A")}`;let a=(0,r.default)(),l=(0,r.default)(t),i=a.diff(l,"minutes");if(i>=0&&i<2)return"Last 1 Minute";if(i>=2&&i<16)return"Last 15 Minutes";if(i>=16&&i<61)return"Last Hour";let n=a.diff(l,"hours");return n>=1&&n<5?"Last 4 Hours":n>=5&&n<25?"Last 24 Hours":n>=25&&n<169?"Last 7 Days":`${l.format("MMM D")} - ${a.format("MMM D")}`})(J,U,V):e1?.label;return(0,t.jsxs)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:[(0,t.jsxs)(c.TabGroup,{defaultIndex:0,onIndexChange:e=>ev(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(x.TabList,{children:[(0,t.jsx)(d.Tab,{children:"Request Logs"}),(0,t.jsx)(d.Tab,{children:"Audit Logs"}),(0,t.jsx)(d.Tab,{children:"Deleted Keys"}),(0,t.jsx)(d.Tab,{children:"Deleted Teams"})]}),(0,t.jsxs)(u.TabPanels,{children:[(0,t.jsxs)(m.TabPanel,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Request Logs"})}),ec&&em&&ec.api_key===em?(0,t.jsx)(N.default,{keyId:em,keyData:ec,teams:e$??[],onClose:()=>eu(null),backButtonText:"Back to Logs"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.default,{options:e0,onApplyFilters:eU,onResetFilters:eG}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 w-full max-w-full box-border",children:[(0,t.jsxs)("div",{className:"relative w-64 min-w-0 flex-shrink-0",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:R,onChange:e=>O(e.target.value)}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[(0,t.jsxs)("div",{className:"relative z-50",ref:$,children:[(0,t.jsxs)("button",{onClick:()=>Z(!X),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),e2]}),X&&(0,t.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,t.jsxs)("div",{className:"space-y-1",children:[k.QUICK_SELECT_OPTIONS.map(e=>(0,t.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${e2===e.label?"bg-blue-50 text-blue-600":""}`,onClick:()=>{H(1),G((0,r.default)().format("YYYY-MM-DDTHH:mm")),W((0,r.default)().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),ez({value:e.value,unit:e.unit}),Q(!1),Z(!1)},children:e.label},e.label)),(0,t.jsx)("div",{className:"border-t my-2"}),(0,t.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${J?"bg-blue-50 text-blue-600":""}`,onClick:()=>Q(!J),children:"Custom Range"})]})})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,t.jsx)(o.Switch,{color:"green",checked:eR,defaultChecked:!0,onChange:eO})]}),{}),(0,t.jsx)(p.Button,{type:"default",icon:(0,t.jsx)(n.SyncOutlined,{spin:eF}),onClick:()=>{eK?eV():eP.refetch()},disabled:eF,title:"Fetch data",children:eF?"Fetching":"Fetch"})]}),J&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:U,onChange:e=>{W(e.target.value),H(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,t.jsx)("span",{className:"text-gray-500",children:"to"}),(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:V,onChange:e=>{G(e.target.value),H(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700 whitespace-nowrap",children:["Showing ",eP.isLoading?"...":eY?(F-1)*q+1:0," -"," ",eP.isLoading?"...":eY?Math.min(F*q,eY.total):0," ","of ",eP.isLoading?"...":eY?eY.total:0," results"]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700 min-w-[90px]",children:["Page ",eP.isLoading?"...":F," of"," ",eP.isLoading?"...":eY?eY.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>H(e=>Math.max(1,e-1)),disabled:eP.isLoading||1===F,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,t.jsx)("button",{onClick:()=>H(e=>Math.min(eY.total_pages||1,e+1)),disabled:eP.isLoading||F===(eY.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),eR&&1===F&&eA&&(0,t.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,t.jsx)("button",{onClick:()=>eO(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(L.DataTable,{columns:(0,S.createColumns)({sortBy:eC,sortOrder:eE,onSortChange:(e,t)=>{eL(e),eM(t),H(1)}}),data:eZ,onRowClick:e=>{if(e.session_id&&(e.session_total_count||1)>1){eT(e.session_id),eN(e),eS(!0);return}eT(null),eN(e),eS(!0)},isLoading:eP.isLoading})]})]})]}),(0,t.jsx)(m.TabPanel,{children:(0,t.jsx)(w.default,{userID:A,userRole:M,token:E,accessToken:e,isActive:"audit logs"===eb,premiumUser:D})}),(0,t.jsx)(m.TabPanel,{children:(0,t.jsx)(g.default,{})}),(0,t.jsx)(m.TabPanel,{children:(0,t.jsx)(f.default,{})})]})]}),(0,t.jsx)(C.LogDetailsDrawer,{open:ew,onClose:()=>{eS(!1),eT(null)},logEntry:e_,sessionId:ek,accessToken:e,allLogs:eZ,onSelectLog:e=>{eN(e)},startTime:(0,r.default)(U).utc().format("YYYY-MM-DD HH:mm:ss")})]})}e.i(331052),e.s(["default",()=>E],936190)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/18a9536fce05dc33.js b/litellm/proxy/_experimental/out/_next/static/chunks/18a9536fce05dc33.js
new file mode 100644
index 0000000000..44c16bf352
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/18a9536fce05dc33.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,991124,e=>{"use strict";let t=(0,e.i(475254).default)("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"}]]);e.s(["default",()=>t])},94629,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});e.s(["SwitchVerticalIcon",0,r],94629)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),n=e.i(444755),o=e.i(673706),i=e.i(271645);let a=i.default.forwardRef((e,a)=>{let{color:l,children:s,className:c}=e,d=(0,t.__rest)(e,["color","children","className"]);return i.default.createElement("p",Object.assign({ref:a,className:(0,n.tremorTwMerge)("font-medium text-tremor-title",l?(0,o.getColorClassNames)(l,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},d),s)});a.displayName="Title",e.s(["Title",()=>a],629569)},56456,e=>{"use strict";var t=e.i(739295);e.s(["LoadingOutlined",()=>t.default])},309821,e=>{"use strict";e.i(247167);var t=e.i(271645);e.i(262370);var r=e.i(135551),n=e.i(201072),o=e.i(121229),i=e.i(726289),a=e.i(864517),l=e.i(343794),s=e.i(529681),c=e.i(242064),d=e.i(931067),u=e.i(209428),g=e.i(703923),m={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},p=function(){var e=(0,t.useRef)([]),r=(0,t.useRef)(null);return(0,t.useEffect)(function(){var t=Date.now(),n=!1;e.current.forEach(function(e){if(e){n=!0;var o=e.style;o.transitionDuration=".3s, .3s, .3s, .06s",r.current&&t-r.current<100&&(o.transitionDuration="0s, 0s")}}),n&&(r.current=Date.now())}),e.current},f=e.i(410160),h=e.i(392221),b=e.i(654310),y=0,$=(0,b.default)();let v=function(e){var r=t.useState(),n=(0,h.default)(r,2),o=n[0],i=n[1];return t.useEffect(function(){var e;i("rc_progress_".concat(($?(e=y,y+=1):e="TEST_OR_SSR",e)))},[]),e||o};var x=function(e){var r=e.bg,n=e.children;return t.createElement("div",{style:{width:"100%",height:"100%",background:r}},n)};function k(e,t){return Object.keys(e).map(function(r){var n=parseFloat(r),o="".concat(Math.floor(n*t),"%");return"".concat(e[r]," ").concat(o)})}var w=t.forwardRef(function(e,r){var n=e.prefixCls,o=e.color,i=e.gradientId,a=e.radius,l=e.style,s=e.ptg,c=e.strokeLinecap,d=e.strokeWidth,u=e.size,g=e.gapDegree,m=o&&"object"===(0,f.default)(o),p=u/2,h=t.createElement("circle",{className:"".concat(n,"-circle-path"),r:a,cx:p,cy:p,stroke:m?"#FFF":void 0,strokeLinecap:c,strokeWidth:d,opacity:+(0!==s),style:l,ref:r});if(!m)return h;var b="".concat(i,"-conic"),y=k(o,(360-g)/360),$=k(o,1),v="conic-gradient(from ".concat(g?"".concat(180+g/2,"deg"):"0deg",", ").concat(y.join(", "),")"),w="linear-gradient(to ".concat(g?"bottom":"top",", ").concat($.join(", "),")");return t.createElement(t.Fragment,null,t.createElement("mask",{id:b},h),t.createElement("foreignObject",{x:0,y:0,width:u,height:u,mask:"url(#".concat(b,")")},t.createElement(x,{bg:w},t.createElement(x,{bg:v}))))}),C=function(e,t,r,n,o,i,a,l,s,c){var d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,u=(100-n)/100*t;return"round"===s&&100!==n&&(u+=c/2)>=t&&(u=t-.01),{stroke:"string"==typeof l?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:u+d,transform:"rotate(".concat(o+r/100*360*((360-i)/360)+(0===i?0:({bottom:0,top:180,left:90,right:-90})[a]),"deg)"),transformOrigin:"".concat(50,"px ").concat(50,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},S=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function E(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}let O=function(e){var r,n,o,i,a=(0,u.default)((0,u.default)({},m),e),s=a.id,c=a.prefixCls,h=a.steps,b=a.strokeWidth,y=a.trailWidth,$=a.gapDegree,x=void 0===$?0:$,k=a.gapPosition,O=a.trailColor,j=a.strokeLinecap,z=a.style,N=a.className,I=a.strokeColor,M=a.percent,T=(0,g.default)(a,S),P=v(s),W="".concat(P,"-gradient"),B=50-b/2,A=2*Math.PI*B,R=x>0?90+x/2:-90,D=(360-x)/360*A,L="object"===(0,f.default)(h)?h:{count:h,gap:2},X=L.count,F=L.gap,H=E(M),_=E(I),Y=_.find(function(e){return e&&"object"===(0,f.default)(e)}),V=Y&&"object"===(0,f.default)(Y)?"butt":j,G=C(A,D,0,100,R,x,k,O,V,b),K=p();return t.createElement("svg",(0,d.default)({className:(0,l.default)("".concat(c,"-circle"),N),viewBox:"0 0 ".concat(100," ").concat(100),style:z,id:s,role:"presentation"},T),!X&&t.createElement("circle",{className:"".concat(c,"-circle-trail"),r:B,cx:50,cy:50,stroke:O,strokeLinecap:V,strokeWidth:y||b,style:G}),X?(r=Math.round(X*(H[0]/100)),n=100/X,o=0,Array(X).fill(null).map(function(e,i){var a=i<=r-1?_[0]:O,l=a&&"object"===(0,f.default)(a)?"url(#".concat(W,")"):void 0,s=C(A,D,o,n,R,x,k,a,"butt",b,F);return o+=(D-s.strokeDashoffset+F)*100/D,t.createElement("circle",{key:i,className:"".concat(c,"-circle-path"),r:B,cx:50,cy:50,stroke:l,strokeWidth:b,opacity:1,style:s,ref:function(e){K[i]=e}})})):(i=0,H.map(function(e,r){var n=_[r]||_[_.length-1],o=C(A,D,i,e,R,x,k,n,V,b);return i+=e,t.createElement(w,{key:r,color:n,ptg:e,radius:B,prefixCls:c,gradientId:W,style:o,strokeLinecap:V,strokeWidth:b,gapDegree:x,ref:function(e){K[r]=e},size:100})}).reverse()))};var j=e.i(491816);e.i(765846);var z=e.i(896091);function N(e){return!e||e<0?0:e>100?100:e}function I({success:e,successPercent:t}){let r=t;return e&&"progress"in e&&(r=e.progress),e&&"percent"in e&&(r=e.percent),r}let M=(e,t,r)=>{var n,o,i,a;let l=-1,s=-1;if("step"===t){let t=r.steps,n=r.strokeWidth;"string"==typeof e||void 0===e?(l="small"===e?2:14,s=null!=n?n:8):"number"==typeof e?[l,s]=[e,e]:[l=14,s=8]=Array.isArray(e)?e:[e.width,e.height],l*=t}else if("line"===t){let t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?s=t||("small"===e?6:8):"number"==typeof e?[l,s]=[e,e]:[l=-1,s=8]=Array.isArray(e)?e:[e.width,e.height]}else("circle"===t||"dashboard"===t)&&("string"==typeof e||void 0===e?[l,s]="small"===e?[60,60]:[120,120]:"number"==typeof e?[l,s]=[e,e]:Array.isArray(e)&&(l=null!=(o=null!=(n=e[0])?n:e[1])?o:120,s=null!=(a=null!=(i=e[0])?i:e[1])?a:120));return[l,s]},T=e=>{let{prefixCls:r,trailColor:n=null,strokeLinecap:o="round",gapPosition:i,gapDegree:a,width:s=120,type:c,children:d,success:u,size:g=s,steps:m}=e,[p,f]=M(g,"circle"),{strokeWidth:h}=e;void 0===h&&(h=Math.max(3/p*100,6));let b=t.useMemo(()=>a||0===a?a:"dashboard"===c?75:void 0,[a,c]),y=(({percent:e,success:t,successPercent:r})=>{let n=N(I({success:t,successPercent:r}));return[n,N(N(e)-n)]})(e),$="[object Object]"===Object.prototype.toString.call(e.strokeColor),v=(({success:e={},strokeColor:t})=>{let{strokeColor:r}=e;return[r||z.presetPrimaryColors.green,t||null]})({success:u,strokeColor:e.strokeColor}),x=(0,l.default)(`${r}-inner`,{[`${r}-circle-gradient`]:$}),k=t.createElement(O,{steps:m,percent:m?y[1]:y,strokeWidth:h,trailWidth:h,strokeColor:m?v[1]:v,strokeLinecap:o,trailColor:n,prefixCls:r,gapDegree:b,gapPosition:i||"dashboard"===c&&"bottom"||void 0}),w=p<=20,C=t.createElement("div",{className:x,style:{width:p,height:f,fontSize:.15*p+6}},k,!w&&d);return w?t.createElement(j.default,{title:d},C):C};e.i(296059);var P=e.i(694758),W=e.i(915654),B=e.i(183293),A=e.i(246422),R=e.i(838378);let D="--progress-line-stroke-color",L="--progress-percent",X=e=>{let t=e?"100%":"-100%";return new P.Keyframes(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},F=(0,A.genStyleHooks)("Progress",e=>{let t=e.calc(e.marginXXS).div(2).equal(),r=(0,R.mergeToken)(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,B.resetComponent)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${D})`]},height:"100%",width:`calc(1 / var(${L}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${(0,W.unit)(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:X(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:X(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}})(r),(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}})(r),(e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}})(r),(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}})(r)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}));var H=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let _=e=>{let{prefixCls:r,direction:n,percent:o,size:i,strokeWidth:a,strokeColor:s,strokeLinecap:c="round",children:d,trailColor:u=null,percentPosition:g,success:m}=e,{align:p,type:f}=g,h=s&&"string"!=typeof s?((e,t)=>{let{from:r=z.presetPrimaryColors.blue,to:n=z.presetPrimaryColors.blue,direction:o="rtl"===t?"to left":"to right"}=e,i=H(e,["from","to","direction"]);if(0!==Object.keys(i).length){let e,t=(e=[],Object.keys(i).forEach(t=>{let r=Number.parseFloat(t.replace(/%/g,""));Number.isNaN(r)||e.push({key:r,value:i[t]})}),(e=e.sort((e,t)=>e.key-t.key)).map(({key:e,value:t})=>`${t} ${e}%`).join(", ")),r=`linear-gradient(${o}, ${t})`;return{background:r,[D]:r}}let a=`linear-gradient(${o}, ${r}, ${n})`;return{background:a,[D]:a}})(s,n):{[D]:s,background:s},b="square"===c||"butt"===c?0:void 0,[y,$]=M(null!=i?i:[-1,a||("small"===i?6:8)],"line",{strokeWidth:a}),v=Object.assign(Object.assign({width:`${N(o)}%`,height:$,borderRadius:b},h),{[L]:N(o)/100}),x=I(e),k={width:`${N(x)}%`,height:$,borderRadius:b,backgroundColor:null==m?void 0:m.strokeColor},w=t.createElement("div",{className:`${r}-inner`,style:{backgroundColor:u||void 0,borderRadius:b}},t.createElement("div",{className:(0,l.default)(`${r}-bg`,`${r}-bg-${f}`),style:v},"inner"===f&&d),void 0!==x&&t.createElement("div",{className:`${r}-success-bg`,style:k})),C="outer"===f&&"start"===p,S="outer"===f&&"end"===p;return"outer"===f&&"center"===p?t.createElement("div",{className:`${r}-layout-bottom`},w,d):t.createElement("div",{className:`${r}-outer`,style:{width:y<0?"100%":y}},C&&d,w,S&&d)},Y=e=>{let{size:r,steps:n,rounding:o=Math.round,percent:i=0,strokeWidth:a=8,strokeColor:s,trailColor:c=null,prefixCls:d,children:u}=e,g=o(i/100*n),[m,p]=M(null!=r?r:["small"===r?2:14,a],"step",{steps:n,strokeWidth:a}),f=m/n,h=Array.from({length:n});for(let e=0;et.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let G=["normal","exception","active","success"],K=t.forwardRef((e,d)=>{let u,{prefixCls:g,className:m,rootClassName:p,steps:f,strokeColor:h,percent:b=0,size:y="default",showInfo:$=!0,type:v="line",status:x,format:k,style:w,percentPosition:C={}}=e,S=V(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:E="end",type:O="outer"}=C,j=Array.isArray(h)?h[0]:h,z="string"==typeof h||Array.isArray(h)?h:void 0,P=t.useMemo(()=>{if(j){let e="string"==typeof j?j:Object.values(j)[0];return new r.FastColor(e).isLight()}return!1},[h]),W=t.useMemo(()=>{var t,r;let n=I(e);return Number.parseInt(void 0!==n?null==(t=null!=n?n:0)?void 0:t.toString():null==(r=null!=b?b:0)?void 0:r.toString(),10)},[b,e.success,e.successPercent]),B=t.useMemo(()=>!G.includes(x)&&W>=100?"success":x||"normal",[x,W]),{getPrefixCls:A,direction:R,progress:D}=t.useContext(c.ConfigContext),L=A("progress",g),[X,H,K]=F(L),U="line"===v,q=U&&!f,Q=t.useMemo(()=>{let r;if(!$)return null;let s=I(e),c=k||(e=>`${e}%`),d=U&&P&&"inner"===O;return"inner"===O||k||"exception"!==B&&"success"!==B?r=c(N(b),N(s)):"exception"===B?r=U?t.createElement(i.default,null):t.createElement(a.default,null):"success"===B&&(r=U?t.createElement(n.default,null):t.createElement(o.default,null)),t.createElement("span",{className:(0,l.default)(`${L}-text`,{[`${L}-text-bright`]:d,[`${L}-text-${E}`]:q,[`${L}-text-${O}`]:q}),title:"string"==typeof r?r:void 0},r)},[$,b,W,B,v,L,k]);"line"===v?u=f?t.createElement(Y,Object.assign({},e,{strokeColor:z,prefixCls:L,steps:"object"==typeof f?f.count:f}),Q):t.createElement(_,Object.assign({},e,{strokeColor:j,prefixCls:L,direction:R,percentPosition:{align:E,type:O}}),Q):("circle"===v||"dashboard"===v)&&(u=t.createElement(T,Object.assign({},e,{strokeColor:j,prefixCls:L,progressStatus:B}),Q));let J=(0,l.default)(L,`${L}-status-${B}`,{[`${L}-${"dashboard"===v&&"circle"||v}`]:"line"!==v,[`${L}-inline-circle`]:"circle"===v&&M(y,"circle")[0]<=20,[`${L}-line`]:q,[`${L}-line-align-${E}`]:q,[`${L}-line-position-${O}`]:q,[`${L}-steps`]:f,[`${L}-show-info`]:$,[`${L}-${y}`]:"string"==typeof y,[`${L}-rtl`]:"rtl"===R},null==D?void 0:D.className,m,p,H,K);return X(t.createElement("div",Object.assign({ref:d,style:Object.assign(Object.assign({},null==D?void 0:D.style),w),className:J,role:"progressbar","aria-valuenow":W,"aria-valuemin":0,"aria-valuemax":100},(0,s.default)(S,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),u))});e.s(["default",0,K],309821)},68155,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});e.s(["TrashIcon",0,r],68155)},360820,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});e.s(["ChevronUpIcon",0,r],360820)},871943,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});e.s(["ChevronDownIcon",0,r],871943)},801312,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var o=e.i(9583),i=r.forwardRef(function(e,i){return r.createElement(o.default,(0,t.default)({},e,{ref:i,icon:n}))});e.s(["default",0,i],801312)},389083,e=>{"use strict";var t=e.i(290571),r=e.i(271645),n=e.i(829087),o=e.i(480731),i=e.i(95779),a=e.i(444755),l=e.i(673706);let s={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"}},c={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"}},d=(0,l.makeClassName)("Badge"),u=r.default.forwardRef((e,u)=>{let{color:g,icon:m,size:p=o.Sizes.SM,tooltip:f,className:h,children:b}=e,y=(0,t.__rest)(e,["color","icon","size","tooltip","className","children"]),$=m||null,{tooltipProps:v,getReferenceProps:x}=(0,n.useTooltip)();return r.default.createElement("span",Object.assign({ref:(0,l.mergeRefs)([u,v.refs.setReference]),className:(0,a.tremorTwMerge)(d("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",g?(0,a.tremorTwMerge)((0,l.getColorClassNames)(g,i.colorPalette.background).bgColor,(0,l.getColorClassNames)(g,i.colorPalette.iconText).textColor,(0,l.getColorClassNames)(g,i.colorPalette.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):(0,a.tremorTwMerge)("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),s[p].paddingX,s[p].paddingY,s[p].fontSize,h)},x,y),r.default.createElement(n.default,Object.assign({text:f},v)),$?r.default.createElement($,{className:(0,a.tremorTwMerge)(d("icon"),"shrink-0 -ml-1 mr-1.5",c[p].height,c[p].width)}):null,r.default.createElement("span",{className:(0,a.tremorTwMerge)(d("text"),"whitespace-nowrap")},b))});u.displayName="Badge",e.s(["Badge",()=>u],389083)},312361,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(242064),o=e.i(517455);e.i(296059);var i=e.i(915654),a=e.i(183293),l=e.i(246422),s=e.i(838378);let c=(0,l.genStyleHooks)("Divider",e=>{let t=(0,s.mergeToken)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[(e=>{let{componentCls:t,sizePaddingEdgeHorizontal:r,colorSplit:n,lineWidth:o,textPaddingInline:l,orientationMargin:s,verticalMarginInline:c}=e;return{[t]:Object.assign(Object.assign({},(0,a.resetComponent)(e)),{borderBlockStart:`${(0,i.unit)(o)} solid ${n}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${(0,i.unit)(o)} solid ${n}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${(0,i.unit)(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${(0,i.unit)(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${n}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${(0,i.unit)(o)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-start`]:{"&::before":{width:`calc(${s} * 100%)`},"&::after":{width:`calc(100% - ${s} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{"&::before":{width:`calc(100% - ${s} * 100%)`},"&::after":{width:`calc(${s} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:l},"&-dashed":{background:"none",borderColor:n,borderStyle:"dashed",borderWidth:`${(0,i.unit)(o)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:n,borderStyle:"dotted",borderWidth:`${(0,i.unit)(o)} 0 0`},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:r}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:r}}})}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}})(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}});var d=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let u={small:"sm",middle:"md"};e.s(["Divider",0,e=>{let{getPrefixCls:i,direction:a,className:l,style:s}=(0,n.useComponentConfig)("divider"),{prefixCls:g,type:m="horizontal",orientation:p="center",orientationMargin:f,className:h,rootClassName:b,children:y,dashed:$,variant:v="solid",plain:x,style:k,size:w}=e,C=d(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),S=i("divider",g),[E,O,j]=c(S),z=u[(0,o.default)(w)],N=!!y,I=t.useMemo(()=>"left"===p?"rtl"===a?"end":"start":"right"===p?"rtl"===a?"start":"end":p,[a,p]),M="start"===I&&null!=f,T="end"===I&&null!=f,P=(0,r.default)(S,l,O,j,`${S}-${m}`,{[`${S}-with-text`]:N,[`${S}-with-text-${I}`]:N,[`${S}-dashed`]:!!$,[`${S}-${v}`]:"solid"!==v,[`${S}-plain`]:!!x,[`${S}-rtl`]:"rtl"===a,[`${S}-no-default-orientation-margin-start`]:M,[`${S}-no-default-orientation-margin-end`]:T,[`${S}-${z}`]:!!z},h,b),W=t.useMemo(()=>"number"==typeof f?f:/^\d+$/.test(f)?Number(f):f,[f]);return E(t.createElement("div",Object.assign({className:P,style:Object.assign(Object.assign({},s),k)},C,{role:"separator"}),y&&"vertical"!==m&&t.createElement("span",{className:`${S}-inner-text`,style:{marginInlineStart:M?W:void 0,marginInlineEnd:T?W:void 0}},y)))}],312361)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1ab44e07f0b1cd5e.js b/litellm/proxy/_experimental/out/_next/static/chunks/1ab44e07f0b1cd5e.js
new file mode 100644
index 0000000000..2d85188939
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/1ab44e07f0b1cd5e.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94629,e=>{"use strict";var t=e.i(271645);let l=t.forwardRef(function(e,l){return t.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:l},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});e.s(["SwitchVerticalIcon",0,l],94629)},492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),l=e.i(271645);let a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var s=e.i(9583),r=l.forwardRef(function(e,r){return l.createElement(s.default,(0,t.default)({},e,{ref:r,icon:a}))});e.s(["ArrowLeftOutlined",0,r],447566)},633627,e=>{"use strict";var t=e.i(764205);let l=(e,t,l,a)=>{for(let s of e){let e=s?.key_alias;e&&"string"==typeof e&&t.add(e.trim());let r=s?.organization_id??s?.org_id;r&&"string"==typeof r&&l.add(r.trim());let i=s?.user_id;if(i&&"string"==typeof i){let e=s?.user?.user_email||i;a.set(i,e)}}},a=async(e,a)=>{if(!e||!a)return{keyAliases:[],organizationIds:[],userIds:[]};try{let s=new Set,r=new Set,i=new Map,n=await (0,t.keyListCall)(e,null,a,null,null,null,1,100,null,null,"user",null),o=n?.keys||[],c=n?.total_pages??1;l(o,s,r,i);let d=Math.min(c,10)-1;if(d>0){let n=Array.from({length:d},(l,s)=>(0,t.keyListCall)(e,null,a,null,null,null,s+2,100,null,null,"user",null));for(let e of(await Promise.allSettled(n)))"fulfilled"===e.status&&l(e.value?.keys||[],s,r,i)}return{keyAliases:Array.from(s).sort(),organizationIds:Array.from(r).sort(),userIds:Array.from(i.entries()).map(([e,t])=>({id:e,email:t}))}}catch(e){return console.error("Error fetching team filter options:",e),{keyAliases:[],organizationIds:[],userIds:[]}}},s=async(e,l)=>{if(!e)return[];try{let a=[],s=1,r=!0;for(;r;){let i=await (0,t.teamListCall)(e,l||null,null);a=[...a,...i],s{if(!e)return[];try{let l=[],a=1,s=!0;for(;s;){let r=await (0,t.organizationListCall)(e);l=[...l,...r],a{"use strict";var t=e.i(843476),l=e.i(271645);let a=l.forwardRef(function(e,t){return l.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),l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))});var s=e.i(464571),r=e.i(311451),i=e.i(199133),n=e.i(374009);e.s(["default",0,({options:e,onApplyFilters:o,onResetFilters:c,initialValues:d={},buttonLabel:u="Filters"})=>{let[m,g]=(0,l.useState)(!1),[h,x]=(0,l.useState)(d),[f,p]=(0,l.useState)({}),[y,w]=(0,l.useState)({}),[v,j]=(0,l.useState)({}),[S,b]=(0,l.useState)({}),_=(0,l.useCallback)((0,n.default)(async(e,t)=>{if(t.isSearchable&&t.searchFn){w(e=>({...e,[t.name]:!0}));try{let l=await t.searchFn(e);p(e=>({...e,[t.name]:l}))}catch(e){console.error("Error searching:",e),p(e=>({...e,[t.name]:[]}))}finally{w(e=>({...e,[t.name]:!1}))}}},300),[]),k=(0,l.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!S[e.name]){w(t=>({...t,[e.name]:!0})),b(t=>({...t,[e.name]:!0}));try{let t=await e.searchFn("");p(l=>({...l,[e.name]:t}))}catch(t){console.error("Error loading initial options:",t),p(t=>({...t,[e.name]:[]}))}finally{w(t=>({...t,[e.name]:!1}))}}},[S]);(0,l.useEffect)(()=>{m&&e.forEach(e=>{e.isSearchable&&!S[e.name]&&k(e)})},[m,e,k,S]);let N=(e,t)=>{let l={...h,[e]:t};x(l),o(l)};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,t.jsx)(s.Button,{icon:(0,t.jsx)(a,{className:"h-4 w-4"}),onClick:()=>g(!m),className:"flex items-center gap-2",children:u}),(0,t.jsx)(s.Button,{onClick:()=>{let t={};e.forEach(e=>{t[e.name]=""}),x(t),c()},children:"Reset Filters"})]}),m&&(0,t.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Error Code","Error Message","Key Hash","Model","Public model / search tool"].map(l=>{let a,s=e.find(e=>e.label===l||e.name===l);return s?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:s.label||s.name}),s.isSearchable?(0,t.jsx)(i.Select,{showSearch:!0,className:"w-full",placeholder:`Search ${s.label||s.name}...`,value:h[s.name]||void 0,onChange:e=>N(s.name,e),onOpenChange:e=>{e&&s.isSearchable&&!S[s.name]&&k(s)},onSearch:e=>{j(t=>({...t,[s.name]:e})),s.searchFn&&_(e,s)},filterOption:!1,loading:y[s.name],options:f[s.name]||[],allowClear:!0,notFoundContent:y[s.name]?"Loading...":"No results found"}):s.options?(0,t.jsx)(i.Select,{className:"w-full",placeholder:`Select ${s.label||s.name}...`,value:h[s.name]||void 0,onChange:e=>N(s.name,e),allowClear:!0,children:s.options.map(e=>(0,t.jsx)(i.Select.Option,{value:e.value,children:e.label},e.value))}):s.customComponent?(a=s.customComponent,(0,t.jsx)(a,{value:h[s.name]||void 0,onChange:e=>N(s.name,e??""),placeholder:`Select ${s.label||s.name}...`,allFilters:h})):(0,t.jsx)(r.Input,{className:"w-full",placeholder:`Enter ${s.label||s.name}...`,value:h[s.name]||"",onChange:e=>N(s.name,e.target.value),allowClear:!0})]},s.name):null})})]})}],969550)},584578,e=>{"use strict";var t=e.i(764205);let l=async(e,l,a,s,r)=>{let i;i="Admin"!=a&&"Admin Viewer"!=a?await (0,t.teamListCall)(e,s?.organization_id||null,l):await (0,t.teamListCall)(e,s?.organization_id||null),console.log(`givenTeams: ${i}`),r(i)};e.s(["fetchTeams",0,l])},566606,e=>{"use strict";var t=e.i(843476),l=e.i(271645),a=e.i(618566),s=e.i(947293),r=e.i(764205),i=e.i(954616),n=e.i(266027),o=e.i(612256);let c=(0,e.i(243652).createQueryKeys)("onboarding");var d=e.i(268004),u=e.i(482725),m=e.i(56456);function g(){return(0,t.jsx)("div",{className:"mx-auto w-full max-w-md mt-10 flex justify-center",children:(0,t.jsx)(u.Spin,{indicator:(0,t.jsx)(m.LoadingOutlined,{spin:!0}),size:"large"})})}var h=e.i(560445),x=e.i(464571);function f(){return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-md mt-10",children:[(0,t.jsx)(h.Alert,{type:"error",message:"Failed to load invitation",description:"The invitation link may be invalid or expired.",showIcon:!0}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(x.Button,{href:"/ui/login",children:"Back to Login"})})]})}var p=e.i(175712),y=e.i(808613),w=e.i(311451),v=e.i(898586);function j({variant:e,userEmail:a,isPending:s,claimError:r,onSubmit:i}){let[n]=y.Form.useForm();return l.default.useEffect(()=>{a&&n.setFieldValue("user_email",a)},[a,n]),(0,t.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,t.jsxs)(p.Card,{children:[(0,t.jsx)(v.Typography.Title,{level:5,className:"text-center mb-5",children:"🚅 LiteLLM"}),(0,t.jsx)(v.Typography.Title,{level:3,children:"reset_password"===e?"Reset Password":"Sign Up"}),(0,t.jsx)(v.Typography.Text,{children:"reset_password"===e?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"signup"===e&&(0,t.jsx)(h.Alert,{className:"mt-4",type:"info",message:"SSO",description:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{children:"SSO is under the Enterprise Tier."}),(0,t.jsx)(x.Button,{type:"primary",size:"small",href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})]}),showIcon:!0}),(0,t.jsxs)(y.Form,{className:"mt-10 mb-5",layout:"vertical",form:n,onFinish:e=>i({password:e.password}),children:[(0,t.jsx)(y.Form.Item,{label:"Email Address",name:"user_email",children:(0,t.jsx)(w.Input,{type:"email",disabled:!0})}),(0,t.jsx)(y.Form.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===e?"Enter your new password":"Create a password for your account",children:(0,t.jsx)(w.Input.Password,{})}),r&&(0,t.jsx)(h.Alert,{type:"error",message:r,showIcon:!0,className:"mb-4"}),(0,t.jsx)("div",{className:"mt-10",children:(0,t.jsx)(x.Button,{htmlType:"submit",loading:s,children:"reset_password"===e?"Reset Password":"Sign Up"})})]})]})})}function S({variant:e}){let u=(0,a.useSearchParams)().get("invitation_id"),[m,h]=l.default.useState(null),{data:x,isLoading:p,isError:y}=(e=>{let{isLoading:t}=(0,o.useUIConfig)();return(0,n.useQuery)({queryKey:c.detail(e??""),queryFn:async()=>{if(!e)throw Error("inviteId is required");return(0,r.getOnboardingCredentials)(e)},enabled:!!e&&!t})})(u),{mutate:w,isPending:v}=(0,i.useMutation)({mutationFn:async({accessToken:e,inviteId:t,userId:l,password:a})=>await (0,r.claimOnboardingToken)(e,t,l,a)}),S=x?.token?(0,s.jwtDecode)(x.token):null,b=S?.user_email??"",_=S?.user_id??null,k=S?.key??null;return p?(0,t.jsx)(g,{}):y?(0,t.jsx)(f,{}):(0,t.jsx)(j,{variant:e,userEmail:b,isPending:v,claimError:m,onSubmit:e=>{k&&_&&u&&(h(null),w({accessToken:k,inviteId:u,userId:_,password:e.password},{onSuccess:e=>{if(!e?.token)return void h("Failed to start session. Please try again.");(0,d.clearTokenCookies)(),(0,d.storeLoginToken)(e.token);let t=(0,r.getProxyBaseUrl)();window.location.href=t?`${t}/ui/?login=success`:"/ui/?login=success"},onError:e=>{h(e.message||"Failed to submit. Please try again.")}}))}})}function b(){let e=(0,a.useSearchParams)().get("action");return(0,t.jsx)(S,{variant:"reset_password"===e?"reset_password":"signup"})}function _(){return(0,t.jsx)(l.Suspense,{fallback:(0,t.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:"Loading..."}),children:(0,t.jsx)(b,{})})}e.s(["default",()=>_],566606)},700514,e=>{"use strict";var t=e.i(271645);e.s(["defaultPageSize",0,25,"useBaseUrl",0,()=>{let[e,l]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:t}=window.location;l(`${e}//${t}`)}},[]),e}])},50882,e=>{"use strict";var t=e.i(843476),l=e.i(621482),a=e.i(243652),s=e.i(764205),r=e.i(135214);let i=(0,a.createQueryKeys)("infiniteKeyAliases");var n=e.i(56456),o=e.i(152473),c=e.i(199133),d=e.i(271645);e.s(["PaginatedKeyAliasSelect",0,({value:e,onChange:a,placeholder:u="Select a key alias",style:m,pageSize:g=50,allowClear:h=!0,disabled:x=!1,allFilters:f})=>{let[p,y]=(0,d.useState)(""),[w,v]=(0,o.useDebouncedState)("",{wait:300}),{data:j,fetchNextPage:S,hasNextPage:b,isFetchingNextPage:_,isLoading:k}=((e=50,t,a)=>{let{accessToken:n}=(0,r.default)();return(0,l.useInfiniteQuery)({queryKey:i.list({filters:{size:e,...t&&{search:t},...a&&{team_id:a}}}),queryFn:async({pageParam:l})=>await (0,s.keyAliasesCall)(n,l,e,t,a),initialPageParam:1,getNextPageParam:e=>{if(e.current_page{if(!j?.pages)return[];let e=new Set,t=[];for(let l of j.pages)for(let a of l.aliases)!a||e.has(a)||(e.add(a),t.push({label:a,value:a}));return t},[j]);return(0,t.jsx)(c.Select,{value:e||void 0,onChange:e=>{a?.(e??"")},placeholder:u,style:{width:"100%",...m},allowClear:h,disabled:x,showSearch:!0,filterOption:!1,onSearch:e=>{y(e),v(e)},searchValue:p,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&b&&!_&&S()},loading:k,notFoundContent:k?(0,t.jsx)(n.LoadingOutlined,{spin:!0}):"No key aliases found",options:N,popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,_&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(n.LoadingOutlined,{spin:!0})})]})})}],50882)},693569,e=>{"use strict";var t=e.i(843476),l=e.i(268004),a=e.i(309426),s=e.i(350967),r=e.i(947293),i=e.i(618566),n=e.i(271645),o=e.i(566606),c=e.i(584578),d=e.i(764205),u=e.i(702597),m=e.i(207082),g=e.i(109799),h=e.i(500330),x=e.i(871943),f=e.i(502547),p=e.i(360820),y=e.i(94629),w=e.i(152990),v=e.i(682830),j=e.i(389083),S=e.i(994388),b=e.i(752978),_=e.i(269200),k=e.i(942232),N=e.i(977572),C=e.i(427612),z=e.i(64848),I=e.i(496020),T=e.i(599724),D=e.i(827252),A=e.i(772345),O=e.i(464571),L=e.i(282786),E=e.i(981339),P=e.i(262218),U=e.i(592968),R=e.i(898586),B=e.i(355619),K=e.i(633627),M=e.i(374009),F=e.i(700514),$=e.i(135214),V=e.i(50882),H=e.i(969550),W=e.i(304911),q=e.i(20147);function J({teams:e,organizations:l,onSortChange:a,currentSort:s}){let{data:r}=(0,g.useOrganizations)(),i=r??l??[],[o,c]=(0,n.useState)(null),[u,J]=n.default.useState(()=>s?[{id:s.sortBy,desc:"desc"===s.sortOrder}]:[{id:"created_at",desc:!0}]),[G,Q]=n.default.useState({pageIndex:0,pageSize:50}),Z=u.length>0?u[0].id:null,X=u.length>0?u[0].desc?"desc":"asc":null,{data:Y,isPending:ee,isFetching:et,isError:el,refetch:ea}=(0,m.useKeys)(G.pageIndex+1,G.pageSize,{sortBy:Z||void 0,sortOrder:X||void 0,expand:"user"}),[es,er]=(0,n.useState)({}),{filters:ei,filteredKeys:en,filteredTotalCount:eo,allTeams:ec,allOrganizations:ed,handleFilterChange:eu,handleFilterReset:em}=function({keys:e,teams:t,organizations:l}){let a={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},{accessToken:s}=(0,$.default)(),[r,i]=(0,n.useState)(a),[o,c]=(0,n.useState)(t||[]),[u,m]=(0,n.useState)(l||[]),[g,h]=(0,n.useState)(e),[x,f]=(0,n.useState)(null),p=(0,n.useRef)(0),y=(0,n.useCallback)((0,M.default)(async e=>{if(!s)return;let t=Date.now();p.current=t;try{let l=await (0,d.keyListCall)(s,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,F.defaultPageSize,e["Sort By"]||null,e["Sort Order"]||null);t===p.current&&l&&(h(l.keys),f(l.total_count??null),console.log("called from debouncedSearch filters:",JSON.stringify(e)),console.log("called from debouncedSearch data:",JSON.stringify(l)))}catch(e){console.error("Error searching users:",e)}},300),[s]);return(0,n.useEffect)(()=>{if(!e)return void h([]);let t=[...e];r["Team ID"]&&(t=t.filter(e=>e.team_id===r["Team ID"])),r["Organization ID"]&&(t=t.filter(e=>(e.organization_id??e.org_id)===r["Organization ID"])),h(t)},[e,r]),(0,n.useEffect)(()=>{let e=async()=>{let e=await (0,K.fetchAllTeams)(s);e.length>0&&c(e);let t=await (0,K.fetchAllOrganizations)(s);t.length>0&&m(t)};s&&e()},[s]),(0,n.useEffect)(()=>{t&&t.length>0&&c(e=>e.length{l&&l.length>0&&m(e=>e.length{i({"Team ID":e["Team ID"]||"","Organization ID":e["Organization ID"]||"","Key Alias":e["Key Alias"]||"","User ID":e["User ID"]||"","Sort By":e["Sort By"]||"created_at","Sort Order":e["Sort Order"]||"desc"}),t||y({...r,...e})},handleFilterReset:()=>{i(a),f(null),y(a)}}}({keys:Y?.keys||[],teams:e,organizations:l}),eg=(0,n.useDeferredValue)(et),eh=(et||eg)&&!el,ex=eo??Y?.total_count??0;(0,n.useEffect)(()=>{if(ea){let e=()=>{ea()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[ea]);let ef=(0,n.useMemo)(()=>[{id:"expander",header:()=>null,size:40,enableSorting:!1,cell:({row:e})=>e.getCanExpand()?(0,t.jsx)("button",{onClick:e.getToggleExpandedHandler(),style:{cursor:"pointer"},children:e.getIsExpanded()?"▼":"▶"}):null},{id:"token",accessorKey:"token",header:"Key ID",size:100,enableSorting:!0,cell:e=>{let l=e.getValue(),a=e.cell.column.getSize();return(0,t.jsx)(U.Tooltip,{title:l,children:(0,t.jsx)(S.Button,{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 overflow-hidden truncate block",style:{maxWidth:a,overflow:"hidden"},onClick:()=>c(e.row.original),children:l??"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,enableSorting:!0,cell:e=>{let l=e.getValue(),a=e.cell.column.getSize();return(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:a,overflow:"hidden"},children:l??"-"})}},{id:"status",header:"Status",size:100,enableSorting:!1,cell:({row:e})=>{let l=e.original;if(!0!==l.blocked)return(0,t.jsx)(P.Tag,{color:"green","data-testid":`key-status-${l.token_id}`,children:"Active"});let a=l.metadata?.scim_blocked===!0;return(0,t.jsx)(U.Tooltip,{title:a?"Blocked by SCIM (external identity provider deactivated or deleted the owning user).":"Blocked. Requests using this key will be rejected with 401.",children:(0,t.jsx)(P.Tag,{color:"red","data-testid":`key-status-${l.token_id}`,children:"Blocked"})})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",size:120,enableSorting:!1,cell:e=>(0,t.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team",size:120,enableSorting:!1,cell:l=>{let a=l.getValue();if(!a)return"-";let s=e?.find(e=>e.team_id===a),r=s?.team_alias||a,i=l.cell.column.getSize();return(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:i,overflow:"hidden"},children:r})}},{id:"organization_alias",accessorKey:"org_id",header:"Organization",size:140,enableSorting:!1,cell:e=>{let l=e.getValue();if(!l)return"-";let a=i.find(e=>e.organization_id===l),s=a?.organization_alias||l,r=e.cell.column.getSize();return(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:r,overflow:"hidden"},children:s})}},{id:"user",accessorKey:"user",header:()=>(0,t.jsxs)("span",{className:"flex items-center gap-1",children:["User",(0,t.jsx)(L.Popover,{content:"Displays the first available value: User Alias, User Email, or User ID.",trigger:"hover",children:(0,t.jsx)(D.InfoCircleOutlined,{className:"text-gray-400 text-xs cursor-help"})})]}),size:160,enableSorting:!1,cell:({row:e})=>{let l=e.original,a=l.user?.user_alias??null,s=l.user?.user_email??l.user_email??null,r=l.user_id??null,i="default_user_id"===r,n=a||s||r,o=(0,t.jsx)("div",{className:"flex flex-col gap-2 text-xs min-w-[200px] max-w-[300px]",children:[{label:"User Alias",value:a},{label:"User Email",value:s},{label:"User ID",value:r}].map(({label:e,value:l})=>(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("span",{className:"text-gray-400",children:e}),l?(0,t.jsx)(R.Typography.Text,{className:"font-mono text-xs",ellipsis:{tooltip:l},copyable:!0,children:l}):(0,t.jsx)("span",{className:"font-mono",children:"-"})]},e))});return!i||a||s?(0,t.jsx)(L.Popover,{content:o,trigger:"hover",placement:"bottomLeft",children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block cursor-default",style:{maxWidth:160,overflow:"hidden"},children:n||"-"})}):(0,t.jsx)(L.Popover,{content:o,trigger:"hover",placement:"bottomLeft",children:(0,t.jsx)("span",{className:"cursor-default",children:(0,t.jsx)(W.default,{userId:r})})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,enableSorting:!0,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:160,enableSorting:!1,cell:e=>{let l=e.getValue();if(!l)return"-";let a=e.row.original.created_by_user,s=a?.user_alias??null,r=a?.user_email??null,i="default_user_id"===l,n=s||r||l,o=(0,t.jsx)("div",{className:"flex flex-col gap-2 text-xs min-w-[200px] max-w-[300px]",children:[{label:"User Alias",value:s},{label:"User Email",value:r},{label:"User ID",value:l}].map(({label:e,value:l})=>(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("span",{className:"text-gray-400",children:e}),l?(0,t.jsx)(R.Typography.Text,{className:"font-mono text-xs",ellipsis:{tooltip:l},copyable:!0,children:l}):(0,t.jsx)("span",{className:"font-mono",children:"-"})]},e))});return!i||s||r?(0,t.jsx)(L.Popover,{content:o,trigger:"hover",placement:"bottomLeft",children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block cursor-default",style:{maxWidth:160,overflow:"hidden"},children:n})}):(0,t.jsx)(L.Popover,{content:o,trigger:"hover",placement:"bottomLeft",children:(0,t.jsx)("span",{className:"cursor-default",children:(0,t.jsx)(W.default,{userId:l})})})}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",size:120,enableSorting:!0,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"last_active",accessorKey:"last_active",header:()=>(0,t.jsxs)("span",{className:"flex items-center gap-1",children:["Last Active",(0,t.jsx)(L.Popover,{content:"This is a new field and is not backfilled. Only new key usage will update this value.",trigger:"hover",children:(0,t.jsx)(D.InfoCircleOutlined,{className:"text-gray-400 text-xs cursor-help"})})]}),size:130,enableSorting:!1,cell:e=>{let l=e.getValue();if(!l)return"Unknown";let a=new Date(l);return(0,t.jsx)(U.Tooltip,{title:a.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"long"}),children:(0,t.jsx)("span",{children:a.toLocaleDateString()})})}},{id:"expires",accessorKey:"expires",header:"Expires",size:120,enableSorting:!1,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,enableSorting:!0,cell:e=>(0,h.formatNumberWithCommas)(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,enableSorting:!0,cell:e=>{let t=e.getValue();return null===t?"Unlimited":`$${(0,h.formatNumberWithCommas)(t)}`}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",size:130,enableSorting:!1,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",size:200,enableSorting:!1,cell:e=>{let l=e.getValue();return(0,t.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(l)?(0,t.jsx)("div",{className:"flex flex-col",children:0===l.length?(0,t.jsx)(j.Badge,{size:"xs",className:"mb-1",color:"red",children:(0,t.jsx)(T.Text,{children:"All Proxy Models"})}):(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"flex items-start",children:[l.length>3&&(0,t.jsx)("div",{children:(0,t.jsx)(b.Icon,{icon:es[e.row.id]?x.ChevronDownIcon:f.ChevronRightIcon,className:"cursor-pointer",size:"xs",onClick:()=>{er(t=>({...t,[e.row.id]:!t[e.row.id]}))}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,3).map((e,l)=>"all-proxy-models"===e?(0,t.jsx)(j.Badge,{size:"xs",color:"red",children:(0,t.jsx)(T.Text,{children:"All Proxy Models"})},l):(0,t.jsx)(j.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(T.Text,{children:e.length>30?`${(0,B.getModelDisplayName)(e).slice(0,30)}...`:(0,B.getModelDisplayName)(e)})},l)),l.length>3&&!es[e.row.id]&&(0,t.jsx)(j.Badge,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,t.jsxs)(T.Text,{children:["+",l.length-3," ",l.length-3==1?"more model":"more models"]})}),es[e.row.id]&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:l.slice(3).map((e,l)=>"all-proxy-models"===e?(0,t.jsx)(j.Badge,{size:"xs",color:"red",children:(0,t.jsx)(T.Text,{children:"All Proxy Models"})},l+3):(0,t.jsx)(j.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(T.Text,{children:e.length>30?`${(0,B.getModelDisplayName)(e).slice(0,30)}...`:(0,B.getModelDisplayName)(e)})},l+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",size:140,enableSorting:!1,cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:["TPM: ",null!==l.tpm_limit?l.tpm_limit:"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",null!==l.rpm_limit?l.rpm_limit:"Unlimited"]})]})}}],[e,i]),ep=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>ec&&0!==ec.length?ec.filter(t=>t.team_id.toLowerCase().includes(e.toLowerCase())||t.team_alias&&t.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:`${e.team_alias||e.team_id} (${e.team_id})`,value:e.team_id})):[]},{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>ed&&0!==ed.length?ed.filter(t=>t.organization_id?.toLowerCase().includes(e.toLowerCase())??!1).filter(e=>null!==e.organization_id&&void 0!==e.organization_id).map(e=>({label:`${e.organization_id||"Unknown"} (${e.organization_id})`,value:e.organization_id})):[]},{name:"Key Alias",label:"Key Alias",customComponent:V.PaginatedKeyAliasSelect},{name:"User ID",label:"User ID",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1}],ey=(0,w.useReactTable)({data:en,columns:ef.filter(e=>"expander"!==e.id),columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:u,pagination:G},onSortingChange:e=>{let t="function"==typeof e?e(u):e;if(J(t),t&&t.length>0){let e=t[0],l=e.id,s=e.desc?"desc":"asc";eu({...ei,"Sort By":l,"Sort Order":s},!0),a?.(l,s)}},onPaginationChange:Q,getCoreRowModel:(0,v.getCoreRowModel)(),getSortedRowModel:(0,v.getSortedRowModel)(),getPaginationRowModel:(0,v.getPaginationRowModel)(),enableSorting:!0,manualSorting:!1,manualPagination:!0,pageCount:Math.ceil(ex/G.pageSize)});n.default.useEffect(()=>{s&&J([{id:s.sortBy,desc:"desc"===s.sortOrder}])},[s]);let{pageIndex:ew,pageSize:ev}=ey.getState().pagination,ej=Math.min((ew+1)*ev,ex),eS=`${ew*ev+1} - ${ej}`;return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:o?(0,t.jsx)(q.default,{keyId:o.token,onClose:()=>c(null),keyData:o,teams:ec,onDelete:ea}):(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"w-full mb-6",children:(0,t.jsx)(H.default,{options:ep,onApplyFilters:eu,initialValues:ei,onResetFilters:em})}),(0,t.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[ee?(0,t.jsx)(E.Skeleton.Node,{active:!0,style:{width:200,height:20}}):(0,t.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",eS," of ",ex," results"]}),(0,t.jsx)(O.Button,{type:"default",icon:(0,t.jsx)(A.SyncOutlined,{spin:eh}),onClick:()=>{ea()},disabled:eh,title:"Fetch data",children:eh?"Fetching":"Fetch"})]}),(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[ee?(0,t.jsx)(E.Skeleton.Node,{active:!0,style:{width:74,height:20}}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",ew+1," of ",ey.getPageCount()]}),ee?(0,t.jsx)(E.Skeleton.Button,{active:!0,size:"small",style:{width:84,height:30}}):(0,t.jsx)("button",{onClick:()=>ey.previousPage(),disabled:ee||!ey.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),ee?(0,t.jsx)(E.Skeleton.Button,{active:!0,size:"small",style:{width:58,height:30}}):(0,t.jsx)("button",{onClick:()=>ey.nextPage(),disabled:ee||!ey.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(_.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:ey.getCenterTotalSize()},children:[(0,t.jsx)(C.TableHead,{children:ey.getHeaderGroups().map(e=>(0,t.jsx)(I.TableRow,{children:e.headers.map(e=>(0,t.jsx)(z.TableHeaderCell,{"data-header-id":e.id,className:`py-1 h-8 relative hover:bg-gray-50 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,style:{width:e.getSize(),position:"relative",cursor:e.column.getCanSort()?"pointer":"default"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,w.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(p.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(x.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(y.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${ey.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(k.TableBody,{children:ee?(0,t.jsx)(I.TableRow,{children:(0,t.jsx)(N.TableCell,{colSpan:ef.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading keys..."})})})}):en.length>0?ey.getRowModel().rows.map(e=>(0,t.jsx)(I.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(N.TableCell,{style:{width:e.column.getSize(),maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"models"===e.column.id&&Array.isArray(e.getValue())&&e.getValue().length>3?"px-0":""}`,children:(0,w.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(I.TableRow,{children:(0,t.jsx)(N.TableCell,{colSpan:ef.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}e.s(["default",0,({userID:e,userRole:m,teams:g,keys:h,setUserRole:x,userEmail:f,setUserEmail:p,setTeams:y,setKeys:w,premiumUser:v,organizations:j,addKey:S,createClicked:b,autoOpenCreate:_,prefillData:k})=>{let[N,C]=(0,n.useState)(null),[z,I]=(0,n.useState)(null),T=(0,i.useSearchParams)(),D=(0,l.getCookie)("token"),A=T.get("invitation_id"),[O,L]=(0,n.useState)(null),[E,P]=(0,n.useState)(null),[U,R]=(0,n.useState)([]),[B,K]=(0,n.useState)(null),[M,F]=(0,n.useState)(null);if((0,n.useEffect)(()=>{let e=()=>{let e=sessionStorage.getItem("token");sessionStorage.clear(),e&&sessionStorage.setItem("token",e)};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]),(0,n.useEffect)(()=>{if(D){let e=(0,r.jwtDecode)(D);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),L(e.key),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(console.log(`Received user role: ${e}`),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";case"internal_user":return"Internal User";case"internal_user_viewer":return"Internal Viewer";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",t),x(t)}else console.log("User role not defined");e.user_email?p(e.user_email):console.log(`User Email is not set ${e}`)}}if(e&&O&&m&&!N){let t=sessionStorage.getItem("userModels"+e);t?R(JSON.parse(t)):(console.log(`currentOrg: ${JSON.stringify(z)}`),(async()=>{try{let t=await (0,d.getProxyUISettings)(O);K(t);let l=await (0,d.userGetInfoV2)(O,e);C(l),sessionStorage.setItem("userSpendData"+e,JSON.stringify(l));let a=(await (0,d.modelAvailableCall)(O,e,m)).data.map(e=>e.id);console.log("available_model_names:",a),R(a),console.log("userModels:",U),sessionStorage.setItem("userModels"+e,JSON.stringify(a))}catch(e){console.error("There was an error fetching the data",e),e.message.includes("Invalid proxy server token passed")&&$()}})(),(0,c.fetchTeams)(O,e,m,z,y))}},[e,D,O,m]),(0,n.useEffect)(()=>{O&&(async()=>{try{let e=await (0,d.keyInfoCall)(O,[O]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&$()}})()},[O]),(0,n.useEffect)(()=>{console.log(`currentOrg: ${JSON.stringify(z)}, accessToken: ${O}, userID: ${e}, userRole: ${m}`),O&&(console.log("fetching teams"),(0,c.fetchTeams)(O,e,m,z,y))},[z]),(0,n.useEffect)(()=>{if(null!==h&&null!=M&&null!==M.team_id){let e=0;for(let t of(console.log(`keys: ${JSON.stringify(h)}`),h))M.hasOwnProperty("team_id")&&null!==t.team_id&&t.team_id===M.team_id&&(e+=t.spend);console.log(`sum: ${e}`),P(e)}else if(null!==h){let e=0;for(let t of h)e+=t.spend;P(e)}},[M]),null!=A)return(0,t.jsx)(o.default,{});function $(){(0,l.clearTokenCookies)();let e=(0,d.getProxyBaseUrl)();console.log("proxyBaseUrl:",e);let t=e?`${e}/sso/key/generate`:"/sso/key/generate";return console.log("Full URL:",t),window.location.href=t,null}if(null==D)return console.log("All cookies before redirect:",document.cookie),$(),null;try{let e=(0,r.jwtDecode)(D);console.log("Decoded token:",e);let t=e.exp,l=Math.floor(Date.now()/1e3);if(t&&l>=t)return console.log("Token expired, redirecting to login"),$(),null}catch(e){return console.error("Error decoding token:",e),(0,l.clearTokenCookies)(),$(),null}if(null==O)return null;if(null==e)return(0,t.jsx)("h1",{children:"User ID is not set"});null==m&&x("App Owner");let V="Admin Viewer"!==m&&"proxy_admin_viewer"!==m;return console.log("inside user dashboard, selected team",M),console.log("All cookies after redirect:",document.cookie),(0,t.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,t.jsx)(s.Grid,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,t.jsxs)(a.Col,{numColSpan:1,className:"flex flex-col gap-2",children:[V&&(0,t.jsx)(u.default,{team:M,teams:g,data:h,addKey:S,autoOpenCreate:_,prefillData:k},M?M.team_id:null),(0,t.jsx)(J,{teams:g,organizations:j})]})})})}],693569)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1abad0fb1abdc83c.js b/litellm/proxy/_experimental/out/_next/static/chunks/1abad0fb1abdc83c.js
new file mode 100644
index 0000000000..1088203647
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/1abad0fb1abdc83c.js
@@ -0,0 +1,2 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,536916,e=>{"use strict";var t=e.i(374276);e.s(["Checkbox",()=>t.default])},599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),n=e.i(673706),s=e.i(271645);let i=s.default.forwardRef((e,i)=>{let{color:a,className:o,children:l}=e;return s.default.createElement("p",{ref:i,className:(0,r.tremorTwMerge)("text-tremor-default",a?(0,n.getColorClassNames)(a,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),o)},l)});i.displayName="Text",e.s(["default",()=>i],936325),e.s(["Text",()=>i],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),n=e.i(480731),s=e.i(95779),i=e.i(444755),a=e.i(673706);let o=(0,a.makeClassName)("Card"),l=r.default.forwardRef((e,l)=>{let{decoration:c="",decorationColor:u,children:d,className:f}=e,p=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:l,className:(0,i.tremorTwMerge)(o("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",u?(0,a.getColorClassNames)(u,s.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case n.HorizontalPositions.Left:return"border-l-4";case n.VerticalPositions.Top:return"border-t-4";case n.HorizontalPositions.Right:return"border-r-4";case n.VerticalPositions.Bottom:return"border-b-4";default:return""}})(c),f)},p),d)});l.displayName="Card",e.s(["Card",()=>l],304967)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),n=e.i(444755),s=e.i(673706),i=e.i(271645);let a=i.default.forwardRef((e,a)=>{let{color:o,children:l,className:c}=e,u=(0,t.__rest)(e,["color","children","className"]);return i.default.createElement("p",Object.assign({ref:a,className:(0,n.tremorTwMerge)("font-medium text-tremor-title",o?(0,s.getColorClassNames)(o,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},u),l)});a.displayName="Title",e.s(["Title",()=>a],629569)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},292639,e=>{"use strict";var t=e.i(764205),r=e.i(266027);let n=(0,e.i(243652).createQueryKeys)("uiSettings");e.s(["useUISettings",0,()=>(0,r.useQuery)({queryKey:n.list({}),queryFn:async()=>await (0,t.getUiSettings)(),staleTime:36e5,gcTime:36e5})])},250980,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["PlusCircleIcon",0,r],250980)},309426,e=>{"use strict";var t=e.i(290571),r=e.i(444755),n=e.i(673706),s=e.i(271645),i=e.i(46757);let a=(0,n.makeClassName)("Col"),o=s.default.forwardRef((e,n)=>{let o,l,c,u,{numColSpan:d=1,numColSpanSm:f,numColSpanMd:p,numColSpanLg:m,children:h,className:g}=e,y=(0,t.__rest)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),b=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return s.default.createElement("div",Object.assign({ref:n,className:(0,r.tremorTwMerge)(a("root"),(o=b(d,i.colSpan),l=b(f,i.colSpanSm),c=b(p,i.colSpanMd),u=b(m,i.colSpanLg),(0,r.tremorTwMerge)(o,l,c,u)),g)},y),h)});o.displayName="Col",e.s(["Col",()=>o],309426)},950724,(e,t,r)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},100236,(e,t,r)=>{t.exports=e.g&&e.g.Object===Object&&e.g},139088,(e,t,r)=>{var n=e.r(100236),s="object"==typeof self&&self&&self.Object===Object&&self;t.exports=n||s||Function("return this")()},631926,(e,t,r)=>{var n=e.r(139088);t.exports=function(){return n.Date.now()}},748891,(e,t,r)=>{var n=/\s/;t.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},830364,(e,t,r)=>{var n=e.r(748891),s=/^\s+/;t.exports=function(e){return e?e.slice(0,n(e)+1).replace(s,""):e}},630353,(e,t,r)=>{t.exports=e.r(139088).Symbol},243436,(e,t,r)=>{var n=e.r(630353),s=Object.prototype,i=s.hasOwnProperty,a=s.toString,o=n?n.toStringTag:void 0;t.exports=function(e){var t=i.call(e,o),r=e[o];try{e[o]=void 0;var n=!0}catch(e){}var s=a.call(e);return n&&(t?e[o]=r:delete e[o]),s}},223243,(e,t,r)=>{var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}},377684,(e,t,r)=>{var n=e.r(630353),s=e.r(243436),i=e.r(223243),a=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?s(e):i(e)}},877289,(e,t,r)=>{t.exports=function(e){return null!=e&&"object"==typeof e}},361884,(e,t,r)=>{var n=e.r(377684),s=e.r(877289);t.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==n(e)}},773759,(e,t,r)=>{var n=e.r(830364),s=e.r(950724),i=e.r(361884),a=0/0,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=l.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):o.test(e)?a:+e}},374009,(e,t,r)=>{var n=e.r(950724),s=e.r(631926),i=e.r(773759),a=Math.max,o=Math.min;t.exports=function(e,t,r){var l,c,u,d,f,p,m=0,h=!1,g=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var r=l,n=c;return l=c=void 0,m=t,d=e.apply(n,r)}function v(e){var r=e-p,n=e-m;return void 0===p||r>=t||r<0||g&&n>=u}function x(){var e,r,n,i=s();if(v(i))return w(i);f=setTimeout(x,(e=i-p,r=i-m,n=t-e,g?o(n,u-r):n))}function w(e){return(f=void 0,y&&l)?b(e):(l=c=void 0,d)}function k(){var e,r=s(),n=v(r);if(l=arguments,c=this,p=r,n){if(void 0===f)return m=e=p,f=setTimeout(x,t),h?b(e):d;if(g)return clearTimeout(f),f=setTimeout(x,t),b(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=i(t)||0,n(r)&&(h=!!r.leading,u=(g="maxWait"in r)?a(i(r.maxWait)||0,t):u,y="trailing"in r?!!r.trailing:y),k.cancel=function(){void 0!==f&&clearTimeout(f),m=0,l=p=c=f=void 0},k.flush=function(){return void 0===f?d:w(s())},k}},964306,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["XCircleIcon",0,r],964306)},677667,674175,886148,543086,e=>{"use strict";let t,r;var n,s=e.i(290571),i=e.i(429427),a=e.i(371330),o=e.i(271645),l=e.i(394487),c=e.i(914189),u=e.i(144279),d=e.i(294316),f=e.i(83733);let p=(0,o.createContext)(()=>{});function m({value:e,children:t}){return o.default.createElement(p.Provider,{value:e},t)}e.s(["CloseProvider",()=>m],674175);var h=e.i(233137),g=e.i(233538),y=e.i(397701),b=e.i(402155),v=e.i(700020);let x=null!=(n=o.default.startTransition)?n:function(e){e()};var w=e.i(998348),k=((t=k||{})[t.Open=0]="Open",t[t.Closed=1]="Closed",t),_=((r=_||{})[r.ToggleDisclosure=0]="ToggleDisclosure",r[r.CloseDisclosure=1]="CloseDisclosure",r[r.SetButtonId=2]="SetButtonId",r[r.SetPanelId=3]="SetPanelId",r[r.SetButtonElement=4]="SetButtonElement",r[r.SetPanelElement=5]="SetPanelElement",r);let C={0:e=>({...e,disclosureState:(0,y.match)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId},4:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},5:(e,t)=>e.panelElement===t.element?e:{...e,panelElement:t.element}},E=(0,o.createContext)(null);function S(e){let t=(0,o.useContext)(E);if(null===t){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,S),t}return t}E.displayName="DisclosureContext";let j=(0,o.createContext)(null);j.displayName="DisclosureAPIContext";let N=(0,o.createContext)(null);function O(e,t){return(0,y.match)(t.type,C,e,t)}N.displayName="DisclosurePanelContext";let T=o.Fragment,R=v.RenderFeatures.RenderStrategy|v.RenderFeatures.Static,M=Object.assign((0,v.forwardRefWithAs)(function(e,t){let{defaultOpen:r=!1,...n}=e,s=(0,o.useRef)(null),i=(0,d.useSyncRefs)(t,(0,d.optionalRef)(e=>{s.current=e},void 0===e.as||e.as===o.Fragment)),a=(0,o.useReducer)(O,{disclosureState:+!r,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:u},f]=a,p=(0,c.useEvent)(e=>{f({type:1});let t=(0,b.getOwnerDocument)(s);if(!t||!u)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(u):t.getElementById(u);null==r||r.focus()}),g=(0,o.useMemo)(()=>({close:p}),[p]),x=(0,o.useMemo)(()=>({open:0===l,close:p}),[l,p]),w=(0,v.useRender)();return o.default.createElement(E.Provider,{value:a},o.default.createElement(j.Provider,{value:g},o.default.createElement(m,{value:p},o.default.createElement(h.OpenClosedProvider,{value:(0,y.match)(l,{0:h.State.Open,1:h.State.Closed})},w({ourProps:{ref:i},theirProps:n,slot:x,defaultTag:T,name:"Disclosure"})))))}),{Button:(0,v.forwardRefWithAs)(function(e,t){let r=(0,o.useId)(),{id:n=`headlessui-disclosure-button-${r}`,disabled:s=!1,autoFocus:f=!1,...p}=e,[m,h]=S("Disclosure.Button"),y=(0,o.useContext)(N),b=null!==y&&y===m.panelId,x=(0,o.useRef)(null),k=(0,d.useSyncRefs)(x,t,(0,c.useEvent)(e=>{if(!b)return h({type:4,element:e})}));(0,o.useEffect)(()=>{if(!b)return h({type:2,buttonId:n}),()=>{h({type:2,buttonId:null})}},[n,h,b]);let _=(0,c.useEvent)(e=>{var t;if(b){if(1===m.disclosureState)return;switch(e.key){case w.Keys.Space:case w.Keys.Enter:e.preventDefault(),e.stopPropagation(),h({type:0}),null==(t=m.buttonElement)||t.focus()}}else switch(e.key){case w.Keys.Space:case w.Keys.Enter:e.preventDefault(),e.stopPropagation(),h({type:0})}}),C=(0,c.useEvent)(e=>{e.key===w.Keys.Space&&e.preventDefault()}),E=(0,c.useEvent)(e=>{var t;(0,g.isDisabledReactIssue7711)(e.currentTarget)||s||(b?(h({type:0}),null==(t=m.buttonElement)||t.focus()):h({type:0}))}),{isFocusVisible:j,focusProps:O}=(0,i.useFocusRing)({autoFocus:f}),{isHovered:T,hoverProps:R}=(0,a.useHover)({isDisabled:s}),{pressed:M,pressProps:P}=(0,l.useActivePress)({disabled:s}),I=(0,o.useMemo)(()=>({open:0===m.disclosureState,hover:T,active:M,disabled:s,focus:j,autofocus:f}),[m,T,M,j,s,f]),D=(0,u.useResolveButtonType)(e,m.buttonElement),L=b?(0,v.mergeProps)({ref:k,type:D,disabled:s||void 0,autoFocus:f,onKeyDown:_,onClick:E},O,R,P):(0,v.mergeProps)({ref:k,id:n,type:D,"aria-expanded":0===m.disclosureState,"aria-controls":m.panelElement?m.panelId:void 0,disabled:s||void 0,autoFocus:f,onKeyDown:_,onKeyUp:C,onClick:E},O,R,P);return(0,v.useRender)()({ourProps:L,theirProps:p,slot:I,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,v.forwardRefWithAs)(function(e,t){let r=(0,o.useId)(),{id:n=`headlessui-disclosure-panel-${r}`,transition:s=!1,...i}=e,[a,l]=S("Disclosure.Panel"),{close:u}=function e(t){let r=(0,o.useContext)(j);if(null===r){let r=Error(`<${t} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[p,m]=(0,o.useState)(null),g=(0,d.useSyncRefs)(t,(0,c.useEvent)(e=>{x(()=>l({type:5,element:e}))}),m);(0,o.useEffect)(()=>(l({type:3,panelId:n}),()=>{l({type:3,panelId:null})}),[n,l]);let y=(0,h.useOpenClosed)(),[b,w]=(0,f.useTransition)(s,p,null!==y?(y&h.State.Open)===h.State.Open:0===a.disclosureState),k=(0,o.useMemo)(()=>({open:0===a.disclosureState,close:u}),[a.disclosureState,u]),_={ref:g,id:n,...(0,f.transitionDataAttributes)(w)},C=(0,v.useRender)();return o.default.createElement(h.ResetOpenClosedProvider,null,o.default.createElement(N.Provider,{value:a.panelId},C({ourProps:_,theirProps:i,slot:k,defaultTag:"div",features:R,visible:b,name:"Disclosure.Panel"})))})});e.s(["Disclosure",()=>M],886148);let P=(0,o.createContext)(void 0);var I=e.i(444755);let D=(0,e.i(673706).makeClassName)("Accordion"),L=(0,o.createContext)({isOpen:!1}),F=o.default.forwardRef((e,t)=>{var r;let{defaultOpen:n=!1,children:i,className:a}=e,l=(0,s.__rest)(e,["defaultOpen","children","className"]),c=null!=(r=(0,o.useContext)(P))?r:(0,I.tremorTwMerge)("rounded-tremor-default border");return o.default.createElement(M,Object.assign({as:"div",ref:t,className:(0,I.tremorTwMerge)(D("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",c,a),defaultOpen:n},l),({open:e})=>o.default.createElement(L.Provider,{value:{isOpen:e}},i))});F.displayName="Accordion",e.s(["OpenContext",()=>L,"default",()=>F],543086),e.s(["Accordion",()=>F],677667)},898667,e=>{"use strict";var t=e.i(290571),r=e.i(271645),n=e.i(886148);let s=e=>{var n=(0,t.__rest)(e,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},n),r.default.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var i=e.i(543086),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("AccordionHeader"),l=r.default.forwardRef((e,l)=>{let{children:c,className:u}=e,d=(0,t.__rest)(e,["children","className"]),{isOpen:f}=(0,r.useContext)(i.OpenContext);return r.default.createElement(n.Disclosure.Button,Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),r.default.createElement("div",{className:(0,a.tremorTwMerge)(o("children"),"flex flex-1 text-inherit mr-4")},c),r.default.createElement("div",null,r.default.createElement(s,{className:(0,a.tremorTwMerge)(o("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))});l.displayName="AccordionHeader",e.s(["AccordionHeader",()=>l],898667)},130643,e=>{"use strict";var t=e.i(290571),r=e.i(271645),n=e.i(886148),s=e.i(444755);let i=(0,e.i(673706).makeClassName)("AccordionBody"),a=r.default.forwardRef((e,a)=>{let{children:o,className:l}=e,c=(0,t.__rest)(e,["children","className"]);return r.default.createElement(n.Disclosure.Panel,Object.assign({ref:a,className:(0,s.tremorTwMerge)(i("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},c),o)});a.displayName="AccordionBody",e.s(["AccordionBody",()=>a],130643)},83733,233137,e=>{"use strict";let t,r;var n,s,i=e.i(247167),a=e.i(271645),o=e.i(544508),l=e.i(746725),c=e.i(835696);void 0!==i.default&&"u">typeof globalThis&&"u">typeof Element&&(null==(n=null==i.default?void 0:i.default.env)?void 0:n.NODE_ENV)==="test"&&void 0===(null==(s=null==Element?void 0:Element.prototype)?void 0:s.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
+`)),[]});var u=((t=u||{})[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t);function d(e){let t={};for(let r in e)!0===e[r]&&(t[`data-${r}`]="");return t}function f(e,t,r,n){let[s,i]=(0,a.useState)(r),{hasFlag:u,addFlag:d,removeFlag:f}=function(e=0){let[t,r]=(0,a.useState)(e),n=(0,a.useCallback)(e=>r(e),[t]),s=(0,a.useCallback)(e=>r(t=>t|e),[t]),i=(0,a.useCallback)(e=>(t&e)===e,[t]);return{flags:t,setFlag:n,addFlag:s,hasFlag:i,removeFlag:(0,a.useCallback)(e=>r(t=>t&~e),[r]),toggleFlag:(0,a.useCallback)(e=>r(t=>t^e),[r])}}(e&&s?3:0),p=(0,a.useRef)(!1),m=(0,a.useRef)(!1),h=(0,l.useDisposables)();return(0,c.useIsoMorphicEffect)(()=>{var s;if(e){if(r&&i(!0),!t){r&&d(3);return}return null==(s=null==n?void 0:n.start)||s.call(n,r),function(e,{prepare:t,run:r,done:n,inFlight:s}){let i=(0,o.disposables)();return function(e,{inFlight:t,prepare:r}){if(null!=t&&t.current)return r();let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}(e,{prepare:t,inFlight:s}),i.nextFrame(()=>{r(),i.requestAnimationFrame(()=>{i.add(function(e,t){var r,n;let s=(0,o.disposables)();if(!e)return s.dispose;let i=!1;s.add(()=>{i=!0});let a=null!=(n=null==(r=e.getAnimations)?void 0:r.call(e).filter(e=>e instanceof CSSTransition))?n:[];return 0===a.length?t():Promise.allSettled(a.map(e=>e.finished)).then(()=>{i||t()}),s.dispose}(e,n))})}),i.dispose}(t,{inFlight:p,prepare(){m.current?m.current=!1:m.current=p.current,p.current=!0,m.current||(r?(d(3),f(4)):(d(4),f(2)))},run(){m.current?r?(f(3),d(4)):(f(4),d(3)):r?f(1):d(1)},done(){var e;m.current&&"function"==typeof t.getAnimations&&t.getAnimations().length>0||(p.current=!1,f(7),r||i(!1),null==(e=null==n?void 0:n.end)||e.call(n,r))}})}},[e,r,t,h]),e?[s,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}e.s(["transitionDataAttributes",()=>d,"useTransition",()=>f],83733);let p=(0,a.createContext)(null);p.displayName="OpenClosedContext";var m=((r=m||{})[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r);function h(){return(0,a.useContext)(p)}function g({value:e,children:t}){return a.default.createElement(p.Provider,{value:e},t)}function y({children:e}){return a.default.createElement(p.Provider,{value:null},e)}e.s(["OpenClosedProvider",()=>g,"ResetOpenClosedProvider",()=>y,"State",()=>m,"useOpenClosed",()=>h],233137)},233538,e=>{"use strict";function t(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(null==t?void 0:t.getAttribute("disabled"))==="";return!(n&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(r))&&n}e.s(["isDisabledReactIssue7711",()=>t])},220508,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["CheckCircleIcon",0,r],220508)},503269,214520,601893,694421,140721,942803,35889,722678,e=>{"use strict";var t=e.i(271645),r=e.i(914189);function n(e,n,s){let[i,a]=(0,t.useState)(s),o=void 0!==e,l=(0,t.useRef)(o),c=(0,t.useRef)(!1),u=(0,t.useRef)(!1);return!o||l.current||c.current?o||!l.current||u.current||(u.current=!0,l.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(c.current=!0,l.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:i,(0,r.useEvent)(e=>(o||a(e),null==n?void 0:n(e)))]}function s(e){let[r]=(0,t.useState)(e);return r}e.s(["useControllable",()=>n],503269),e.s(["useDefaultValue",()=>s],214520);let i=(0,t.createContext)(void 0);function a(){return(0,t.useContext)(i)}e.s(["useDisabled",()=>a],601893);var o=e.i(174080),l=e.i(746725);function c(e={},t=null,r=[]){for(let[n,s]of Object.entries(e))!function e(t,r,n){if(Array.isArray(n))for(let[s,i]of n.entries())e(t,u(r,s.toString()),i);else n instanceof Date?t.push([r,n.toISOString()]):"boolean"==typeof n?t.push([r,n?"1":"0"]):"string"==typeof n?t.push([r,n]):"number"==typeof n?t.push([r,`${n}`]):null==n?t.push([r,""]):c(n,r,t)}(r,u(t,n),s);return r}function u(e,t){return e?e+"["+t+"]":t}function d(e){var t,r;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n){for(let t of n.elements)if(t!==e&&("INPUT"===t.tagName&&"submit"===t.type||"BUTTON"===t.tagName&&"submit"===t.type||"INPUT"===t.nodeName&&"image"===t.type))return void t.click();null==(r=n.requestSubmit)||r.call(n)}}e.s(["attemptSubmit",()=>d,"objectToFormEntries",()=>c],694421);var f=e.i(700020),p=e.i(2788);let m=(0,t.createContext)(null);function h({children:e}){let r=(0,t.useContext)(m);if(!r)return t.default.createElement(t.default.Fragment,null,e);let{target:n}=r;return n?(0,o.createPortal)(t.default.createElement(t.default.Fragment,null,e),n):null}function g({data:e,form:r,disabled:n,onReset:s,overrides:i}){let[a,o]=(0,t.useState)(null),u=(0,l.useDisposables)();return(0,t.useEffect)(()=>{if(s&&a)return u.addEventListener(a,"reset",s)},[a,r,s]),t.default.createElement(h,null,t.default.createElement(y,{setForm:o,formId:r}),c(e).map(([e,s])=>t.default.createElement(p.Hidden,{features:p.HiddenFeatures.Hidden,...(0,f.compact)({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:n,name:e,value:s,...i})})))}function y({setForm:e,formId:r}){return(0,t.useEffect)(()=>{if(r){let t=document.getElementById(r);t&&e(t)}},[e,r]),r?null:t.default.createElement(p.Hidden,{features:p.HiddenFeatures.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let r=t.closest("form");r&&e(r)}})}e.s(["FormFields",()=>g],140721);let b=(0,t.createContext)(void 0);function v(){return(0,t.useContext)(b)}e.s(["useProvidedId",()=>v],942803);var x=e.i(835696),w=e.i(294316);let k=(0,t.createContext)(null);function _(){var e,r;return null!=(r=null==(e=(0,t.useContext)(k))?void 0:e.value)?r:void 0}function C(){let[e,n]=(0,t.useState)([]);return[e.length>0?e.join(" "):void 0,(0,t.useMemo)(()=>function(e){let s=(0,r.useEvent)(e=>(n(t=>[...t,e]),()=>n(t=>{let r=t.slice(),n=r.indexOf(e);return -1!==n&&r.splice(n,1),r}))),i=(0,t.useMemo)(()=>({register:s,slot:e.slot,name:e.name,props:e.props,value:e.value}),[s,e.slot,e.name,e.props,e.value]);return t.default.createElement(k.Provider,{value:i},e.children)},[n])]}k.displayName="DescriptionContext";let E=Object.assign((0,f.forwardRefWithAs)(function(e,r){let n=(0,t.useId)(),s=a(),{id:i=`headlessui-description-${n}`,...o}=e,l=function e(){let r=(0,t.useContext)(k);if(null===r){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return r}(),c=(0,w.useSyncRefs)(r);(0,x.useIsoMorphicEffect)(()=>l.register(i),[i,l.register]);let u=s||!1,d=(0,t.useMemo)(()=>({...l.slot,disabled:u}),[l.slot,u]),p={ref:c,...l.props,id:i};return(0,f.useRender)()({ourProps:p,theirProps:o,slot:d,defaultTag:"p",name:l.name||"Description"})}),{});e.s(["Description",()=>E,"useDescribedBy",()=>_,"useDescriptions",()=>C],35889);let S=(0,t.createContext)(null);function j(e){var r,n,s;let i=null!=(n=null==(r=(0,t.useContext)(S))?void 0:r.value)?n:void 0;return(null!=(s=null==e?void 0:e.length)?s:0)>0?[i,...e].filter(Boolean).join(" "):i}function N({inherit:e=!1}={}){let n=j(),[s,i]=(0,t.useState)([]),a=e?[n,...s].filter(Boolean):s;return[a.length>0?a.join(" "):void 0,(0,t.useMemo)(()=>function(e){let n=(0,r.useEvent)(e=>(i(t=>[...t,e]),()=>i(t=>{let r=t.slice(),n=r.indexOf(e);return -1!==n&&r.splice(n,1),r}))),s=(0,t.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return t.default.createElement(S.Provider,{value:s},e.children)},[i])]}S.displayName="LabelContext";let O=Object.assign((0,f.forwardRefWithAs)(function(e,n){var s;let i=(0,t.useId)(),o=function e(){let r=(0,t.useContext)(S);if(null===r){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return r}(),l=v(),c=a(),{id:u=`headlessui-label-${i}`,htmlFor:d=null!=l?l:null==(s=o.props)?void 0:s.htmlFor,passive:p=!1,...m}=e,h=(0,w.useSyncRefs)(n);(0,x.useIsoMorphicEffect)(()=>o.register(u),[u,o.register]);let g=(0,r.useEvent)(e=>{let t=e.currentTarget;if(t instanceof HTMLLabelElement&&e.preventDefault(),o.props&&"onClick"in o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),t instanceof HTMLLabelElement){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let r=e.getAttribute("aria-disabled");if("true"===r||""===r)return;(e instanceof HTMLInputElement&&("radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}}),y=c||!1,b=(0,t.useMemo)(()=>({...o.slot,disabled:y}),[o.slot,y]),k={ref:h,...o.props,id:u,htmlFor:d,onClick:g};return p&&("onClick"in k&&(delete k.htmlFor,delete k.onClick),"onClick"in m&&delete m.onClick),(0,f.useRender)()({ourProps:k,theirProps:m,slot:b,defaultTag:d?"label":"div",name:o.name||"Label"})}),{});e.s(["Label",()=>O,"useLabelledBy",()=>j,"useLabels",()=>N],722678)},107233,37727,e=>{"use strict";var t=e.i(603908);e.s(["Plus",()=>t.default],107233);var r=e.i(841947);e.s(["X",()=>r.default],37727)},361653,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t])},841947,e=>{"use strict";let t=(0,e.i(475254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},603908,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",()=>t])},158392,419470,e=>{"use strict";var t=e.i(843476),r=e.i(311451);let n={ttl:3600,lowest_latency_buffer:0},s=({routingStrategyArgs:e})=>{let s={ttl:"Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Latency-Based Configuration"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Fine-tune latency-based routing behavior"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e||n).map(([e,n])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:e.replace(/_/g," ")}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:s[e]||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:"object"==typeof n?JSON.stringify(n,null,2):n?.toString(),className:"font-mono text-sm w-full"})]})},e))})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"})]})},i=({routerSettings:e,routerFieldsMetadata:n})=>(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Reliability & Retries"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure retry logic and failure handling"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e).filter(([e,t])=>"fallbacks"!=e&&"context_window_fallbacks"!=e&&"routing_strategy_args"!=e&&"routing_strategy"!=e&&"enable_tag_filtering"!=e).map(([e,s])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:n[e]?.ui_field_name||e}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:n[e]?.field_description||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:null==s||"null"===s?"":"object"==typeof s?JSON.stringify(s,null,2):s?.toString()||"",placeholder:"—",className:"font-mono text-sm w-full"})]})},e))})]});var a=e.i(199133);let o=({selectedStrategy:e,availableStrategies:r,routingStrategyDescriptions:n,routerFieldsMetadata:s,onStrategyChange:i})=>(0,t.jsxs)("div",{className:"space-y-2 max-w-3xl",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:s.routing_strategy?.ui_field_name||"Routing Strategy"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:s.routing_strategy?.field_description||""})]}),(0,t.jsx)("div",{className:"routing-strategy-select max-w-3xl",children:(0,t.jsx)(a.Select,{value:e,onChange:i,style:{width:"100%"},size:"large",children:r.map(e=>(0,t.jsx)(a.Select.Option,{value:e,label:e,children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 py-1",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e}),n[e]&&(0,t.jsx)("span",{className:"text-xs text-gray-500 font-normal",children:n[e]})]})},e))})})]});var l=e.i(790848);let c=({enabled:e,routerFieldsMetadata:r,onToggle:n})=>(0,t.jsx)("div",{className:"space-y-3 max-w-3xl",children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:r.enable_tag_filtering?.ui_field_name||"Enable Tag Filtering"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[r.enable_tag_filtering?.field_description||"",r.enable_tag_filtering?.link&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("a",{href:r.enable_tag_filtering.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Learn more"})]})]})]}),(0,t.jsx)(l.Switch,{checked:e,onChange:n,className:"ml-4"})]})});e.s(["default",0,({value:e,onChange:r,routerFieldsMetadata:n,availableRoutingStrategies:a,routingStrategyDescriptions:l})=>(0,t.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Routing Settings"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure how requests are routed to deployments"})]}),a.length>0&&(0,t.jsx)(o,{selectedStrategy:e.selectedStrategy||e.routerSettings.routing_strategy||null,availableStrategies:a,routingStrategyDescriptions:l,routerFieldsMetadata:n,onStrategyChange:t=>{r({...e,selectedStrategy:t})}}),(0,t.jsx)(c,{enabled:e.enableTagFiltering,routerFieldsMetadata:n,onToggle:t=>{r({...e,enableTagFiltering:t})}})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),"latency-based-routing"===e.selectedStrategy&&(0,t.jsx)(s,{routingStrategyArgs:e.routerSettings.routing_strategy_args}),(0,t.jsx)(i,{routerSettings:e.routerSettings,routerFieldsMetadata:n})]})],158392);var u=e.i(994388),d=e.i(653496),f=e.i(107233),p=e.i(271645),m=e.i(888259),h=e.i(592968),g=e.i(361653),g=g;let y=(0,e.i(475254).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var b=e.i(37727);function v({group:e,onChange:r,availableModels:n,maxFallbacks:s}){let i=n.filter(t=>t!==e.primaryModel),o=e.fallbackModels.length{let n=[...e.fallbackModels];n.includes(t)&&(n=n.filter(e=>e!==t)),r({...e,primaryModel:t,fallbackModels:n})},showSearch:!0,getPopupContainer:e=>e.parentElement||document.body,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:n.map(e=>({label:e,value:e}))}),!e.primaryModel&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-amber-600 text-xs bg-amber-50 p-2 rounded",children:[(0,t.jsx)(g.default,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Select a model to begin configuring fallbacks"})]})]}),(0,t.jsx)("div",{className:"flex items-center justify-center -my-4 z-10",children:(0,t.jsxs)("div",{className:"bg-indigo-50 text-indigo-500 px-4 py-1 rounded-full text-xs font-bold border border-indigo-100 flex items-center gap-2 shadow-sm",children:[(0,t.jsx)(y,{className:"w-4 h-4"}),"IF FAILS, TRY..."]})}),(0,t.jsxs)("div",{className:`transition-opacity duration-300 ${!e.primaryModel?"opacity-50 pointer-events-none":"opacity-100"}`,children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Fallback Chain ",(0,t.jsx)("span",{className:"text-red-500",children:"*"}),(0,t.jsxs)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:["(Max ",s," fallbacks at a time)"]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-200",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(a.Select,{mode:"multiple",className:"w-full",size:"large",placeholder:o?"Select fallback models to add...":`Maximum ${s} fallbacks reached`,value:e.fallbackModels,onChange:t=>{let n=t.slice(0,s);r({...e,fallbackModels:n})},disabled:!e.primaryModel,getPopupContainer:e=>e.parentElement||document.body,options:i.map(e=>({label:e,value:e})),optionRender:(r,n)=>{let s=e.fallbackModels.includes(r.value),i=s?e.fallbackModels.indexOf(r.value)+1:null;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s&&null!==i&&(0,t.jsx)("span",{className:"flex items-center justify-center w-5 h-5 rounded bg-indigo-100 text-indigo-600 text-xs font-bold",children:i}),(0,t.jsx)("span",{children:r.label})]})},maxTagCount:"responsive",maxTagPlaceholder:e=>(0,t.jsx)(h.Tooltip,{styles:{root:{pointerEvents:"none"}},title:e.map(({value:e})=>e).join(", "),children:(0,t.jsxs)("span",{children:["+",e.length," more"]})}),showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1 ml-1",children:o?`Search and select multiple models. Selected models will appear below in order. (${e.fallbackModels.length}/${s} used)`:`Maximum ${s} fallbacks reached. Remove some to add more.`})]}),(0,t.jsx)("div",{className:"space-y-2 min-h-[100px]",children:0===e.fallbackModels.length?(0,t.jsxs)("div",{className:"h-32 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)("span",{className:"text-sm",children:"No fallback models selected"}),(0,t.jsx)("span",{className:"text-xs mt-1",children:"Add models from the dropdown above"})]}):e.fallbackModels.map((n,s)=>(0,t.jsxs)("div",{className:"group flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200 hover:border-indigo-300 hover:shadow-sm transition-all",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded bg-gray-100 text-gray-400 group-hover:text-indigo-500 group-hover:bg-indigo-50",children:(0,t.jsx)("span",{className:"text-xs font-bold",children:s+1})}),(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"font-medium text-gray-800",children:n})})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t;return t=e.fallbackModels.filter((e,t)=>t!==s),void r({...e,fallbackModels:t})},className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-400 hover:text-red-500 p-1",children:(0,t.jsx)(b.X,{className:"w-4 h-4"})})]},`${n}-${s}`))})]})]})]})}function x({groups:e,onGroupsChange:r,availableModels:n,maxFallbacks:s=10,maxGroups:i=5}){let[a,o]=(0,p.useState)(e.length>0?e[0].id:"1");(0,p.useEffect)(()=>{e.length>0?e.some(e=>e.id===a)||o(e[0].id):o("1")},[e]);let l=()=>{if(e.length>=i)return;let t=Date.now().toString();r([...e,{id:t,primaryModel:null,fallbackModels:[]}]),o(t)},c=t=>{r(e.map(e=>e.id===t.id?t:e))},h=e.map((r,i)=>{let a=r.primaryModel?r.primaryModel:`Group ${i+1}`;return{key:r.id,label:a,closable:e.length>1,children:(0,t.jsx)(v,{group:r,onChange:c,availableModels:n,maxFallbacks:s})}});return 0===e.length?(0,t.jsxs)("div",{className:"text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300",children:[(0,t.jsx)("p",{className:"text-gray-500 mb-4",children:"No fallback groups configured"}),(0,t.jsx)(u.Button,{variant:"primary",onClick:l,icon:()=>(0,t.jsx)(f.Plus,{className:"w-4 h-4"}),children:"Create First Group"})]}):(0,t.jsx)(d.Tabs,{type:"editable-card",activeKey:a,onChange:o,onEdit:(t,n)=>{"add"===n?l():"remove"===n&&e.length>1&&(t=>{if(1===e.length)return m.default.warning("At least one group is required");let n=e.filter(e=>e.id!==t);r(n),a===t&&n.length>0&&o(n[n.length-1].id)})(t)},items:h,className:"fallback-tabs",tabBarStyle:{marginBottom:0},hideAdd:e.length>=i})}e.s(["FallbackSelectionForm",()=>x],419470)},689020,e=>{"use strict";var t=e.i(764205);let r=async e=>{try{let r=await (0,t.modelHubCall)(e);if(console.log("model_info:",r),r?.data.length>0){let e=r.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,r])},737434,e=>{"use strict";var t=e.i(184163);e.s(["DownloadOutlined",()=>t.default])},916940,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(199133),s=e.i(764205);e.s(["default",0,({onChange:e,value:i,className:a,accessToken:o,placeholder:l="Select vector stores",disabled:c=!1})=>{let[u,d]=(0,r.useState)([]),[f,p]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){p(!0);try{let e=await (0,s.vectorStoreListCall)(o);e.data&&d(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[o]),(0,t.jsx)("div",{children:(0,t.jsx)(n.Select,{mode:"multiple",placeholder:l,onChange:e,value:i,loading:f,className:a,allowClear:!0,options:u.map(e=>({label:`${e.vector_store_name||e.vector_store_id} (${e.vector_store_id})`,value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:c})})}])},59935,(e,t,r)=>{var n;let s;e.e,n=function e(){var t,r="u">typeof self?self:"u">typeof window?window:void 0!==r?r:{},n=!r.document&&!!r.postMessage,s=r.IS_PAPA_WORKER||!1,i={},a=0,o={};function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=v(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview,s)r.postMessage({results:i,workerId:o.WORKER_ID,finished:n});else if(w(this._config.chunk)&&!t){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=i=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!n||!w(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||i&&i.meta.paused||this._nextChunk(),i}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):s&&this._config.error&&r.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e,r,s=this._config.downloadRequestHeaders;for(r in s)t.setRequestHeader(r,s[r])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function u(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),l.call(this,e);var t,r,n="u">typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,r;if(!this._finished)return t=(e=this._config.chunkSize)?(r=t.substring(0,e),t.substring(e)):(r=t,""),this._finished=!t,this.parseChunk(r)}}function f(e){l.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=x(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(e){var t,r,n,s,i=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,c=0,u=0,d=!1,f=!1,p=[],g={data:[],errors:[],meta:{}};function y(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function b(){if(g&&n&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!y(e)})),x()){if(g)if(Array.isArray(g.data[0])){for(var t,r=0;x()&&r(e.dynamicTypingFunction&&void 0===e.dynamicTyping[t]&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping))?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&((e=>{if(i.test(e)&&-0x20000000000000<(e=parseFloat(e))&&e<0x20000000000000)return 1})(r)?parseFloat(r):a.test(r)?new Date(r):""===r?null:r):r)(o=e.header?s>=p.length?"__parsed_extra":p[s]:o,l=e.transform?e.transform(l,o):l);"__parsed_extra"===o?(n[o]=n[o]||[],n[o].push(l)):n[o]=l}return e.header&&(s>p.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+s,u+r):se.preview?r.abort():(g.data=g.data[0],s(g,l))))}),this.parse=function(s,i,a){var l=e.quoteChar||'"',l=(e.newline||(e.newline=this.guessLineEndings(s,l)),n=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(s),g.meta.delimiter=e.delimiter):((l=((t,r,n,s,i)=>{var a,l,c,u;i=i||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var d=0;d=r.length/2?"\r\n":"\r"}}function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function h(e){var t=(e=e||{}).delimiter,r=e.newline,n=e.comments,s=e.step,i=e.preview,a=e.fastMode,l=null,c=!1,u=null==e.quoteChar?'"':e.quoteChar,d=u;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1=i)return A(!0);break}C.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:f}),M++}}else if(n&&0===E.length&&o.substring(f,f+x)===n){if(-1===T)return A();f=T+v,T=o.indexOf(r,f),O=o.indexOf(t,f)}else if(-1!==O&&(O=i)return A(!0)}return L();function I(e){_.push(e),S=f}function D(e){return -1!==e&&(e=o.substring(M+1,e))&&""===e.trim()?e.length:0}function L(e){return g||(void 0===e&&(e=o.substring(f)),E.push(e),f=y,I(E),k&&B()),A()}function F(e){f=e,I(E),E=[],T=o.indexOf(r,f)}function A(n){if(e.header&&!h&&_.length&&!c){var s=_[0],i=Object.create(null),a=new Set(s);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(s=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(r=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(i=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(n=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+a),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(m(a),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,c);if("object"==typeof e[0])return p(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),p(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function p(e,t,r){var a="",o=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var r=0;r{"use strict";var t=e.i(631171);e.s(["ChevronDownIcon",()=>t.default])},246349,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",()=>t])},500727,699857,696609,531516,e=>{"use strict";var t=e.i(266027),r=e.i(243652),n=e.i(764205),s=e.i(135214);let i=(0,r.createQueryKeys)("mcpServers");e.s(["useMCPServers",0,e=>{let{accessToken:r}=(0,s.default)();return(0,t.useQuery)({queryKey:i.list(e?{filters:{teamId:e}}:void 0),queryFn:async()=>await (0,n.fetchMCPServers)(r,e),enabled:!!r})}],500727);let a=(0,r.createQueryKeys)("mcpToolsets");e.s(["useMCPToolsets",0,()=>{let{accessToken:e}=(0,s.default)();return(0,t.useQuery)({queryKey:a.list(),queryFn:async()=>await (0,n.fetchMCPToolsets)(e),enabled:!!e})}],699857);var o=e.i(843476),l=e.i(271645),c=e.i(536916),u=e.i(599724),d=e.i(409797),f=e.i(246349),f=f;let p=/\b(delete|remove|destroy|purge|drop|erase|unlink)\b/i,m=/\b(create|add|insert|new|post|submit|register|make|generate|write|upload)\b/i,h=/\b(update|edit|modify|change|patch|put|set|rename|move|transform)\b/i,g=/\b(get|read|list|fetch|search|find|query|retrieve|show|view|check|describe|info)\b/i;function y(e,t=""){let r=e.toLowerCase();if(g.test(r))return"read";if(p.test(r))return"delete";if(h.test(r))return"update";if(m.test(r))return"create";if(t){let e=t.toLowerCase();if(g.test(e))return"read";if(p.test(e))return"delete";if(h.test(e))return"update";if(m.test(e))return"create"}return"unknown"}function b(e){let t={read:[],create:[],update:[],delete:[],unknown:[]};for(let r of e)t[y(r.name,r.description)].push(r);return t}let v={read:{label:"Read",description:"Safe operations — fetch, list, search. No side effects.",risk:"low"},create:{label:"Create",description:"Add new resources — insert, upload, register.",risk:"medium"},update:{label:"Update",description:"Modify existing resources — edit, patch, rename.",risk:"medium"},delete:{label:"Delete",description:"Destructive operations — remove, purge, destroy.",risk:"high"},unknown:{label:"Other",description:"Operations that could not be automatically classified.",risk:"unknown"}};e.s(["CRUD_GROUP_META",0,v,"classifyToolOp",()=>y,"groupToolsByCrud",()=>b],696609);let x=["read","create","update","delete","unknown"],w={low:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-red-100 text-red-800 font-semibold",unknown:"bg-gray-100 text-gray-700"},k={read:"border-green-200",create:"border-blue-200",update:"border-yellow-200",delete:"border-red-300",unknown:"border-gray-200"},_={read:"bg-green-50",create:"bg-blue-50",update:"bg-yellow-50",delete:"bg-red-50",unknown:"bg-gray-50"};e.s(["default",0,({tools:e,value:t,onChange:r,readOnly:n=!1,searchFilter:s=""})=>{let[i,a]=(0,l.useState)({read:!1,create:!1,update:!1,delete:!1,unknown:!0}),p=(0,l.useMemo)(()=>b(e),[e]),m=(0,l.useMemo)(()=>new Set(void 0===t?e.map(e=>e.name):t),[t,e]),h=e=>{if(n)return;let t=new Set(m);t.has(e)?t.delete(e):t.add(e),r(Array.from(t))};return 0===e.length?null:(0,o.jsx)("div",{className:"space-y-3",children:x.map(e=>{let t,l=p[e];if(0===l.length)return null;if(s){let e=s.toLowerCase();if(!l.some(t=>t.name.toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)))return null}let g=v[e],y=(t=p[e]).length>0&&t.every(e=>m.has(e.name)),b=(e=>{let t=p[e];if(0===t.length)return!1;let r=t.filter(e=>m.has(e.name)).length;return r>0&&r{a(t=>({...t,[e]:!t[e]}))},children:[x?(0,o.jsx)(f.default,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}):(0,o.jsx)(d.ChevronDownIcon,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}),(0,o.jsx)("span",{className:"font-semibold text-gray-900 text-sm",children:g.label}),(0,o.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full ${w[g.risk]}`,children:"high"===g.risk?"High Risk":"medium"===g.risk?"Medium Risk":"low"===g.risk?"Safe":"Unclassified"}),(0,o.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:[l.filter(e=>m.has(e.name)).length,"/",l.length," allowed"]})]}),!n&&(0,o.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,o.jsx)(u.Text,{className:"text-xs text-gray-500",children:y?"All on":b?"Partial":"All off"}),(0,o.jsx)(c.Checkbox,{checked:y,indeterminate:b,onChange:t=>((e,t)=>{if(n)return;let s=new Set(m);for(let r of p[e])t?s.add(r.name):s.delete(r.name);r(Array.from(s))})(e,t.target.checked),onClick:e=>e.stopPropagation()})]})]}),!x&&(0,o.jsx)("div",{className:"px-4 pt-2 pb-1 text-xs text-gray-500 bg-white border-b border-gray-100",children:g.description}),!x&&(0,o.jsx)("div",{className:"bg-white divide-y divide-gray-50",children:l.filter(e=>!s||e.name.toLowerCase().includes(s.toLowerCase())||(e.description??"").toLowerCase().includes(s.toLowerCase())).map(e=>{let t,r=(t=e.name,m.has(t));return(0,o.jsxs)("div",{className:`flex items-start gap-3 px-4 py-2.5 transition-colors hover:bg-gray-50 ${!n?"cursor-pointer":""} ${r?"":"opacity-60"}`,onClick:()=>h(e.name),children:[(0,o.jsx)(c.Checkbox,{checked:r,onChange:()=>h(e.name),disabled:n,onClick:e=>e.stopPropagation()}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)(u.Text,{className:"font-medium text-gray-900 text-sm",children:e.name}),e.description&&(0,o.jsx)(u.Text,{className:"text-xs text-gray-500 mt-0.5 leading-snug",children:e.description})]}),(0,o.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${r?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:r?"on":"off"})]},e.name)})})]},e)})})}],531516)},91739,e=>{"use strict";var t=e.i(544195);e.s(["Radio",()=>t.default])},988297,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.s(["PlusIcon",0,r],988297)},797672,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});e.s(["PencilIcon",0,r],797672)},500330,e=>{"use strict";var t=e.i(727749);function r(e,t){let r=structuredClone(e);for(let[e,n]of Object.entries(t))e in r&&(r[e]=n);return r}let n=(e,t=0,r=!1,n=!0)=>{if(null==e||!Number.isFinite(e)||0===e&&!n)return"-";let s={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",s);let i=e<0?"-":"",a=Math.abs(e),o=a,l="";return a>=1e6?(o=a/1e6,l="M"):a>=1e3&&(o=a/1e3,l="K"),`${i}${o.toLocaleString("en-US",s)}${l}`},s=async(e,r="Copied to clipboard")=>{if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return i(e,r);try{return await navigator.clipboard.writeText(e),t.default.success(r),!0}catch(t){return console.error("Clipboard API failed: ",t),i(e,r)}},i=(e,r)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-999999px",n.style.top="-999999px",n.setAttribute("readonly",""),document.body.appendChild(n),n.focus(),n.select();let s=document.execCommand("copy");if(document.body.removeChild(n),s)return t.default.success(r),!0;throw Error("execCommand failed")}catch(e){return t.default.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};e.s(["copyToClipboard",0,s,"formatNumberWithCommas",0,n,"getSpendString",0,(e,t=6)=>{if(null==e||!Number.isFinite(e)||0===e)return"-";let r=n(e,t,!1,!1);if(0===Number(r.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return`< $${e}`}return`$${r}`},"updateExistingKeys",()=>r])},350967,46757,e=>{"use strict";var t=e.i(290571),r=e.i(444755),n=e.i(673706),s=e.i(271645);let i={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},a={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},o={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},l={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},c={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},u={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},d={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},f={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};e.s(["colSpan",()=>c,"colSpanLg",()=>f,"colSpanMd",()=>d,"colSpanSm",()=>u,"gridCols",()=>i,"gridColsLg",()=>l,"gridColsMd",()=>o,"gridColsSm",()=>a],46757);let p=(0,n.makeClassName)("Grid"),m=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",h=s.default.forwardRef((e,n)=>{let{numItems:c=1,numItemsSm:u,numItemsMd:d,numItemsLg:f,children:h,className:g}=e,y=(0,t.__rest)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),b=m(c,i),v=m(u,a),x=m(d,o),w=m(f,l),k=(0,r.tremorTwMerge)(b,v,x,w);return s.default.createElement("div",Object.assign({ref:n,className:(0,r.tremorTwMerge)(p("root"),"grid",k,g)},y),h)});h.displayName="Grid",e.s(["Grid",()=>h],350967)},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},992619,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(779241),s=e.i(599724),i=e.i(199133),a=e.i(983561),o=e.i(689020);e.s(["default",0,({accessToken:e,value:l,placeholder:c="Select a Model",onChange:u,disabled:d=!1,style:f,className:p,showLabel:m=!0,labelText:h="Select Model"})=>{let[g,y]=(0,r.useState)(l),[b,v]=(0,r.useState)(!1),[x,w]=(0,r.useState)([]),k=(0,r.useRef)(null);return(0,r.useEffect)(()=>{y(l)},[l]),(0,r.useEffect)(()=>{e&&(async()=>{try{let t=await (0,o.fetchAvailableModels)(e);console.log("Fetched models for selector:",t),t.length>0&&w(t)}catch(e){console.error("Error fetching model info:",e)}})()},[e]),(0,t.jsxs)("div",{children:[m&&(0,t.jsxs)(s.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.RobotOutlined,{className:"mr-2"})," ",h]}),(0,t.jsx)(i.Select,{value:g,placeholder:c,onChange:e=>{"custom"===e?(v(!0),y(void 0)):(v(!1),y(e),u&&u(e))},options:[...Array.from(new Set(x.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...f},showSearch:!0,className:`rounded-md ${p||""}`,disabled:d}),b&&(0,t.jsx)(n.TextInput,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{y(e),u&&u(e)},500)},disabled:d})]})}])},743151,(e,t,r)=>{"use strict";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)}Object.defineProperty(r,"__esModule",{value:!0}),r.CopyToClipboard=void 0;var s=o(e.r(271645)),i=o(e.r(844343)),a=["text","onCopy","options","children"];function o(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(s[r]=e[r]);return s}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,a),n=s.default.Children.only(t);return s.default.cloneElement(n,c(c({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r{"use strict";var n=e.r(743151).CopyToClipboard;n.CopyToClipboard=n,t.exports=n},663435,152473,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(199133),s=e.i(898586),i=e.i(56456);let a={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class o{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...a,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function l(e,t){let[n,s]=(0,r.useState)(e),i=function(e,t){let[n]=(0,r.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new o(e,t))).filter(e=>"function"==typeof r[e]).reduce((e,t)=>{let n=r[t];return"function"==typeof n&&(e[t]=n.bind(r)),e},{})});return n.setOptions(t),n}(s,t);return[n,i.maybeExecute,i]}e.s(["useDebouncedState",()=>l],152473);var c=e.i(785242);let{Text:u}=s.Typography;e.s(["default",0,({value:e,onChange:s,onTeamSelect:a,disabled:o,organizationId:d,pageSize:f=20})=>{let[p,m]=(0,r.useState)(""),[h,g]=l("",{wait:300}),{data:y,fetchNextPage:b,hasNextPage:v,isFetchingNextPage:x,isLoading:w}=(0,c.useInfiniteTeams)(f,h||void 0,d),k=(0,r.useMemo)(()=>{if(!y?.pages)return[];let e=new Set,t=[];for(let r of y.pages)for(let n of r.teams)e.has(n.team_id)||(e.add(n.team_id),t.push(n));return t},[y]);return(0,t.jsx)(n.Select,{showSearch:!0,placeholder:"Search or select a team",value:e||void 0,onChange:e=>{s?.(e??""),a&&a(e?k.find(t=>t.team_id===e)??null:null)},disabled:o,allowClear:!0,filterOption:!1,onSearch:e=>{m(e),g(e)},searchValue:p,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&v&&!x&&b()},loading:w,notFoundContent:w?(0,t.jsx)(i.LoadingOutlined,{spin:!0}):"No teams found","data-testid":"team-dropdown",popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,x&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(i.LoadingOutlined,{spin:!0})})]}),children:k.map(e=>(0,t.jsxs)(n.Select.Option,{value:e.team_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,t.jsxs)(u,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})}],663435)},519756,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var s=e.i(9583),i=r.forwardRef(function(e,i){return r.createElement(s.default,(0,t.default)({},e,{ref:i,icon:n}))});e.s(["UploadOutlined",0,i],519756)},435451,620250,e=>{"use strict";var t=e.i(843476),r=e.i(290571),n=e.i(271645);let s=e=>{var t=(0,r.__rest)(e,[]);return n.default.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),n.default.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,r.__rest)(e,[]);return n.default.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),n.default.createElement("path",{d:"M20 12H4"}))};var a=e.i(444755),o=e.i(673706),l=e.i(677955);let c="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",u="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",d=n.default.forwardRef((e,t)=>{let{onSubmit:d,enableStepper:f=!0,disabled:p,onValueChange:m,onChange:h}=e,g=(0,r.__rest)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),y=(0,n.useRef)(null),[b,v]=n.default.useState(!1),x=n.default.useCallback(()=>{v(!0)},[]),w=n.default.useCallback(()=>{v(!1)},[]),[k,_]=n.default.useState(!1),C=n.default.useCallback(()=>{_(!0)},[]),E=n.default.useCallback(()=>{_(!1)},[]);return n.default.createElement(l.default,Object.assign({type:"number",ref:(0,o.mergeRefs)([y,t]),disabled:p,makeInputClassName:(0,o.makeClassName)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null==(t=y.current)?void 0:t.value;null==d||d(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&C()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&E()},onChange:e=>{p||(null==m||m(parseFloat(e.target.value)),null==h||h(e))},stepper:f?n.default.createElement("div",{className:(0,a.tremorTwMerge)("flex justify-center align-middle")},n.default.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=y.current)||e.stepDown(),null==(t=y.current)||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,a.tremorTwMerge)(!p&&u,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},n.default.createElement(i,{"data-testid":"step-down",className:(b?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),n.default.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=y.current)||e.stepUp(),null==(t=y.current)||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,a.tremorTwMerge)(!p&&u,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},n.default.createElement(s,{"data-testid":"step-up",className:(k?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});d.displayName="NumberInput",e.s(["NumberInput",()=>d],620250),e.s(["default",0,({step:e=.01,style:r={width:"100%"},placeholder:n="Enter a numerical value",min:s,max:i,onChange:a,...o})=>(0,t.jsx)(d,{onWheel:e=>e.currentTarget.blur(),step:e,style:r,placeholder:n,min:s,max:i,onChange:a,...o})],435451)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1d0991370c308b4d.js b/litellm/proxy/_experimental/out/_next/static/chunks/1d0991370c308b4d.js
deleted file mode 100644
index c0b3d35df7..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/1d0991370c308b4d.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56567,838932,e=>{"use strict";var t=e.i(843476),l=e.i(135214),a=e.i(109799),s=e.i(912598),i=e.i(907308),r=e.i(764205),n=e.i(266027);let o=(0,e.i(243652).createQueryKeys)("guardrails"),d=()=>{let{accessToken:e,userId:t,userRole:a}=(0,l.default)();return(0,n.useQuery)({queryKey:o.list({}),queryFn:async()=>(0,r.getGuardrailsList)(e),enabled:!!(e&&t&&a),select:e=>{let t=e?.guardrails??[],l=new Set,a=new Set;for(let e of t)e.litellm_params?.default_on?l.add(e.guardrail_name):a.add(e.guardrail_name);return{guardrails:t,globalGuardrailNames:l,optionalGuardrailNames:a}}})};e.s(["useGuardrails",0,d],838932);var m=e.i(500330),c=e.i(11751),u=e.i(708347),g=e.i(751904),h=e.i(160818),x=e.i(827252),p=e.i(564897),_=e.i(646563),b=e.i(987432),y=e.i(530212),j=e.i(677667),f=e.i(130643),v=e.i(898667),T=e.i(389083),S=e.i(304967),w=e.i(350967),N=e.i(599724),C=e.i(779241),k=e.i(629569),I=e.i(464571),M=e.i(808613),z=e.i(311451),F=e.i(28651),O=e.i(199133),P=e.i(770914),D=e.i(790848),A=e.i(653496),L=e.i(262218),R=e.i(592968),B=e.i(888259),V=e.i(678784),U=e.i(118366),E=e.i(271645),$=e.i(9314),K=e.i(552130),G=e.i(127952);function W({className:e,value:l,onChange:a}){return(0,t.jsxs)(O.Select,{className:e,value:l,onChange:a,children:[(0,t.jsx)(O.Select.Option,{value:"24h",children:"Daily"}),(0,t.jsx)(O.Select.Option,{value:"7d",children:"Weekly"}),(0,t.jsx)(O.Select.Option,{value:"30d",children:"Monthly"})]})}var q=e.i(844565),H=e.i(355619);let J=function({globalGuardrailNames:e,teamGuardrails:l=[],optedOutGlobalGuardrails:a=[],killSwitchOn:s=!1,variant:i="card",className:r=""}){let n=new Set(a),o=Array.from(e).filter(e=>!n.has(e)),d=l.filter(t=>!e.has(t)),m=s||0!==o.length||0!==d.length?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:[(0,t.jsx)(h.GlobalOutlined,{style:{marginInlineEnd:4},"aria-label":"Global guardrail"}),"Global"]}),s?(0,t.jsx)(L.Tag,{color:"gold",children:"Bypassed for this team"}):o.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,t.jsx)(L.Tag,{color:"blue",children:e},e))}):(0,t.jsx)("span",{className:"block text-sm text-gray-500",children:"None configured"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Team-specific"}),d.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:d.map(e=>(0,t.jsx)(L.Tag,{color:"blue",children:e},e))}):(0,t.jsx)("span",{className:"block text-sm text-gray-500",children:"None configured"})]})]}):(0,t.jsx)("span",{className:"block text-gray-500",children:"No guardrails configured"});return"card"===i?(0,t.jsxs)("div",{className:`bg-white border border-gray-200 rounded-lg p-6 ${r}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block font-semibold text-gray-900",children:"Guardrails Settings"}),(0,t.jsx)("span",{className:"block text-xs text-gray-500",children:"Global and team-specific guardrails applied to this team"})]})}),m]}):(0,t.jsxs)("div",{className:`${r}`,children:[(0,t.jsx)("span",{className:"block font-medium text-gray-900 mb-3",children:"Guardrails Settings"}),m]})};var Q=e.i(643449),Y=e.i(75921),X=e.i(390605),Z=e.i(162386),ee=e.i(727749),et=e.i(384767),el=e.i(435451),ea=e.i(916940),es=e.i(183588),ei=e.i(460285),er=e.i(276173),en=e.i(91979),eo=e.i(269200),ed=e.i(942232),em=e.i(977572),ec=e.i(427612),eu=e.i(64848),eg=e.i(496020),eh=e.i(536916),ex=e.i(21548);let ep={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team","/team/daily/activity":"Member can view all team usage data (not just their own)","/spend/logs":"Member can view spend logs for the entire team (not just their own)"},e_=({teamId:e,accessToken:l,canEditTeam:a})=>{let[s,i]=(0,E.useState)([]),[n,o]=(0,E.useState)([]),[d,m]=(0,E.useState)(!0),[c,u]=(0,E.useState)(!1),[g,h]=(0,E.useState)(!1),x=async()=>{try{if(m(!0),!l)return;let t=await (0,r.getTeamPermissionsCall)(l,e),a=t.all_available_permissions||[];i(a);let s=t.team_member_permissions||[];o(s),h(!1)}catch(e){ee.default.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{m(!1)}};(0,E.useEffect)(()=>{x()},[e,l]);let p=async()=>{try{if(!l)return;u(!0),await (0,r.teamPermissionsUpdateCall)(l,e,n),ee.default.success("Permissions updated successfully"),h(!1)}catch(e){ee.default.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{u(!1)}};if(d)return(0,t.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let _=s.length>0;return(0,t.jsxs)(S.Card,{className:"bg-white shadow-md rounded-md p-6",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,t.jsx)(k.Title,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),a&&g&&(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(I.Button,{icon:(0,t.jsx)(en.ReloadOutlined,{}),onClick:()=>{x()},children:"Reset"}),(0,t.jsx)(I.Button,{onClick:p,loading:c,type:"primary",icon:(0,t.jsx)(b.SaveOutlined,{}),children:"Save Changes"})]})]}),(0,t.jsx)(N.Text,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),_?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(eo.Table,{className:" min-w-full",children:[(0,t.jsx)(ec.TableHead,{children:(0,t.jsxs)(eg.TableRow,{children:[(0,t.jsx)(eu.TableHeaderCell,{children:"Method"}),(0,t.jsx)(eu.TableHeaderCell,{children:"Endpoint"}),(0,t.jsx)(eu.TableHeaderCell,{children:"Description"}),(0,t.jsx)(eu.TableHeaderCell,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,t.jsx)(ed.TableBody,{children:s.map(e=>{let l=(e=>{let t=e.includes("/info")||e.includes("/list")||e.includes("/activity")||"/spend/logs"===e?"GET":"POST",l=ep[e];if(!l){for(let[t,a]of Object.entries(ep))if(e.includes(t)){l=a;break}}return l||(l=`Access ${e}`),{method:t,endpoint:e,description:l,route:e}})(e);return(0,t.jsxs)(eg.TableRow,{className:"hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(em.TableCell,{children:(0,t.jsx)("span",{className:`px-2 py-1 rounded text-xs font-medium ${"GET"===l.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:l.method})}),(0,t.jsx)(em.TableCell,{children:(0,t.jsx)("span",{className:"font-mono text-sm text-gray-800",children:l.endpoint})}),(0,t.jsx)(em.TableCell,{className:"text-gray-700",children:l.description}),(0,t.jsx)(em.TableCell,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,t.jsx)(eh.Checkbox,{checked:n.includes(e),onChange:t=>{o(t.target.checked?[...n,e]:n.filter(t=>t!==e)),h(!0)},disabled:!a})})]},e)})})]})}):(0,t.jsx)("div",{className:"py-12",children:(0,t.jsx)(ex.Empty,{description:"No permissions available"})})]})};var eb=e.i(822315);function ey(e){if(!e)return null;let t=(0,eb.default)(e);return t.isValid()?t.format("MMM D, YYYY"):null}var ej=e.i(175712),ef=e.i(178654),ev=e.i(621192),eT=e.i(898586);let eS=async(e,t)=>{let l=(0,r.getProxyBaseUrl)(),a=l?`${l}/team/${encodeURIComponent(t)}/members/me`:`/team/${encodeURIComponent(t)}/members/me`,s=await fetch(a,{method:"GET",headers:{[(0,r.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(404===s.status)return null;if(!s.ok){let e=await s.json().catch(()=>({}));throw Error((0,r.deriveErrorMessage)(e))}return await s.json()},ew=(e,l)=>(0,t.jsxs)(P.Space,{size:4,children:[(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:e}),(0,t.jsx)(R.Tooltip,{title:l,children:(0,t.jsx)(x.InfoCircleOutlined,{style:{color:"#8c8c8c"}})})]}),eN=(e,t=4)=>null==e?"0":(0,m.formatNumberWithCommas)(e,t),eC=e=>null==e?"Unlimited":(0,m.formatNumberWithCommas)(e,0);function ek({teamId:e}){let{data:a,isLoading:s,error:i}=(e=>{let{accessToken:t}=(0,l.default)();return(0,n.useQuery)({queryKey:["team",e,"members","me"],queryFn:()=>eS(t,e),enabled:!!(t&&e)})})(e);if(s)return(0,t.jsx)(ej.Card,{children:(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:"Loading your membership info…"})});if(i)return(0,t.jsx)(ej.Card,{children:(0,t.jsx)(eT.Typography.Text,{type:"danger",children:i instanceof Error?i.message:"Failed to load your membership info for this team."})});if(!a)return(0,t.jsx)(ej.Card,{children:(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:"No membership info available for the current user in this team."})});let r=a.litellm_budget_table??null,o=r?.max_budget??null,d=a.spend??0,m=a.total_spend??0,c=r?.tpm_limit??null,u=r?.rpm_limit??null,g=ey(r?.budget_reset_at),h=r?.allowed_models??null;return(0,t.jsxs)(P.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,t.jsx)(ej.Card,{children:(0,t.jsxs)(ev.Row,{gutter:[24,16],children:[(0,t.jsxs)(ef.Col,{xs:24,sm:12,md:8,children:[(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:"User"}),(0,t.jsx)("div",{style:{marginTop:4},children:(0,t.jsx)(eT.Typography.Text,{strong:!0,children:a.user_email||a.user_id})}),(0,t.jsx)(eT.Typography.Text,{type:"secondary",style:{fontSize:12,fontFamily:"monospace"},children:a.user_id})]}),(0,t.jsxs)(ef.Col,{xs:24,sm:12,md:8,children:[(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:"Team Role"}),(0,t.jsx)("div",{style:{marginTop:4},children:(0,t.jsx)(L.Tag,{color:"admin"===a.role?"blue":"default",children:a.role||"user"})})]})]})}),(0,t.jsxs)(ev.Row,{gutter:[16,16],children:[(0,t.jsx)(ef.Col,{xs:24,md:12,children:(0,t.jsxs)(ej.Card,{children:[ew("Current Cycle Spend (USD)","Spend for the current budget cycle. Resets to $0 when the budget window rolls over."),(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsxs)(eT.Typography.Title,{level:3,style:{margin:0},children:["$",eN(d,4)]}),(0,t.jsxs)(eT.Typography.Text,{type:"secondary",children:["of ",null===o?"Unlimited":`$${eN(o,4)}`]})]}),g&&(0,t.jsx)("div",{style:{marginTop:4},children:(0,t.jsxs)(eT.Typography.Text,{type:"secondary",children:["Resets ",g]})})]})}),(0,t.jsx)(ef.Col,{xs:24,md:12,children:(0,t.jsxs)(ej.Card,{children:[ew("Rate Limits","Your per-member rate limits within this team."),(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsxs)(eT.Typography.Text,{children:["TPM: ",eC(c)]}),(0,t.jsx)("br",{}),(0,t.jsxs)(eT.Typography.Text,{children:["RPM: ",eC(u)]})]})]})}),(0,t.jsx)(ef.Col,{xs:24,md:12,children:(0,t.jsxs)(ej.Card,{children:[ew("Total Spend (USD)","Cumulative spend across all budget cycles within this team."),(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsxs)(eT.Typography.Title,{level:4,style:{margin:0},children:["$",eN(m,4)]})})]})}),(0,t.jsx)(ef.Col,{xs:24,md:12,children:(0,t.jsxs)(ej.Card,{children:[ew("Model Scope","Models you can access within this team."),(0,t.jsx)("div",{style:{marginTop:8},children:h&&h.length>0?(0,t.jsx)(P.Space,{wrap:!0,children:h.map(e=>(0,t.jsx)(L.Tag,{children:e},e))}):(0,t.jsx)(eT.Typography.Text,{children:"All Team Models"})})]})})]})]})}let eI="overview",eM="my-user",ez="virtual-keys",eF="members",eO="member-permissions",eP="settings",eD={[eI]:"Overview",[eM]:"My User",[ez]:"Virtual Keys",[eF]:"Members",[eO]:"Member Permissions",[eP]:"Settings"};var eA=e.i(292639),eL=e.i(294612);function eR({teamData:e,canEditTeam:a,handleMemberDelete:s,setSelectedEditMember:i,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:n}){let o=e=>{if(null==e)return"0";if("number"==typeof e){let t=Number(e);return t===Math.floor(t)?t.toString():(0,m.formatNumberWithCommas)(t,8).replace(/\.?0+$/,"")}return"0"},{data:d}=(0,eA.useUISettings)(),{userId:c,userRole:g}=(0,l.default)(),h=!!d?.values?.disable_team_admin_delete_team_user,p=(0,u.isUserTeamAdminForSingleTeam)(e.team_info.members_with_roles,c||""),_=(0,u.isProxyAdminRole)(g||""),b=[{title:(0,t.jsxs)(P.Space,{direction:"horizontal",children:["Model Scope",(0,t.jsx)(R.Tooltip,{title:"Models this member can access. Empty means they inherit all team models.",children:(0,t.jsx)(x.InfoCircleOutlined,{})})]}),key:"model_scope",render:(l,a)=>{let s=(t=>{if(!t)return null;let l=e.team_memberships.find(e=>e.user_id===t),a=l?.litellm_budget_table?.allowed_models;return a&&a.length>0?a:null})(a.user_id);if(!s)return(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:"(all team models)"});let i=s.slice(0,2),r=s.length-i.length;return(0,t.jsxs)(P.Space,{wrap:!0,children:[i.map(e=>(0,t.jsx)(eT.Typography.Text,{code:!0,style:{fontSize:"12px"},children:e},e)),r>0&&(0,t.jsx)(R.Tooltip,{title:s.slice(2).join(", "),children:(0,t.jsxs)(eT.Typography.Text,{type:"secondary",children:["+",r," more"]})})]})}},{title:(0,t.jsxs)(P.Space,{direction:"horizontal",children:["Current Cycle Spend (USD)",(0,t.jsx)(R.Tooltip,{title:"Spend for the current budget cycle. Resets to $0 when the member's budget window rolls over. This is the value checked against the member's budget.",children:(0,t.jsx)(x.InfoCircleOutlined,{})})]}),key:"spend",render:(l,a)=>(0,t.jsxs)(eT.Typography.Text,{children:["$",(0,m.formatNumberWithCommas)((t=>{if(!t)return 0;let l=e.team_memberships.find(e=>e.user_id===t);return l?.spend??0})(a.user_id),4)]})},{title:(0,t.jsxs)(P.Space,{direction:"horizontal",children:["Total Spend (USD)",(0,t.jsx)(R.Tooltip,{title:"Cumulative spend by this member within this team, across all budget cycles. Tracking began 2026-04-21; spend from before that date is not included.",children:(0,t.jsx)(x.InfoCircleOutlined,{})})]}),key:"total_spend",render:(l,a)=>(0,t.jsxs)(eT.Typography.Text,{children:["$",(0,m.formatNumberWithCommas)((t=>{if(!t)return 0;let l=e.team_memberships.find(e=>e.user_id===t);return l?.total_spend??0})(a.user_id),4)]})},{title:"Team Member Budget (USD)",key:"budget",render:(l,a)=>{let s=(t=>{if(!t)return null;let l=e.team_memberships.find(e=>e.user_id===t),a=l?.litellm_budget_table?.max_budget;return null==a?null:o(a)})(a.user_id);return(0,t.jsx)(eT.Typography.Text,{children:s?`$${(0,m.formatNumberWithCommas)(Number(s),4)}`:"No Limit"})}},{title:"Budget Reset",key:"budget_reset",render:(l,a)=>{let s=(t=>{if(!t)return null;let l=e.team_memberships.find(e=>e.user_id===t);return ey(l?.litellm_budget_table?.budget_reset_at)})(a.user_id);return s?(0,t.jsx)(eT.Typography.Text,{children:s}):(0,t.jsx)(eT.Typography.Text,{type:"secondary",children:"—"})}},{title:(0,t.jsxs)(P.Space,{direction:"horizontal",children:["Team Member Rate Limits",(0,t.jsx)(R.Tooltip,{title:"Rate limits for this member's usage within this team.",children:(0,t.jsx)(x.InfoCircleOutlined,{})})]}),key:"rate_limits",render:(l,a)=>(0,t.jsx)(eT.Typography.Text,{children:(t=>{if(!t)return"No Limits";let l=e.team_memberships.find(e=>e.user_id===t),a=l?.litellm_budget_table?.rpm_limit,s=l?.litellm_budget_table?.tpm_limit,i=[a?`${o(a)} RPM`:null,s?`${o(s)} TPM`:null].filter(Boolean);return i.length>0?i.join(" / "):"No Limits"})(a.user_id)})}];return(0,t.jsx)(eL.default,{members:e.team_info.members_with_roles,canEdit:a,onEdit:t=>{let l=e.team_memberships.find(e=>e.user_id===t.user_id);i({...t,max_budget_in_team:l?.litellm_budget_table?.max_budget||null,tpm_limit:l?.litellm_budget_table?.tpm_limit||null,rpm_limit:l?.litellm_budget_table?.rpm_limit||null,allowed_models:l?.litellm_budget_table?.allowed_models||[]}),r(!0)},onDelete:s,onAddMember:()=>n(!0),roleColumnTitle:"Team Role",roleTooltip:"This role applies only to this team and is independent from the user's proxy-level role.",extraColumns:b,showDeleteForMember:()=>_||a&&!p||p&&!h})}var eB=e.i(207082),eV=e.i(871943),eU=e.i(502547),eE=e.i(360820),e$=e.i(94629),eK=e.i(152990),eG=e.i(682830),eW=e.i(994388),eq=e.i(752978),eH=e.i(282786),eJ=e.i(981339),eQ=e.i(969550),eY=e.i(20147),eX=e.i(633627);function eZ({teamId:e,teamAlias:a,organization:s}){let{accessToken:i}=(0,l.default)(),[r,o]=(0,E.useState)(null),[d,c]=(0,E.useState)([{id:"created_at",desc:!0}]),[u,g]=(0,E.useState)({pageIndex:0,pageSize:50}),[h,p]=(0,E.useState)({"Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"}),_=d.length>0?d[0].id:"created_at",b=d.length>0?d[0].desc?"desc":"asc":"desc",y=u.pageIndex,j=u.pageSize,{data:f,isPending:v,isFetching:S,refetch:w}=(0,eB.useKeys)(y+1,j,{teamID:e,organizationID:h["Organization ID"]?.trim()||void 0,selectedKeyAlias:h["Key Alias"]?.trim()||void 0,userID:h["User ID"]?.trim()||void 0,sortBy:_||void 0,sortOrder:b||void 0,expand:"user"}),C=(0,E.useMemo)(()=>{let e=f?.keys||[],t=s?.organization_id;return t?e.map(e=>({...e,organization_id:(e.organization_id??e.org_id)||t})):e},[f?.keys,s?.organization_id]),k=f?.total_pages??0,[I,M]=(0,E.useState)({}),z=(0,E.useMemo)(()=>({team_id:e,team_alias:a||e,models:[],max_budget:null,budget_duration:null,tpm_limit:null,rpm_limit:null,organization_id:s?.organization_id||"",created_at:"",keys:[],members_with_roles:[],spend:0}),[e,a,s]),F=(0,n.useQuery)({queryKey:["teamFilterOptions",e,i],queryFn:async()=>(0,eX.fetchTeamFilterOptions)(i,e),enabled:!!i&&!!e,staleTime:3e4}).data||{keyAliases:[],organizationIds:[],userIds:[]},O=(0,E.useCallback)(()=>{w?.()},[w]);(0,E.useEffect)(()=>(window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)),[O]);let P=(0,E.useCallback)((e,t=!1)=>{p(t=>({...t,"Organization ID":e["Organization ID"]??t["Organization ID"],"Key Alias":e["Key Alias"]??t["Key Alias"],"User ID":e["User ID"]??t["User ID"],"Sort By":e["Sort By"]??t["Sort By"]??"created_at","Sort Order":e["Sort Order"]??t["Sort Order"]??"desc"})),t||g(e=>({...e,pageIndex:0}))},[]),D=(0,E.useCallback)(()=>{p({"Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"}),g(e=>({...e,pageIndex:0}))},[]),A=(0,E.useMemo)(()=>[{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>{let{organizationIds:t}=F;if(!t.length)return[];let l=e.toLowerCase();return(l?t.filter(e=>e.toLowerCase().includes(l)):t).map(e=>({label:e,value:e}))}},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>{let{keyAliases:t}=F,l=e.toLowerCase();return(l?t.filter(e=>e.toLowerCase().includes(l)):t).map(e=>({label:e,value:e}))}},{name:"User ID",label:"User ID",isSearchable:!0,searchFn:async e=>{let{userIds:t}=F,l=e.toLowerCase();return(l?t.filter(e=>e.id.toLowerCase().includes(l)||e.email.toLowerCase().includes(l)):t).map(e=>({label:e.email?`${e.id} (${e.email})`:e.id,value:e.id}))}}],[F]),L=(0,E.useMemo)(()=>[{id:"token",accessorKey:"token",header:"Key ID",size:100,enableSorting:!0,cell:e=>{let l=e.getValue(),a=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:l,children:(0,t.jsx)(eW.Button,{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 overflow-hidden truncate block",style:{maxWidth:a,overflow:"hidden"},onClick:()=>o(e.row.original),children:l??"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,enableSorting:!0,cell:e=>{let l=e.getValue(),a=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:l,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:a,overflow:"hidden"},children:l??"-"})})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",size:120,enableSorting:!1,cell:e=>(0,t.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",size:140,enableSorting:!1,cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user",header:"User Email",size:160,enableSorting:!1,cell:e=>{let l=e.getValue(),a=l?.user_email,s=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:a,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:s,overflow:"hidden"},children:a??"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:70,enableSorting:!1,cell:e=>{let l=e.getValue(),a="default_user_id"===l?"Default Proxy Admin":l,s=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:a,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:s,overflow:"hidden"},children:a??"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,enableSorting:!0,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:70,enableSorting:!1,cell:e=>{let l=e.getValue(),a="default_user_id"===l?"Default Proxy Admin":l,s=e.cell.column.getSize();return(0,t.jsx)(R.Tooltip,{title:a,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:s,overflow:"hidden"},children:a??"-"})})}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",size:120,enableSorting:!0,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"last_active",accessorKey:"last_active",header:()=>(0,t.jsxs)("span",{className:"flex items-center gap-1",children:["Last Active",(0,t.jsx)(eH.Popover,{content:"This is a new field and is not backfilled. Only new key usage will update this value.",trigger:"hover",children:(0,t.jsx)(x.InfoCircleOutlined,{className:"text-gray-400 text-xs cursor-help"})})]}),size:130,enableSorting:!1,cell:e=>{let l=e.getValue();if(!l)return"Unknown";let a=new Date(l);return(0,t.jsx)(R.Tooltip,{title:a.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"long"}),children:(0,t.jsx)("span",{children:a.toLocaleDateString()})})}},{id:"expires",accessorKey:"expires",header:"Expires",size:120,enableSorting:!1,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,enableSorting:!0,cell:e=>(0,m.formatNumberWithCommas)(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,enableSorting:!0,cell:e=>{let t=e.getValue();return null===t?"Unlimited":`$${(0,m.formatNumberWithCommas)(t)}`}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",size:130,enableSorting:!1,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",size:200,enableSorting:!1,cell:e=>{let l=e.getValue();return(0,t.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(l)?(0,t.jsx)("div",{className:"flex flex-col",children:0===l.length?(0,t.jsx)(T.Badge,{size:"xs",className:"mb-1",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})}):(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"flex items-start",children:[l.length>3&&(0,t.jsx)("div",{children:(0,t.jsx)(eq.Icon,{icon:I[e.row.id]?eV.ChevronDownIcon:eU.ChevronRightIcon,className:"cursor-pointer",size:"xs",onClick:()=>M(t=>({...t,[e.row.id]:!t[e.row.id]}))})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,3).map((e,l)=>"all-proxy-models"===e?(0,t.jsx)(T.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})},l):(0,t.jsx)(T.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(N.Text,{children:e.length>30?`${(0,H.getModelDisplayName)(e).slice(0,30)}...`:(0,H.getModelDisplayName)(e)})},l)),l.length>3&&!I[e.row.id]&&(0,t.jsx)(T.Badge,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,t.jsxs)(N.Text,{children:["+",l.length-3," ",l.length-3==1?"more model":"more models"]})}),I[e.row.id]&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:l.slice(3).map((e,l)=>"all-proxy-models"===e?(0,t.jsx)(T.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})},l+3):(0,t.jsx)(T.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(N.Text,{children:e.length>30?`${(0,H.getModelDisplayName)(e).slice(0,30)}...`:(0,H.getModelDisplayName)(e)})},l+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",size:140,enableSorting:!1,cell:({row:e})=>{let l=e.original;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{children:["TPM: ",null!==l.tpm_limit?l.tpm_limit:"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",null!==l.rpm_limit?l.rpm_limit:"Unlimited"]})]})}}],[I]),B=(0,E.useCallback)(e=>{let t="function"==typeof e?e(d):e;if(c(t),t?.length>0){let e=t[0];P({"Sort By":e.id,"Sort Order":e.desc?"desc":"asc"},!0)}},[d,P]),V=(0,eK.useReactTable)({data:C,columns:L,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:d,pagination:u},onSortingChange:B,onPaginationChange:g,getCoreRowModel:(0,eG.getCoreRowModel)(),enableSorting:!0,manualSorting:!0,manualPagination:!0,pageCount:k});return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:r?(0,t.jsx)(eY.default,{keyId:r.token,onClose:()=>o(null),keyData:r,teams:[z],onDelete:w}):(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"w-full mb-6",children:(0,t.jsx)(eQ.default,{options:A,onApplyFilters:P,initialValues:h,onResetFilters:D})}),(0,t.jsx)("div",{className:"flex items-center justify-end w-full mb-4",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[v||S?(0,t.jsx)(eJ.Skeleton.Node,{active:!0,style:{width:74,height:20}}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",y+1," of ",V.getPageCount()]}),v||S?(0,t.jsx)(eJ.Skeleton.Button,{active:!0,size:"small",style:{width:84,height:30}}):(0,t.jsx)("button",{onClick:()=>V.previousPage(),disabled:v||S||!V.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),v||S?(0,t.jsx)(eJ.Skeleton.Button,{active:!0,size:"small",style:{width:58,height:30}}):(0,t.jsx)("button",{onClick:()=>V.nextPage(),disabled:v||S||!V.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(eo.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:V.getCenterTotalSize()},children:[(0,t.jsx)(ec.TableHead,{children:V.getHeaderGroups().map(e=>(0,t.jsx)(eg.TableRow,{children:e.headers.map(e=>(0,t.jsx)(eu.TableHeaderCell,{"data-header-id":e.id,className:`py-1 h-8 relative hover:bg-gray-50 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,style:{width:e.getSize(),position:"relative",cursor:e.column.getCanSort()?"pointer":"default"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,eK.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(eE.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(eV.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(e$.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${V.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(ed.TableBody,{children:v||S?(0,t.jsx)(eg.TableRow,{children:(0,t.jsx)(em.TableCell,{colSpan:L.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"Loading keys..."})})})}):C.length>0?V.getRowModel().rows.map(e=>(0,t.jsx)(eg.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(em.TableCell,{style:{width:e.column.getSize(),maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"models"===e.column.id&&Array.isArray(e.getValue())&&e.getValue().length>3?"px-0":""}`,children:(0,eK.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(eg.TableRow,{children:(0,t.jsx)(em.TableCell,{colSpan:L.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}e.s(["default",0,({teamId:e,onClose:n,accessToken:o,is_team_admin:en,is_proxy_admin:eo,is_org_admin:ed=!1,userModels:em,editTeam:ec,premiumUser:eu=!1,onUpdate:eg})=>{let eh,ex,ep,eb,ey,ej,[ef,ev]=(0,E.useState)(null),[eT,eS]=(0,E.useState)(!0),[ew,eN]=(0,E.useState)(!1),[eC]=M.Form.useForm(),[eA,eL]=(0,E.useState)(!1),[eB,eV]=(0,E.useState)(null),[eU,eE]=(0,E.useState)(!1),[e$,eK]=(0,E.useState)([]),[eG,eW]=(0,E.useState)(!1),[eq,eH]=(0,E.useState)({}),{data:eJ,isLoading:eQ}=d(),eY=eJ?.globalGuardrailNames??new Set,[eX,e0]=(0,E.useState)([]),[e1,e4]=(0,E.useState)({}),[e2,e5]=(0,E.useState)(!1),[e3,e6]=(0,E.useState)(null),[e8,e7]=(0,E.useState)(!1),[e9,te]=(0,E.useState)(!1),[tt,tl]=(0,E.useState)(!1),ta=E.default.useRef(null),[ts,ti]=(0,E.useState)(null),{userRole:tr,userId:tn}=(0,l.default)(),{data:to=[]}=(0,a.useOrganizations)(),td=(0,s.useQueryClient)(),tm=(0,E.useMemo)(()=>{let e=ef?.team_info?.organization_id;if(!e||!tn)return!1;let t=to.find(t=>t.organization_id===e);return t?.members?.some(e=>e.user_id===tn&&"org_admin"===e.user_role)??!1},[ef,to,tn]),tc=M.Form.useWatch("models",eC),tu=M.Form.useWatch("disable_global_guardrails",eC),tg=(0,E.useMemo)(()=>{let e=tc??ef?.team_info?.models??[];return e.includes("all-proxy-models")||e.includes("all-team-models")?em:(0,H.unfurlWildcardModelsInList)(e,em)},[tc,ef,em]),th=en||eo||ed||tm,tx=(0,E.useMemo)(()=>{let e;return e=[eI,eM,ez],th?[...e,eF,eO,eP]:e},[th]),tp=(0,E.useMemo)(()=>ec&&th?eP:eI,[ec,th]),t_=async()=>{try{if(eS(!0),!o)return;let t=await (0,r.teamInfoCall)(o,e);ev(t)}catch(e){ee.default.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{eS(!1)}};(0,E.useEffect)(()=>{t_()},[e,o]),(0,E.useEffect)(()=>{(async()=>{if(!o||!ef?.team_info?.organization_id)return ti(null);try{let e=await (0,r.organizationInfoCall)(o,ef.team_info.organization_id);ti(e)}catch(e){console.error("Error fetching organization info:",e),ti(null)}})()},[o,ef?.team_info?.organization_id]),(0,E.useMemo)(()=>{let e;return e=[],e=ts?ts.models.includes("all-proxy-models")?em:ts.models.length>0?ts.models:em:em,(0,H.unfurlWildcardModelsInList)(e,em)},[ts,em]),(0,E.useEffect)(()=>{(async()=>{try{if(!o)return;let e=(await (0,r.getPoliciesList)(o)).policies.map(e=>e.policy_name);e0(e)}catch(e){console.error("Failed to fetch policies:",e)}})()},[o]),(0,E.useEffect)(()=>{(async()=>{if(!o||!ef?.team_info?.policies||0===ef.team_info.policies.length)return;e5(!0);let e={};try{await Promise.all(ef.team_info.policies.map(async t=>{try{let l=await (0,r.getPolicyInfoWithGuardrails)(o,t);e[t]=l.resolved_guardrails||[]}catch(l){console.error(`Failed to fetch guardrails for policy ${t}:`,l),e[t]=[]}})),e4(e)}catch(e){console.error("Failed to fetch policy guardrails:",e)}finally{e5(!1)}})()},[o,ef?.team_info?.policies]);let tb=async t=>{try{if(null==o)return;let l={user_email:t.user_email,user_id:t.user_id,role:t.role};await (0,r.teamMemberAddCall)(o,e,l),ee.default.success("Team member added successfully"),eN(!1),eC.resetFields();let a=await (0,r.teamInfoCall)(o,e);ev(a),eg(a)}catch(t){let e="Failed to add team member";t?.raw?.detail?.error?.includes("Assigning team admins is a premium feature")?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":t?.message&&(e=t.message),ee.default.fromBackend(e),console.error("Error adding team member:",t)}},ty=async t=>{try{if(null==o)return;let l={user_email:t.user_email,user_id:t.user_id,role:t.role,max_budget_in_team:t.max_budget_in_team,tpm_limit:t.tpm_limit,rpm_limit:t.rpm_limit,allowed_models:t.allowed_models};B.default.destroy(),await (0,r.teamMemberUpdateCall)(o,e,l),ee.default.success("Team member updated successfully"),eL(!1);let a=await (0,r.teamInfoCall)(o,e);ev(a),eg(a)}catch(t){let e="Failed to update team member";t?.raw?.detail?.includes("Assigning team admins is a premium feature")?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":t?.message&&(e=t.message),eL(!1),B.default.destroy(),ee.default.fromBackend(e),console.error("Error updating team member:",t)}},tj=async()=>{if(e3&&o){te(!0);try{await (0,r.teamMemberDeleteCall)(o,e,e3),ee.default.success("Team member removed successfully");let t=await (0,r.teamInfoCall)(o,e);ev(t),eg(t)}catch(e){ee.default.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{te(!1),e7(!1),e6(null)}}},tf=async t=>{try{let l;if(!o)return;tl(!0);let s={};try{let{soft_budget_alerting_emails:e,...l}=t.metadata?JSON.parse(t.metadata):{};s=l}catch(e){ee.default.fromBackend("Invalid JSON in metadata field");return}if("string"==typeof t.secret_manager_settings&&t.secret_manager_settings.trim().length>0)try{l=JSON.parse(t.secret_manager_settings)}catch(e){ee.default.fromBackend("Invalid JSON in secret manager settings");return}let i=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,n={},d={};for(let e of t.modelLimits??[])e?.model&&(null!=e.tpm&&(n[e.model]=e.tpm),null!=e.rpm&&(d[e.model]=e.rpm));let m=!0===t.disable_global_guardrails,u=m?Array.from(eY):Array.from(eY).filter(e=>!(t.guardrails||[]).includes(e)),g={team_id:e,team_alias:t.team_alias,models:t.models,tpm_limit:i(t.tpm_limit),rpm_limit:i(t.rpm_limit),model_tpm_limit:n,model_rpm_limit:d,max_budget:t.max_budget,soft_budget:i(t.soft_budget),budget_duration:t.budget_duration,metadata:{...s,guardrails:(t.guardrails||[]).filter(e=>!eY.has(e)),opted_out_global_guardrails:u,...t.logging_settings?.length>0?{logging:t.logging_settings}:{},disable_global_guardrails:m,soft_budget_alerting_emails:"string"==typeof t.soft_budget_alerting_emails?t.soft_budget_alerting_emails.split(",").map(e=>e.trim()).filter(e=>e.length>0):t.soft_budget_alerting_emails||[],...void 0!==l?{secret_manager_settings:l}:{}},...t.policies?.length>0?{policies:t.policies}:{},...t.organization_id!==tv.organization_id?{organization_id:t.organization_id??null}:{}};g.max_budget=(0,c.mapEmptyStringToNull)(g.max_budget),g.team_member_budget_duration=t.team_member_budget_duration,void 0!==t.team_member_budget&&(g.team_member_budget=Number(t.team_member_budget)),void 0!==t.team_member_key_duration&&(g.team_member_key_duration=t.team_member_key_duration),(void 0!==t.team_member_tpm_limit||void 0!==t.team_member_rpm_limit)&&(g.team_member_tpm_limit=i(t.team_member_tpm_limit),g.team_member_rpm_limit=i(t.team_member_rpm_limit));let{servers:h,accessGroups:x,toolsets:p}=t.mcp_servers_and_groups||{servers:[],accessGroups:[],toolsets:[]},_=new Set(h||[]),b=Object.fromEntries(Object.entries(t.mcp_tool_permissions||{}).filter(([e])=>_.has(e)));g.object_permission={},h&&(g.object_permission.mcp_servers=h),x&&(g.object_permission.mcp_access_groups=x),b&&(g.object_permission.mcp_tool_permissions=b),p&&(g.object_permission.mcp_toolsets=p),delete t.mcp_servers_and_groups,delete t.mcp_tool_permissions;let{agents:y,accessGroups:j}=t.agents_and_groups||{agents:[],accessGroups:[]};y&&y.length>0&&(g.object_permission.agents=y),j&&j.length>0&&(g.object_permission.agent_access_groups=j),delete t.agents_and_groups,t.vector_stores&&t.vector_stores.length>0&&(g.object_permission.vector_stores=t.vector_stores),void 0!==t.access_group_ids&&(g.access_group_ids=t.access_group_ids),void 0!==t.default_team_member_models&&(g.default_team_member_models=t.default_team_member_models);let f=ta.current?.getValue();if(f?.router_settings){let e=e=>null!=e&&""!==e&&!1!==e&&!(Array.isArray(e)&&0===e.length),t=Object.values(f.router_settings).some(e),l=tv.router_settings&&Object.values(tv.router_settings).some(e);(t||l)&&(g.router_settings=f.router_settings)}await (0,r.teamUpdateCall)(o,g),td.invalidateQueries({queryKey:a.organizationKeys.all}),ee.default.success("Team settings updated successfully"),eE(!1),t_()}catch(e){console.error("Error updating team:",e)}finally{tl(!1)}};if(eT)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!ef?.team_info)return(0,t.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:tv}=ef,tT=tv.metadata?.disable_global_guardrails===!0,tS=new Set(tv.metadata?.opted_out_global_guardrails||[]),tw=(tv.metadata?.guardrails||[]).filter(e=>!eY.has(e)),tN=tT?tw:[...Array.from(eY).filter(e=>!tS.has(e)),...tw],tC=e=>{e.preventDefault(),e.stopPropagation()},tk=async(e,t)=>{await (0,m.copyToClipboard)(e)&&(eH(e=>({...e,[t]:!0})),setTimeout(()=>{eH(e=>({...e,[t]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(I.Button,{type:"text",icon:(0,t.jsx)(y.ArrowLeftIcon,{className:"h-4 w-4"}),onClick:n,className:"mb-4",children:"Back to Teams"}),(0,t.jsx)(k.Title,{children:tv.team_alias}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(N.Text,{className:"text-gray-500 font-mono",children:tv.team_id}),(0,t.jsx)(I.Button,{type:"text",size:"small",icon:eq["team-id"]?(0,t.jsx)(V.CheckIcon,{size:12}):(0,t.jsx)(U.CopyIcon,{size:12}),onClick:()=>tk(tv.team_id,"team-id"),className:`left-2 z-10 transition-all duration-200 ${eq["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]})}),(0,t.jsx)(A.Tabs,{defaultActiveKey:tp,className:"mb-4",items:[{key:eI,label:eD[eI],children:(0,t.jsxs)(w.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{children:"Budget Status"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(k.Title,{children:["$",(0,m.formatNumberWithCommas)(tv.spend,4)]}),(0,t.jsxs)(N.Text,{children:["of ",null===tv.max_budget?"Unlimited":`$${(0,m.formatNumberWithCommas)(tv.max_budget,4)}`]}),tv.budget_duration&&(0,t.jsxs)(N.Text,{className:"text-gray-500",children:["Reset: ",tv.budget_duration]}),(0,t.jsx)("br",{}),tv.team_member_budget_table&&(0,t.jsxs)(N.Text,{className:"text-gray-500",children:["Team Member Budget: $",(0,m.formatNumberWithCommas)(tv.team_member_budget_table.max_budget,4)]})]})]}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(N.Text,{children:["TPM: ",tv.tpm_limit||"Unlimited"]}),(0,t.jsxs)(N.Text,{children:["RPM: ",tv.rpm_limit||"Unlimited"]}),tv.max_parallel_requests&&(0,t.jsxs)(N.Text,{children:["Max Parallel Requests: ",tv.max_parallel_requests]}),(eh=tv.metadata?.model_tpm_limit??{},ex=tv.metadata?.model_rpm_limit??{},0===(ep=Array.from(new Set([...Object.keys(eh),...Object.keys(ex)]))).length?null:(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)(N.Text,{className:"text-gray-500",children:"Per-model limits:"}),ep.map(e=>(0,t.jsxs)(N.Text,{className:"text-xs",children:[e,": TPM ",eh[e]??"—",", RPM ",ex[e]??"—"]},e))]}))]})]}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===tv.models.length||tv.models.includes("all-proxy-models")?(0,t.jsx)(T.Badge,{color:"red",children:"All proxy models"}):(0,t.jsxs)(t.Fragment,{children:[tv.models.map((e,l)=>(0,t.jsx)(T.Badge,{color:"blue",children:e},`direct-${l}`)),(tv.access_group_models||[]).map((e,l)=>(0,t.jsx)(T.Badge,{color:"green",title:"From access group",children:e},`ag-${l}`))]})})]}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(N.Text,{children:["User Keys: ",ef.keys.filter(e=>e.user_id).length]}),(0,t.jsxs)(N.Text,{children:["Service Account Keys: ",ef.keys.filter(e=>!e.user_id).length]}),(0,t.jsxs)(N.Text,{className:"text-gray-500",children:["Total: ",ef.keys.length]})]})]}),(0,t.jsx)(et.default,{objectPermission:tv.object_permission,variant:"card",accessToken:o}),(0,t.jsx)(S.Card,{children:(0,t.jsx)(J,{globalGuardrailNames:eY,teamGuardrails:tv.metadata?.guardrails||[],optedOutGlobalGuardrails:tv.metadata?.opted_out_global_guardrails||[],killSwitchOn:tT,variant:"inline"})}),(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(N.Text,{className:"font-semibold text-gray-900 mb-3",children:"Policies"}),tv.policies&&tv.policies.length>0?(0,t.jsx)("div",{className:"space-y-4",children:tv.policies.map((e,l)=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T.Badge,{color:"purple",children:e}),e2&&(0,t.jsx)(N.Text,{className:"text-xs text-gray-400",children:"Loading guardrails..."})]}),!e2&&e1[e]&&e1[e].length>0&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-gray-200",children:[(0,t.jsx)(N.Text,{className:"text-xs text-gray-500 mb-1",children:"Resolved Guardrails:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e1[e].map((e,l)=>(0,t.jsx)(T.Badge,{color:"blue",size:"xs",children:e},l))})]})]},l))}):(0,t.jsx)(N.Text,{className:"text-gray-500",children:"No policies configured"})]}),(0,t.jsx)(Q.default,{loggingConfigs:tv.metadata?.logging||[],disabledCallbacks:[],variant:"card"})]})},{key:eM,label:eD[eM],children:(0,t.jsx)(ek,{teamId:e})},{key:ez,label:eD[ez],children:(0,t.jsx)(eZ,{teamId:e,teamAlias:tv.team_alias,organization:ts})},{key:eF,label:eD[eF],children:(0,t.jsx)(eR,{teamData:ef,canEditTeam:th,handleMemberDelete:e=>{e6(e),e7(!0)},setSelectedEditMember:eV,setIsEditMemberModalVisible:eL,setIsAddMemberModalVisible:eN})},{key:eO,label:eD[eO],children:(0,t.jsx)(e_,{teamId:e,accessToken:o,canEditTeam:th})},{key:eP,label:eD[eP],children:(0,t.jsxs)(S.Card,{className:"overflow-y-auto max-h-[65vh]",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(k.Title,{children:"Team Settings"}),th&&!eU&&(0,t.jsx)(I.Button,{icon:(0,t.jsx)(g.EditOutlined,{className:"h-4 w-4"}),onClick:()=>eE(!0),children:"Edit Settings"})]}),eU&&eQ?(0,t.jsx)("div",{className:"p-4",children:"Loading..."}):eU?(0,t.jsxs)(M.Form,{form:eC,onFinish:tf,onValuesChange:e=>{if("disable_global_guardrails"in e){let t=!0===e.disable_global_guardrails,l=(eC.getFieldValue("guardrails")||[]).filter(e=>!eY.has(e));eC.setFieldValue("guardrails",t?l:[...Array.from(eY),...l])}},initialValues:{...tv,team_alias:tv.team_alias,models:tv.models,tpm_limit:tv.tpm_limit,rpm_limit:tv.rpm_limit,modelLimits:Array.from(new Set([...Object.keys(tv.metadata?.model_tpm_limit??{}),...Object.keys(tv.metadata?.model_rpm_limit??{})])).map(e=>({model:e,tpm:tv.metadata?.model_tpm_limit?.[e],rpm:tv.metadata?.model_rpm_limit?.[e]})),max_budget:tv.max_budget,soft_budget:tv.soft_budget,budget_duration:tv.budget_duration,team_member_tpm_limit:tv.team_member_budget_table?.tpm_limit,team_member_rpm_limit:tv.team_member_budget_table?.rpm_limit,team_member_budget:tv.team_member_budget_table?.max_budget,team_member_budget_duration:tv.team_member_budget_table?.budget_duration,guardrails:tN,policies:tv.policies||[],disable_global_guardrails:tv.metadata?.disable_global_guardrails||!1,soft_budget_alerting_emails:Array.isArray(tv.metadata?.soft_budget_alerting_emails)?tv.metadata.soft_budget_alerting_emails.join(", "):"",metadata:tv.metadata?JSON.stringify((({logging:e,secret_manager_settings:t,soft_budget_alerting_emails:l,model_tpm_limit:a,model_rpm_limit:s,...i})=>i)(tv.metadata),null,2):"",logging_settings:tv.metadata?.logging||[],secret_manager_settings:tv.metadata?.secret_manager_settings?JSON.stringify(tv.metadata.secret_manager_settings,null,2):"",organization_id:tv.organization_id,vector_stores:tv.object_permission?.vector_stores||[],mcp_servers:tv.object_permission?.mcp_servers||[],mcp_access_groups:tv.object_permission?.mcp_access_groups||[],mcp_servers_and_groups:{servers:tv.object_permission?.mcp_servers||[],accessGroups:tv.object_permission?.mcp_access_groups||[],toolsets:tv.object_permission?.mcp_toolsets||[]},mcp_tool_permissions:tv.object_permission?.mcp_tool_permissions||{},agents_and_groups:{agents:tv.object_permission?.agents||[],accessGroups:tv.object_permission?.agent_access_groups||[]},access_group_ids:tv.access_group_ids||[],default_team_member_models:tv.default_team_member_models||[]},layout:"vertical",children:[(0,t.jsx)(M.Form.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,t.jsx)(z.Input,{type:""})}),(0,t.jsx)(M.Form.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,t.jsx)(Z.ModelSelect,{value:eC.getFieldValue("models")||[],onChange:e=>eC.setFieldValue("models",e),teamID:e,organizationID:ef?.team_info?.organization_id||void 0,options:{includeSpecialOptions:!0,includeUserModels:!ef?.team_info?.organization_id,showAllProxyModelsOverride:(0,u.isProxyAdminRole)(tr)&&!ef?.team_info?.organization_id},context:"team",dataTestId:"models-select"})}),(0,t.jsx)(M.Form.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(el.default,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Soft Budget (USD)",name:"soft_budget",children:(0,t.jsx)(el.default,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Soft Budget Alerting Emails",name:"soft_budget_alerting_emails",tooltip:"Comma-separated email addresses to receive alerts when the soft budget is reached",children:(0,t.jsx)(z.Input,{placeholder:"example1@test.com, example2@test.com"})}),(0,t.jsxs)(j.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(v.AccordionHeader,{children:(0,t.jsx)("b",{children:"Team Member Settings"})}),(0,t.jsxs)(f.AccordionBody,{children:[(0,t.jsx)(N.Text,{className:"text-xs text-gray-500 mb-4",children:"Optional defaults applied when members join this team. All fields can be overridden per member."}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Default Model Access"," ",(0,t.jsx)(R.Tooltip,{title:"Optional. If set, new members can only access these models by default. Must be a subset of the team's models above. Leave empty to give all members access to all team models.",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"default_team_member_models",children:(0,t.jsx)(M.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.models!==t.models,children:({getFieldValue:e})=>{let l=e("models")||tv.models||[];return(0,t.jsx)(O.Select,{mode:"multiple",placeholder:"Leave empty — all team models accessible to every member",value:eC.getFieldValue("default_team_member_models")||[],onChange:e=>eC.setFieldValue("default_team_member_models",e),options:l.map(e=>({label:e,value:e}))})}})}),(0,t.jsx)(M.Form.Item,{label:"Default Budget (USD)",name:"team_member_budget",tooltip:"Default spend budget for each member in this team.",children:(0,t.jsx)(el.default,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Default Budget Duration",name:"team_member_budget_duration",children:(0,t.jsx)(W,{onChange:e=>eC.setFieldValue("team_member_budget_duration",e),value:eC.getFieldValue("team_member_budget_duration")})}),(0,t.jsx)(M.Form.Item,{label:"Default Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,t.jsx)(C.TextInput,{placeholder:"e.g., 30d"})}),(0,t.jsx)(M.Form.Item,{label:"Default TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for each member. Can be overridden per member.",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,t.jsx)(M.Form.Item,{label:"Default RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for each member. Can be overridden per member.",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})})]})]}),(0,t.jsx)(M.Form.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(O.Select,{placeholder:"n/a",children:[(0,t.jsx)(O.Select.Option,{value:"24h",children:"daily"}),(0,t.jsx)(O.Select.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(O.Select.Option,{value:"30d",children:"monthly"})]})}),(0,t.jsx)(M.Form.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,t.jsx)(el.default,{step:1,style:{width:"100%"}})}),(0,t.jsx)(M.Form.Item,{label:"Model-Specific Rate Limits",tooltip:"Set per-model TPM/RPM limits that apply across the whole team.",children:(0,t.jsx)(M.Form.List,{name:"modelLimits",children:(e,{add:l,remove:a})=>(0,t.jsxs)(t.Fragment,{children:[e.map(({key:e,name:l,...s})=>(0,t.jsxs)(P.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,t.jsx)(M.Form.Item,{...s,name:[l,"model"],rules:[{required:!0,message:"Missing model"},{validator:(e,t)=>t&&(eC.getFieldValue("modelLimits")??[]).filter(e=>e?.model===t).length>1?Promise.reject(Error("Duplicate model")):Promise.resolve()}],style:{minWidth:240},children:(0,t.jsx)(O.Select,{showSearch:!0,placeholder:"Select model",allowClear:!0,options:tg.map(e=>({value:e,label:e}))})}),(0,t.jsx)(M.Form.Item,{...s,name:[l,"tpm"],rules:[{validator:async(e,t)=>{let a=(eC.getFieldValue("modelLimits")??[])[l]??{};return a.model&&null==t&&null==a.rpm?Promise.reject(Error("Set at least one of TPM or RPM")):Promise.resolve()}}],children:(0,t.jsx)(F.InputNumber,{placeholder:"TPM Limit",min:0})}),(0,t.jsx)(M.Form.Item,{...s,name:[l,"rpm"],children:(0,t.jsx)(F.InputNumber,{placeholder:"RPM Limit",min:0})}),(0,t.jsx)(p.MinusCircleOutlined,{onClick:()=>a(l),style:{color:"#ef4444"}})]},e)),(0,t.jsx)(M.Form.Item,{children:(0,t.jsx)(I.Button,{type:"dashed",onClick:()=>l(),block:!0,icon:(0,t.jsx)(_.PlusOutlined,{}),children:"Add Model Limit"})})]})})}),(0,t.jsx)(M.Form.Item,{label:"Router Settings",children:(0,t.jsx)(ei.default,{ref:ta,accessToken:o||"",value:tv.router_settings?{router_settings:tv.router_settings}:void 0})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(R.Tooltip,{title:"Select which guardrails apply to this team. Global guardrails are enabled by default — uncheck to opt out. Other guardrails are opt-in.",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",children:(0,t.jsxs)(O.Select,{mode:"multiple",placeholder:"Select guardrails",optionLabelProp:"label",tagRender:({label:e,value:l,closable:a,onClose:s})=>{let i=eY.has(l);return(0,t.jsxs)(L.Tag,{color:"blue",closable:a,onClose:s,onMouseDown:tC,style:{marginInlineEnd:4},children:[i&&(0,t.jsx)(h.GlobalOutlined,{style:{marginInlineEnd:4},"aria-label":"Global guardrail"}),e]})},children:[(0,t.jsx)(O.Select.OptGroup,{label:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.GlobalOutlined,{style:{marginInlineEnd:4}}),"Global"]}),children:(eJ?.guardrails??[]).filter(e=>e.litellm_params?.default_on).map(e=>(0,t.jsx)(O.Select.Option,{value:e.guardrail_name,label:e.guardrail_name,disabled:tu,children:e.guardrail_name},e.guardrail_name))}),(0,t.jsx)(O.Select.OptGroup,{label:"Other",children:(eJ?.guardrails??[]).filter(e=>!e.litellm_params?.default_on).map(e=>(0,t.jsx)(O.Select.Option,{value:e.guardrail_name,label:e.guardrail_name,children:e.guardrail_name},e.guardrail_name))})]})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Disable all global guardrails"," ",(0,t.jsx)(R.Tooltip,{title:"Kill switch: bypass every global guardrail for this team, including any added in the future. For per-guardrail opt-out instead, use the Guardrails dropdown above.",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",children:(0,t.jsx)(D.Switch,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Policies"," ",(0,t.jsx)(R.Tooltip,{title:"Apply policies to this team to control guardrails and other settings",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",children:(0,t.jsx)(O.Select,{mode:"tags",placeholder:"Select or enter policies",options:eX.map(e=>({value:e,label:e}))})}),(0,t.jsx)(M.Form.Item,{label:(0,t.jsxs)("span",{children:["Access Groups"," ",(0,t.jsx)(R.Tooltip,{title:"Assign access groups to this team. Access groups control which models, MCP servers, and agents this team can use",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",children:(0,t.jsx)($.default,{placeholder:"Select access groups (optional)"})}),(0,t.jsx)(M.Form.Item,{label:"Vector Stores",name:"vector_stores","aria-label":"Vector Stores",children:(0,t.jsx)(ea.default,{onChange:e=>eC.setFieldValue("vector_stores",e),value:eC.getFieldValue("vector_stores"),accessToken:o||"",placeholder:"Select vector stores"})}),(0,t.jsx)(M.Form.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(q.default,{onChange:e=>eC.setFieldValue("allowed_passthrough_routes",e),value:eC.getFieldValue("allowed_passthrough_routes"),accessToken:o||"",placeholder:"Select pass through routes"})}),(0,t.jsx)(M.Form.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(Y.default,{onChange:e=>eC.setFieldValue("mcp_servers_and_groups",e),value:eC.getFieldValue("mcp_servers_and_groups"),accessToken:o||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(M.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(z.Input,{type:"hidden"})}),(0,t.jsx)(M.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.mcp_servers_and_groups!==t.mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(X.default,{accessToken:o||"",selectedServers:eC.getFieldValue("mcp_servers_and_groups")?.servers||[],toolPermissions:eC.getFieldValue("mcp_tool_permissions")||{},onChange:e=>eC.setFieldsValue({mcp_tool_permissions:e})})})}),(0,t.jsx)(M.Form.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(K.default,{onChange:e=>eC.setFieldValue("agents_and_groups",e),value:eC.getFieldValue("agents_and_groups"),accessToken:o||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsx)(M.Form.Item,{label:"Organization",name:"organization_id",children:(0,t.jsx)(O.Select,{allowClear:!0,placeholder:"Select an organization",showSearch:!0,optionFilterProp:"label",options:to.map(e=>({value:e.organization_id,label:e.organization_alias||e.organization_id}))})}),(0,t.jsx)(M.Form.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(es.default,{value:eC.getFieldValue("logging_settings"),onChange:e=>eC.setFieldValue("logging_settings",e)})}),(0,t.jsx)(M.Form.Item,{label:"Secret Manager Settings",name:"secret_manager_settings",help:eu?"Enter secret manager configuration as a JSON object.":"Premium feature - Upgrade to manage secret manager settings.",rules:[{validator:async(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,t.jsx)(z.Input.TextArea,{rows:6,placeholder:'{"namespace": "admin", "mount": "secret", "path_prefix": "litellm"}',disabled:!eu})}),(0,t.jsx)(M.Form.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(z.Input.TextArea,{rows:10})}),(0,t.jsx)("div",{className:"sticky z-10 bg-white p-4 pr-0 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,t.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,t.jsx)(I.Button,{onClick:()=>eE(!1),disabled:tt,children:"Cancel"}),(0,t.jsx)(I.Button,{icon:(0,t.jsx)(b.SaveOutlined,{className:"h-4 w-4"}),type:"primary",htmlType:"submit",loading:tt,children:"Save Changes"})]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Team Name"}),(0,t.jsx)("div",{children:tv.team_alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Team ID"}),(0,t.jsx)("div",{className:"font-mono",children:tv.team_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:new Date(tv.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:tv.models.map((e,l)=>(0,t.jsx)(T.Badge,{color:"red",children:e},l))})]}),tv.default_team_member_models&&tv.default_team_member_models.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Default Member Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:tv.default_team_member_models.map((e,l)=>(0,t.jsx)(T.Badge,{color:"blue",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)("div",{children:["TPM: ",tv.tpm_limit||"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",tv.rpm_limit||"Unlimited"]}),(eb=tv.metadata?.model_tpm_limit??{},ey=tv.metadata?.model_rpm_limit??{},0===(ej=Array.from(new Set([...Object.keys(eb),...Object.keys(ey)]))).length?null:(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(N.Text,{className:"text-gray-500",children:"Per-model limits:"}),ej.map(e=>(0,t.jsxs)("div",{className:"text-xs ml-2",children:[e,": TPM ",eb[e]??"—",", RPM ",ey[e]??"—"]},e))]}))]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Team Budget"}),(0,t.jsxs)("div",{children:["Max Budget:"," ",null!==tv.max_budget?`$${(0,m.formatNumberWithCommas)(tv.max_budget,4)}`:"No Limit"]}),(0,t.jsxs)("div",{children:["Soft Budget:"," ",null!==tv.soft_budget&&void 0!==tv.soft_budget?`$${(0,m.formatNumberWithCommas)(tv.soft_budget,4)}`:"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Reset: ",tv.budget_duration||"Never"]}),tv.metadata?.soft_budget_alerting_emails&&Array.isArray(tv.metadata.soft_budget_alerting_emails)&&tv.metadata.soft_budget_alerting_emails.length>0&&(0,t.jsxs)("div",{children:["Soft Budget Alerting Emails: ",tv.metadata.soft_budget_alerting_emails.join(", ")]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(N.Text,{className:"font-medium",children:["Team Member Settings"," ",(0,t.jsx)(R.Tooltip,{title:"These are limits on individual team members",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),(0,t.jsxs)("div",{children:["Max Budget: ",tv.team_member_budget_table?.max_budget||"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Duration: ",tv.team_member_budget_table?.budget_duration||"No Limit"]}),(0,t.jsxs)("div",{children:["Key Duration: ",tv.metadata?.team_member_key_duration||"No Limit"]}),(0,t.jsxs)("div",{children:["TPM Limit: ",tv.team_member_budget_table?.tpm_limit||"No Limit"]}),(0,t.jsxs)("div",{children:["RPM Limit: ",tv.team_member_budget_table?.rpm_limit||"No Limit"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Router Settings"}),tv.router_settings&&Object.values(tv.router_settings).some(e=>null!=e&&""!==e&&!(Array.isArray(e)&&0===e.length))?(0,t.jsxs)("div",{className:"mt-1 space-y-1",children:[tv.router_settings.routing_strategy&&(0,t.jsxs)("div",{children:["Routing Strategy:"," ",(0,t.jsx)(T.Badge,{color:"blue",children:tv.router_settings.routing_strategy})]}),null!=tv.router_settings.num_retries&&(0,t.jsxs)("div",{children:["Number of Retries: ",tv.router_settings.num_retries]}),null!=tv.router_settings.allowed_fails&&(0,t.jsxs)("div",{children:["Allowed Failures: ",tv.router_settings.allowed_fails]}),null!=tv.router_settings.cooldown_time&&(0,t.jsxs)("div",{children:["Cooldown Time: ",tv.router_settings.cooldown_time,"s"]}),null!=tv.router_settings.timeout&&(0,t.jsxs)("div",{children:["Timeout: ",tv.router_settings.timeout,"s"]}),null!=tv.router_settings.retry_after&&(0,t.jsxs)("div",{children:["Retry After: ",tv.router_settings.retry_after,"s"]}),tv.router_settings.fallbacks&&Array.isArray(tv.router_settings.fallbacks)&&tv.router_settings.fallbacks.length>0&&(0,t.jsxs)("div",{children:["Fallbacks: ",tv.router_settings.fallbacks.length," configured"]}),tv.router_settings.enable_tag_filtering&&(0,t.jsx)("div",{children:"Tag Filtering: Enabled"})]}):(0,t.jsx)("div",{className:"text-gray-400",children:"No router settings configured"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Organization ID"}),(0,t.jsx)("div",{children:tv.organization_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Status"}),(0,t.jsx)(T.Badge,{color:tv.blocked?"red":"green",children:tv.blocked?"Blocked":"Active"})]}),(0,t.jsx)(et.default,{objectPermission:tv.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o}),(0,t.jsx)(J,{globalGuardrailNames:eY,teamGuardrails:tv.metadata?.guardrails||[],optedOutGlobalGuardrails:tv.metadata?.opted_out_global_guardrails||[],killSwitchOn:tT,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,t.jsx)(Q.default,{loggingConfigs:tv.metadata?.logging||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"}),tv.metadata?.secret_manager_settings&&(0,t.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,t.jsx)(N.Text,{className:"font-medium",children:"Secret Manager Settings"}),(0,t.jsx)("pre",{className:"mt-2 bg-gray-50 p-3 rounded text-xs overflow-x-auto",children:JSON.stringify(tv.metadata.secret_manager_settings,null,2)})]})]})]})}].filter(e=>tx.includes(e.key))}),(0,t.jsx)(er.default,{visible:eA,onCancel:()=>eL(!1),onSubmit:ty,initialData:eB,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}],additionalFields:[{name:"max_budget_in_team",label:(0,t.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,t.jsx)(R.Tooltip,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:.01,min:0,placeholder:"Budget limit for this member within this team"},{name:"tpm_limit",label:(0,t.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,t.jsx)(R.Tooltip,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Tokens per minute limit for this member in this team"},{name:"rpm_limit",label:(0,t.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,t.jsx)(R.Tooltip,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"},{name:"allowed_models",label:(0,t.jsxs)("span",{children:["Allowed Models"," ",(0,t.jsx)(R.Tooltip,{title:"Models this member can access within this team. Leave empty to inherit all team models.",children:(0,t.jsx)(x.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),type:"multi-select",options:(tv.models||[]).map(e=>({label:e,value:e})),placeholder:"Leave empty to inherit all team models"}]}}),(0,t.jsx)(i.default,{isVisible:ew,onCancel:()=>eN(!1),onSubmit:tb,accessToken:o,teamId:e}),(0,t.jsx)(G.default,{isOpen:e8,title:"Delete Team Member",alertMessage:"Removing team members will also delete any keys created by or created for this member.",message:"Are you sure you want to remove this member from the team? This action cannot be undone.",resourceInformationTitle:"Team Member Information",resourceInformation:[{label:"User ID",value:e3?.user_id,code:!0},{label:"Email",value:e3?.user_email},{label:"Role",value:e3?.role}],onCancel:()=>{e7(!1),e6(null)},onOk:tj,confirmLoading:e9})]})}],56567)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1d37f4159623f97f.js b/litellm/proxy/_experimental/out/_next/static/chunks/1d37f4159623f97f.js
deleted file mode 100644
index caec0dc207..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/1d37f4159623f97f.js
+++ /dev/null
@@ -1,8 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,434626,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.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"}))});e.s(["ExternalLinkIcon",0,r],434626)},551332,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}))});e.s(["ClipboardCopyIcon",0,r],551332)},902555,e=>{"use strict";var t=e.i(843476),r=e.i(591935),a=e.i(122577),o=e.i(278587),l=e.i(68155),n=e.i(360820),i=e.i(871943),s=e.i(434626),d=e.i(551332),c=e.i(592968),m=e.i(115504),g=e.i(752978);function u({icon:e,onClick:r,className:a,disabled:o,dataTestId:l}){return o?(0,t.jsx)(g.Icon,{icon:e,size:"sm",className:"opacity-50 cursor-not-allowed","data-testid":l}):(0,t.jsx)(g.Icon,{icon:e,size:"sm",onClick:r,className:(0,m.cx)("cursor-pointer",a),"data-testid":l})}let b={Edit:{icon:r.PencilAltIcon,className:"hover:text-blue-600"},Delete:{icon:l.TrashIcon,className:"hover:text-red-600"},Test:{icon:a.PlayIcon,className:"hover:text-blue-600"},Regenerate:{icon:o.RefreshIcon,className:"hover:text-green-600"},Up:{icon:n.ChevronUpIcon,className:"hover:text-blue-600"},Down:{icon:i.ChevronDownIcon,className:"hover:text-blue-600"},Open:{icon:s.ExternalLinkIcon,className:"hover:text-green-600"},Copy:{icon:d.ClipboardCopyIcon,className:"hover:text-blue-600"}};function h({onClick:e,tooltipText:r,disabled:a=!1,disabledTooltipText:o,dataTestId:l,variant:n}){let{icon:i,className:s}=b[n];return(0,t.jsx)(c.Tooltip,{title:a?o:r,children:(0,t.jsx)("span",{children:(0,t.jsx)(u,{icon:i,onClick:e,className:s,disabled:a,dataTestId:l})})})}e.s(["default",()=>h],902555)},122577,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["PlayIcon",0,r],122577)},728889,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(829087),o=e.i(480731),l=e.i(444755),n=e.i(673706),i=e.i(95779);let s={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"}},c={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:""}},m=(0,n.makeClassName)("Icon"),g=r.default.forwardRef((e,g)=>{let{icon:u,variant:b="simple",tooltip:h,size:f=o.Sizes.SM,color:p,className:C}=e,k=(0,t.__rest)(e,["icon","variant","tooltip","size","color","className"]),x=((e,t)=>{switch(e){case"simple":return{textColor:t?(0,n.getColorClassNames)(t,i.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,n.getColorClassNames)(t,i.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,n.getColorClassNames)(t,i.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,n.getColorClassNames)(t,i.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,n.getColorClassNames)(t,i.colorPalette.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,n.getColorClassNames)(t,i.colorPalette.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.tremorTwMerge)((0,n.getColorClassNames)(t,i.colorPalette.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,n.getColorClassNames)(t,i.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.tremorTwMerge)((0,n.getColorClassNames)(t,i.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,n.getColorClassNames)(t,i.colorPalette.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.tremorTwMerge)((0,n.getColorClassNames)(t,i.colorPalette.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}})(b,p),{tooltipProps:w,getReferenceProps:v}=(0,a.useTooltip)();return r.default.createElement("span",Object.assign({ref:(0,n.mergeRefs)([g,w.refs.setReference]),className:(0,l.tremorTwMerge)(m("root"),"inline-flex shrink-0 items-center justify-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,c[b].rounded,c[b].border,c[b].shadow,c[b].ring,s[f].paddingX,s[f].paddingY,C)},v,k),r.default.createElement(a.default,Object.assign({text:h},w)),r.default.createElement(u,{className:(0,l.tremorTwMerge)(m("icon"),"shrink-0",d[f].height,d[f].width)}))});g.displayName="Icon",e.s(["default",()=>g],728889)},752978,e=>{"use strict";var t=e.i(728889);e.s(["Icon",()=>t.default])},591935,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});e.s(["PencilAltIcon",0,r],591935)},959013,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let 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"};var o=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(o.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["default",0,l],959013)},185793,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),a=e.i(242064),o=e.i(529681);let l=e=>{let{prefixCls:a,className:o,style:l,size:n,shape:i}=e,s=(0,r.default)({[`${a}-lg`]:"large"===n,[`${a}-sm`]:"small"===n}),d=(0,r.default)({[`${a}-circle`]:"circle"===i,[`${a}-square`]:"square"===i,[`${a}-round`]:"round"===i}),c=t.useMemo(()=>"number"==typeof n?{width:n,height:n,lineHeight:`${n}px`}:{},[n]);return t.createElement("span",{className:(0,r.default)(a,s,d,o),style:Object.assign(Object.assign({},c),l)})};e.i(296059);var n=e.i(694758),i=e.i(915654),s=e.i(246422),d=e.i(838378);let c=new n.Keyframes("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),m=e=>({height:e,lineHeight:(0,i.unit)(e)}),g=e=>Object.assign({width:e},m(e)),u=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},m(e)),b=e=>Object.assign({width:e},m(e)),h=(e,t,r)=>{let{skeletonButtonCls:a}=e;return{[`${r}${a}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${r}${a}-round`]:{borderRadius:t}}},f=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},m(e)),p=(0,s.genStyleHooks)("Skeleton",e=>{let{componentCls:t,calc:r}=e;return(e=>{let{componentCls:t,skeletonAvatarCls:r,skeletonTitleCls:a,skeletonParagraphCls:o,skeletonButtonCls:l,skeletonInputCls:n,skeletonImageCls:i,controlHeight:s,controlHeightLG:d,controlHeightSM:m,gradientFromColor:p,padding:C,marginSM:k,borderRadius:x,titleHeight:w,blockRadius:v,paragraphLiHeight:N,controlHeightXS:$,paragraphMarginTop:j}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:C,verticalAlign:"top",[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:p},g(s)),[`${r}-circle`]:{borderRadius:"50%"},[`${r}-lg`]:Object.assign({},g(d)),[`${r}-sm`]:Object.assign({},g(m))},[`${t}-content`]:{display:"table-cell",width:"100%",verticalAlign:"top",[a]:{width:"100%",height:w,background:p,borderRadius:v,[`+ ${o}`]:{marginBlockStart:m}},[o]:{padding:0,"> li":{width:"100%",height:N,listStyle:"none",background:p,borderRadius:v,"+ li":{marginBlockStart:$}}},[`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-content`]:{[`${a}, ${o} > li`]:{borderRadius:x}}},[`${t}-with-avatar ${t}-content`]:{[a]:{marginBlockStart:k,[`+ ${o}`]:{marginBlockStart:j}}},[`${t}${t}-element`]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},(e=>{let{borderRadiusSM:t,skeletonButtonCls:r,controlHeight:a,controlHeightLG:o,controlHeightSM:l,gradientFromColor:n,calc:i}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[r]:Object.assign({display:"inline-block",verticalAlign:"top",background:n,borderRadius:t,width:i(a).mul(2).equal(),minWidth:i(a).mul(2).equal()},f(a,i))},h(e,a,r)),{[`${r}-lg`]:Object.assign({},f(o,i))}),h(e,o,`${r}-lg`)),{[`${r}-sm`]:Object.assign({},f(l,i))}),h(e,l,`${r}-sm`))})(e)),(e=>{let{skeletonAvatarCls:t,gradientFromColor:r,controlHeight:a,controlHeightLG:o,controlHeightSM:l}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:r},g(a)),[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:Object.assign({},g(o)),[`${t}${t}-sm`]:Object.assign({},g(l))}})(e)),(e=>{let{controlHeight:t,borderRadiusSM:r,skeletonInputCls:a,controlHeightLG:o,controlHeightSM:l,gradientFromColor:n,calc:i}=e;return{[a]:Object.assign({display:"inline-block",verticalAlign:"top",background:n,borderRadius:r},u(t,i)),[`${a}-lg`]:Object.assign({},u(o,i)),[`${a}-sm`]:Object.assign({},u(l,i))}})(e)),(e=>{let{skeletonImageCls:t,imageSizeBase:r,gradientFromColor:a,borderRadiusSM:o,calc:l}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:a,borderRadius:o},b(l(r).mul(2).equal())),{[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:Object.assign(Object.assign({},b(r)),{maxWidth:l(r).mul(4).equal(),maxHeight:l(r).mul(4).equal()}),[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}}),[`${t}${t}-circle`]:{borderRadius:"50%"}}})(e)),[`${t}${t}-block`]:{width:"100%",[l]:{width:"100%"},[n]:{width:"100%"}},[`${t}${t}-active`]:{[`
- ${a},
- ${o} > li,
- ${r},
- ${l},
- ${n},
- ${i}
- `]:Object.assign({},{background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:c,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"})}}})((0,d.mergeToken)(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:r(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"}))},e=>{let{colorFillContent:t,colorFill:r}=e;return{color:t,colorGradientEnd:r,gradientFromColor:t,gradientToColor:r,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),C=e=>{let{prefixCls:a,className:o,style:l,rows:n=0}=e,i=Array.from({length:n}).map((r,a)=>t.createElement("li",{key:a,style:{width:((e,t)=>{let{width:r,rows:a=2}=t;return Array.isArray(r)?r[e]:a-1===e?r:void 0})(a,e)}}));return t.createElement("ul",{className:(0,r.default)(a,o),style:l},i)},k=({prefixCls:e,className:a,width:o,style:l})=>t.createElement("h3",{className:(0,r.default)(e,a),style:Object.assign({width:o},l)});function x(e){return e&&"object"==typeof e?e:{}}let w=e=>{let{prefixCls:o,loading:n,className:i,rootClassName:s,style:d,children:c,avatar:m=!1,title:g=!0,paragraph:u=!0,active:b,round:h}=e,{getPrefixCls:f,direction:w,className:v,style:N}=(0,a.useComponentConfig)("skeleton"),$=f("skeleton",o),[j,y,E]=p($);if(n||!("loading"in e)){let e,a,o=!!m,n=!!g,c=!!u;if(o){let r=Object.assign(Object.assign({prefixCls:`${$}-avatar`},n&&!c?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),x(m));e=t.createElement("div",{className:`${$}-header`},t.createElement(l,Object.assign({},r)))}if(n||c){let e,r;if(n){let r=Object.assign(Object.assign({prefixCls:`${$}-title`},!o&&c?{width:"38%"}:o&&c?{width:"50%"}:{}),x(g));e=t.createElement(k,Object.assign({},r))}if(c){let e,a=Object.assign(Object.assign({prefixCls:`${$}-paragraph`},(e={},o&&n||(e.width="61%"),!o&&n?e.rows=3:e.rows=2,e)),x(u));r=t.createElement(C,Object.assign({},a))}a=t.createElement("div",{className:`${$}-content`},e,r)}let f=(0,r.default)($,{[`${$}-with-avatar`]:o,[`${$}-active`]:b,[`${$}-rtl`]:"rtl"===w,[`${$}-round`]:h},v,i,s,y,E);return j(t.createElement("div",{className:f,style:Object.assign(Object.assign({},N),d)},e,a))}return null!=c?c:null};w.Button=e=>{let{prefixCls:n,className:i,rootClassName:s,active:d,block:c=!1,size:m="default"}=e,{getPrefixCls:g}=t.useContext(a.ConfigContext),u=g("skeleton",n),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d,[`${u}-block`]:c},i,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-button`,size:m},C))))},w.Avatar=e=>{let{prefixCls:n,className:i,rootClassName:s,active:d,shape:c="circle",size:m="default"}=e,{getPrefixCls:g}=t.useContext(a.ConfigContext),u=g("skeleton",n),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls","className"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d},i,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-avatar`,shape:c,size:m},C))))},w.Input=e=>{let{prefixCls:n,className:i,rootClassName:s,active:d,block:c,size:m="default"}=e,{getPrefixCls:g}=t.useContext(a.ConfigContext),u=g("skeleton",n),[b,h,f]=p(u),C=(0,o.default)(e,["prefixCls"]),k=(0,r.default)(u,`${u}-element`,{[`${u}-active`]:d,[`${u}-block`]:c},i,s,h,f);return b(t.createElement("div",{className:k},t.createElement(l,Object.assign({prefixCls:`${u}-input`,size:m},C))))},w.Image=e=>{let{prefixCls:o,className:l,rootClassName:n,style:i,active:s}=e,{getPrefixCls:d}=t.useContext(a.ConfigContext),c=d("skeleton",o),[m,g,u]=p(c),b=(0,r.default)(c,`${c}-element`,{[`${c}-active`]:s},l,n,g,u);return m(t.createElement("div",{className:b},t.createElement("div",{className:(0,r.default)(`${c}-image`,l),style:i},t.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${c}-image-svg`},t.createElement("title",null,"Image placeholder"),t.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:`${c}-image-path`})))))},w.Node=e=>{let{prefixCls:o,className:l,rootClassName:n,style:i,active:s,children:d}=e,{getPrefixCls:c}=t.useContext(a.ConfigContext),m=c("skeleton",o),[g,u,b]=p(m),h=(0,r.default)(m,`${m}-element`,{[`${m}-active`]:s},u,l,n,b);return g(t.createElement("div",{className:h},t.createElement("div",{className:(0,r.default)(`${m}-image`,l),style:i},d)))},e.s(["default",0,w],185793)},994388,e=>{"use strict";var t=e.i(290571),r=e.i(829087),a=e.i(271645);let o=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],l=e=>({_s:e,status:o[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),n=e=>e?6:5,i=(e,t,r,a,o)=>{clearTimeout(a.current);let n=l(e);t(n),r.current=n,o&&o({current:n})};var s=e.i(480731),d=e.i(444755),c=e.i(673706);let m=e=>{var r=(0,t.__rest)(e,[]);return a.default.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),a.default.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),a.default.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var g=e.i(95779);let u={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},b=(e,t)=>{switch(e){case"primary":return{textColor:t?(0,c.getColorClassNames)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:t?(0,c.getColorClassNames)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,c.getColorClassNames)(t,g.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:t?(0,c.getColorClassNames)(t,g.colorPalette.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:t?(0,c.getColorClassNames)(t,g.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:t?(0,c.getColorClassNames)(t,g.colorPalette.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:t?(0,c.getColorClassNames)(t,g.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,c.getColorClassNames)(t,g.colorPalette.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,c.getColorClassNames)("transparent").bgColor,hoverBgColor:t?(0,d.tremorTwMerge)((0,c.getColorClassNames)(t,g.colorPalette.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:t?(0,c.getColorClassNames)(t,g.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:t?(0,c.getColorClassNames)(t,g.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:t?(0,c.getColorClassNames)(t,g.colorPalette.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,c.getColorClassNames)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},h=(0,c.makeClassName)("Button"),f=({loading:e,iconSize:t,iconPosition:r,Icon:o,needMargin:l,transitionStatus:n})=>{let i=l?r===s.HorizontalPositions.Left?(0,d.tremorTwMerge)("-ml-1","mr-1.5"):(0,d.tremorTwMerge)("-mr-1","ml-1.5"):"",c=(0,d.tremorTwMerge)("w-0 h-0"),g={default:c,entering:c,entered:t,exiting:t,exited:c};return e?a.default.createElement(m,{className:(0,d.tremorTwMerge)(h("icon"),"animate-spin shrink-0",i,g.default,g[n]),style:{transition:"width 150ms"}}):a.default.createElement(o,{className:(0,d.tremorTwMerge)(h("icon"),"shrink-0",t,i)})},p=a.default.forwardRef((e,o)=>{let{icon:m,iconPosition:g=s.HorizontalPositions.Left,size:p=s.Sizes.SM,color:C,variant:k="primary",disabled:x,loading:w=!1,loadingText:v,children:N,tooltip:$,className:j}=e,y=(0,t.__rest)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),E=w||x,T=void 0!==m||w,O=w&&v,M=!(!N&&!O),R=(0,d.tremorTwMerge)(u[p].height,u[p].width),z="light"!==k?(0,d.tremorTwMerge)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",P=b(k,C),B=("light"!==k?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}})[p],{tooltipProps:S,getReferenceProps:I}=(0,r.useTooltip)(300),[L,q]=(({enter:e=!0,exit:t=!0,preEnter:r,preExit:o,timeout:s,initialEntered:d,mountOnEnter:c,unmountOnExit:m,onStateChange:g}={})=>{let[u,b]=(0,a.useState)(()=>l(d?2:n(c))),h=(0,a.useRef)(u),f=(0,a.useRef)(0),[p,C]="object"==typeof s?[s.enter,s.exit]:[s,s],k=(0,a.useCallback)(()=>{let e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return n(t)}})(h.current._s,m);e&&i(e,b,h,f,g)},[g,m]);return[u,(0,a.useCallback)(a=>{let l=e=>{switch(i(e,b,h,f,g),e){case 1:p>=0&&(f.current=((...e)=>setTimeout(...e))(k,p));break;case 4:C>=0&&(f.current=((...e)=>setTimeout(...e))(k,C));break;case 0:case 3:f.current=((...e)=>setTimeout(...e))(()=>{isNaN(document.body.offsetTop)||l(e+1)},0)}},s=h.current.isEnter;"boolean"!=typeof a&&(a=!s),a?s||l(e?+!r:2):s&&l(t?o?3:4:n(m))},[k,g,e,t,r,o,p,C,m]),k]})({timeout:50});return(0,a.useEffect)(()=>{q(w)},[w]),a.default.createElement("button",Object.assign({ref:(0,c.mergeRefs)([o,S.refs.setReference]),className:(0,d.tremorTwMerge)(h("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",z,B.paddingX,B.paddingY,B.fontSize,P.textColor,P.bgColor,P.borderColor,P.hoverBorderColor,E?"opacity-50 cursor-not-allowed":(0,d.tremorTwMerge)(b(k,C).hoverTextColor,b(k,C).hoverBgColor,b(k,C).hoverBorderColor),j),disabled:E},I,y),a.default.createElement(r.default,Object.assign({text:$},S)),T&&g!==s.HorizontalPositions.Right?a.default.createElement(f,{loading:w,iconSize:R,iconPosition:g,Icon:m,transitionStatus:L.status,needMargin:M}):null,O||N?a.default.createElement("span",{className:(0,d.tremorTwMerge)(h("text"),"text-tremor-default whitespace-nowrap")},O?v:N):null,T&&g===s.HorizontalPositions.Right?a.default.createElement(f,{loading:w,iconSize:R,iconPosition:g,Icon:m,transitionStatus:L.status,needMargin:M}):null)});p.displayName="Button",e.s(["Button",()=>p],994388)},269200,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("Table"),l=r.default.forwardRef((e,l)=>{let{children:n,className:i}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement("div",{className:(0,a.tremorTwMerge)(o("root"),"overflow-auto",i)},r.default.createElement("table",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},s),n))});l.displayName="Table",e.s(["Table",()=>l],269200)},942232,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableBody"),l=r.default.forwardRef((e,l)=>{let{children:n,className:i}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("tbody",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",i)},s),n))});l.displayName="TableBody",e.s(["TableBody",()=>l],942232)},977572,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableCell"),l=r.default.forwardRef((e,l)=>{let{children:n,className:i}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("td",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"align-middle whitespace-nowrap text-left p-4",i)},s),n))});l.displayName="TableCell",e.s(["TableCell",()=>l],977572)},427612,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableHead"),l=r.default.forwardRef((e,l)=>{let{children:n,className:i}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("thead",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",i)},s),n))});l.displayName="TableHead",e.s(["TableHead",()=>l],427612)},64848,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableHeaderCell"),l=r.default.forwardRef((e,l)=>{let{children:n,className:i}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("th",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",i)},s),n))});l.displayName="TableHeaderCell",e.s(["TableHeaderCell",()=>l],64848)},496020,e=>{"use strict";var t=e.i(290571),r=e.i(271645),a=e.i(444755);let o=(0,e.i(673706).makeClassName)("TableRow"),l=r.default.forwardRef((e,l)=>{let{children:n,className:i}=e,s=(0,t.__rest)(e,["children","className"]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("tr",Object.assign({ref:l,className:(0,a.tremorTwMerge)(o("row"),i)},s),n))});l.displayName="TableRow",e.s(["TableRow",()=>l],496020)},68155,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});e.s(["TrashIcon",0,r],68155)},871943,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});e.s(["ChevronDownIcon",0,r],871943)},360820,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});e.s(["ChevronUpIcon",0,r],360820)},278587,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))});e.s(["RefreshIcon",0,r],278587)},207670,e=>{"use strict";function t(){for(var e,t,r=0,a="",o=arguments.length;rt,"default",0,t])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1fe0596a309ad6cf.js b/litellm/proxy/_experimental/out/_next/static/chunks/1fe0596a309ad6cf.js
deleted file mode 100644
index 40ac980c64..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/1fe0596a309ad6cf.js
+++ /dev/null
@@ -1,12 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,869216,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),l=e.i(908206),i=e.i(242064),o=e.i(517455),a=e.i(150073);let r={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},s=t.default.createContext({});var c=e.i(876556),d=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n},u=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n};let g=e=>{let{itemPrefixCls:l,component:i,span:o,className:a,style:r,labelStyle:c,contentStyle:d,bordered:u,label:g,content:m,colon:b,type:p,styles:f}=e,{classNames:y}=t.useContext(s),$=Object.assign(Object.assign({},c),null==f?void 0:f.label),h=Object.assign(Object.assign({},d),null==f?void 0:f.content);if(u)return t.createElement(i,{colSpan:o,style:r,className:(0,n.default)(a,{[`${l}-item-${p}`]:"label"===p||"content"===p,[null==y?void 0:y.label]:(null==y?void 0:y.label)&&"label"===p,[null==y?void 0:y.content]:(null==y?void 0:y.content)&&"content"===p})},null!=g&&t.createElement("span",{style:$},g),null!=m&&t.createElement("span",{style:h},m));return t.createElement(i,{colSpan:o,style:r,className:(0,n.default)(`${l}-item`,a)},t.createElement("div",{className:`${l}-item-container`},null!=g&&t.createElement("span",{style:$,className:(0,n.default)(`${l}-item-label`,null==y?void 0:y.label,{[`${l}-item-no-colon`]:!b})},g),null!=m&&t.createElement("span",{style:h,className:(0,n.default)(`${l}-item-content`,null==y?void 0:y.content)},m)))};function m(e,{colon:n,prefixCls:l,bordered:i},{component:o,type:a,showLabel:r,showContent:s,labelStyle:c,contentStyle:d,styles:u}){return e.map(({label:e,children:m,prefixCls:b=l,className:p,style:f,labelStyle:y,contentStyle:$,span:h=1,key:v,styles:O},j)=>"string"==typeof o?t.createElement(g,{key:`${a}-${v||j}`,className:p,style:f,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},c),null==u?void 0:u.label),y),null==O?void 0:O.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},d),null==u?void 0:u.content),$),null==O?void 0:O.content)},span:h,colon:n,component:o,itemPrefixCls:b,bordered:i,label:r?e:null,content:s?m:null,type:a}):[t.createElement(g,{key:`label-${v||j}`,className:p,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),null==u?void 0:u.label),f),y),null==O?void 0:O.label),span:1,colon:n,component:o[0],itemPrefixCls:b,bordered:i,label:e,type:"label"}),t.createElement(g,{key:`content-${v||j}`,className:p,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),null==u?void 0:u.content),f),$),null==O?void 0:O.content),span:2*h-1,component:o[1],itemPrefixCls:b,bordered:i,content:m,type:"content"})])}let b=e=>{let n=t.useContext(s),{prefixCls:l,vertical:i,row:o,index:a,bordered:r}=e;return i?t.createElement(t.Fragment,null,t.createElement("tr",{key:`label-${a}`,className:`${l}-row`},m(o,e,Object.assign({component:"th",type:"label",showLabel:!0},n))),t.createElement("tr",{key:`content-${a}`,className:`${l}-row`},m(o,e,Object.assign({component:"td",type:"content",showContent:!0},n)))):t.createElement("tr",{key:a,className:`${l}-row`},m(o,e,Object.assign({component:r?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},n)))};e.i(296059);var p=e.i(915654),f=e.i(183293),y=e.i(246422),$=e.i(838378);let h=(0,y.genStyleHooks)("Descriptions",e=>(e=>{let{componentCls:t,extraColor:n,itemPaddingBottom:l,itemPaddingEnd:i,colonMarginRight:o,colonMarginLeft:a,titleMarginBottom:r}=e;return{[t]:Object.assign(Object.assign(Object.assign({},(0,f.resetComponent)(e)),(e=>{let{componentCls:t,labelBg:n}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${(0,p.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${(0,p.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,p.unit)(e.padding)} ${(0,p.unit)(e.paddingLG)}`,borderInlineEnd:`${(0,p.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:n,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,p.unit)(e.paddingSM)} ${(0,p.unit)(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,p.unit)(e.paddingXS)} ${(0,p.unit)(e.padding)}`}}}}}})(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:r},[`${t}-title`]:Object.assign(Object.assign({},f.textEllipsis),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:n,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:l,paddingInlineEnd:i},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${(0,p.unit)(a)} ${(0,p.unit)(o)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}})((0,$.mergeToken)(e,{})),e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}));var v=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n};let O=e=>{let g,{prefixCls:m,title:p,extra:f,column:y,colon:$=!0,bordered:O,layout:j,children:x,className:S,rootClassName:C,style:E,size:w,labelStyle:N,contentStyle:z,styles:k,items:B,classNames:T}=e,I=v(e,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:P,direction:L,className:M,style:H,classNames:R,styles:G}=(0,i.useComponentConfig)("descriptions"),W=P("descriptions",m),D=(0,a.default)(),A=t.useMemo(()=>{var e;return"number"==typeof y?y:null!=(e=(0,l.matchScreen)(D,Object.assign(Object.assign({},r),y)))?e:3},[D,y]),X=(g=t.useMemo(()=>B||(0,c.default)(x).map(e=>Object.assign(Object.assign({},null==e?void 0:e.props),{key:e.key})),[B,x]),t.useMemo(()=>g.map(e=>{var{span:t}=e,n=d(e,["span"]);return"filled"===t?Object.assign(Object.assign({},n),{filled:!0}):Object.assign(Object.assign({},n),{span:"number"==typeof t?t:(0,l.matchScreen)(D,t)})}),[g,D])),F=(0,o.default)(w),K=((e,n)=>{let[l,i]=(0,t.useMemo)(()=>{let t,l,i,o;return t=[],l=[],i=!1,o=0,n.filter(e=>e).forEach(n=>{let{filled:a}=n,r=u(n,["filled"]);if(a){l.push(r),t.push(l),l=[],o=0;return}let s=e-o;(o+=n.span||1)>=e?(o>e?(i=!0,l.push(Object.assign(Object.assign({},r),{span:s}))):l.push(r),t.push(l),l=[],o=0):l.push(r)}),l.length>0&&t.push(l),[t=t.map(t=>{let n=t.reduce((e,t)=>e+(t.span||1),0);if(n({labelStyle:N,contentStyle:z,styles:{content:Object.assign(Object.assign({},G.content),null==k?void 0:k.content),label:Object.assign(Object.assign({},G.label),null==k?void 0:k.label)},classNames:{label:(0,n.default)(R.label,null==T?void 0:T.label),content:(0,n.default)(R.content,null==T?void 0:T.content)}}),[N,z,k,T,R,G]);return q(t.createElement(s.Provider,{value:V},t.createElement("div",Object.assign({className:(0,n.default)(W,M,R.root,null==T?void 0:T.root,{[`${W}-${F}`]:F&&"default"!==F,[`${W}-bordered`]:!!O,[`${W}-rtl`]:"rtl"===L},S,C,Q,U),style:Object.assign(Object.assign(Object.assign(Object.assign({},H),G.root),null==k?void 0:k.root),E)},I),(p||f)&&t.createElement("div",{className:(0,n.default)(`${W}-header`,R.header,null==T?void 0:T.header),style:Object.assign(Object.assign({},G.header),null==k?void 0:k.header)},p&&t.createElement("div",{className:(0,n.default)(`${W}-title`,R.title,null==T?void 0:T.title),style:Object.assign(Object.assign({},G.title),null==k?void 0:k.title)},p),f&&t.createElement("div",{className:(0,n.default)(`${W}-extra`,R.extra,null==T?void 0:T.extra),style:Object.assign(Object.assign({},G.extra),null==k?void 0:k.extra)},f)),t.createElement("div",{className:`${W}-view`},t.createElement("table",null,t.createElement("tbody",null,K.map((e,n)=>t.createElement(b,{key:n,index:n,colon:$,prefixCls:W,vertical:"vertical"===j,bordered:O,row:e}))))))))};O.Item=({children:e})=>e,e.s(["Descriptions",0,O],869216)},270377,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let l={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"};var i=e.i(9583),o=n.forwardRef(function(e,o){return n.createElement(i.default,(0,t.default)({},e,{ref:o,icon:l}))});e.s(["ExclamationCircleOutlined",0,o],270377)},560445,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(201072),l=e.i(726289),i=e.i(864517),o=e.i(562901),a=e.i(779573),r=e.i(343794),s=e.i(361275),c=e.i(244009),d=e.i(611935),u=e.i(763731),g=e.i(242064);e.i(296059);var m=e.i(915654),b=e.i(183293),p=e.i(246422);let f=(e,t,n,l,i)=>({background:e,border:`${(0,m.unit)(l.lineWidth)} ${l.lineType} ${t}`,[`${i}-icon`]:{color:n}}),y=(0,p.genStyleHooks)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:n,marginXS:l,marginSM:i,fontSize:o,fontSizeLG:a,lineHeight:r,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:u,colorTextHeading:g,withDescriptionPadding:m,defaultPadding:p}=e;return{[t]:Object.assign(Object.assign({},(0,b.resetComponent)(e)),{position:"relative",display:"flex",alignItems:"center",padding:p,wordWrap:"break-word",borderRadius:s,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:l,lineHeight:0},"&-description":{display:"none",fontSize:o,lineHeight:r},"&-message":{color:g},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${n} ${c}, opacity ${n} ${c},
- padding-top ${n} ${c}, padding-bottom ${n} ${c},
- margin-bottom ${n} ${c}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:i,fontSize:d,lineHeight:0},[`${t}-message`]:{display:"block",marginBottom:l,color:g,fontSize:a},[`${t}-description`]:{display:"block",color:u}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}})(e),(e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:l,colorSuccessBg:i,colorWarning:o,colorWarningBorder:a,colorWarningBg:r,colorError:s,colorErrorBorder:c,colorErrorBg:d,colorInfo:u,colorInfoBorder:g,colorInfoBg:m}=e;return{[t]:{"&-success":f(i,l,n,e,t),"&-info":f(m,g,u,e,t),"&-warning":f(r,a,o,e,t),"&-error":Object.assign(Object.assign({},f(d,c,s,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}})(e),(e=>{let{componentCls:t,iconCls:n,motionDurationMid:l,marginXS:i,fontSizeIcon:o,colorIcon:a,colorIconHover:r}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:"hidden",fontSize:o,lineHeight:(0,m.unit)(o),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${n}-close`]:{color:a,transition:`color ${l}`,"&:hover":{color:r}}},"&-close-text":{color:a,transition:`color ${l}`,"&:hover":{color:r}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}));var $=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n};let h={success:n.default,info:a.default,error:l.default,warning:o.default},v=e=>{let{icon:n,prefixCls:l,type:i}=e,o=h[i]||null;return n?(0,u.replaceElement)(n,t.createElement("span",{className:`${l}-icon`},n),()=>({className:(0,r.default)(`${l}-icon`,n.props.className)})):t.createElement(o,{className:`${l}-icon`})},O=e=>{let{isClosable:n,prefixCls:l,closeIcon:o,handleClose:a,ariaProps:r}=e,s=!0===o||void 0===o?t.createElement(i.default,null):o;return n?t.createElement("button",Object.assign({type:"button",onClick:a,className:`${l}-close-icon`,tabIndex:0},r),s):null},j=t.forwardRef((e,n)=>{let{description:l,prefixCls:i,message:o,banner:a,className:u,rootClassName:m,style:b,onMouseEnter:p,onMouseLeave:f,onClick:h,afterClose:j,showIcon:x,closable:S,closeText:C,closeIcon:E,action:w,id:N}=e,z=$(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[k,B]=t.useState(!1),T=t.useRef(null);t.useImperativeHandle(n,()=>({nativeElement:T.current}));let{getPrefixCls:I,direction:P,closable:L,closeIcon:M,className:H,style:R}=(0,g.useComponentConfig)("alert"),G=I("alert",i),[W,D,A]=y(G),X=t=>{var n;B(!0),null==(n=e.onClose)||n.call(e,t)},F=t.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),K=t.useMemo(()=>"object"==typeof S&&!!S.closeIcon||!!C||("boolean"==typeof S?S:!1!==E&&null!=E||!!L),[C,E,S,L]),q=!!a&&void 0===x||x,Q=(0,r.default)(G,`${G}-${F}`,{[`${G}-with-description`]:!!l,[`${G}-no-icon`]:!q,[`${G}-banner`]:!!a,[`${G}-rtl`]:"rtl"===P},H,u,m,A,D),U=(0,c.default)(z,{aria:!0,data:!0}),V=t.useMemo(()=>"object"==typeof S&&S.closeIcon?S.closeIcon:C||(void 0!==E?E:"object"==typeof L&&L.closeIcon?L.closeIcon:M),[E,S,L,C,M]),_=t.useMemo(()=>{let e=null!=S?S:L;if("object"==typeof e){let{closeIcon:t}=e;return $(e,["closeIcon"])}return{}},[S,L]);return W(t.createElement(s.default,{visible:!k,motionName:`${G}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:j},({className:n,style:i},a)=>t.createElement("div",Object.assign({id:N,ref:(0,d.composeRef)(T,a),"data-show":!k,className:(0,r.default)(Q,n),style:Object.assign(Object.assign(Object.assign({},R),b),i),onMouseEnter:p,onMouseLeave:f,onClick:h,role:"alert"},U),q?t.createElement(v,{description:l,icon:e.icon,prefixCls:G,type:F}):null,t.createElement("div",{className:`${G}-content`},o?t.createElement("div",{className:`${G}-message`},o):null,l?t.createElement("div",{className:`${G}-description`},l):null),w?t.createElement("div",{className:`${G}-action`},w):null,t.createElement(O,{isClosable:K,prefixCls:G,closeIcon:V,handleClose:X,ariaProps:_}))))});var x=e.i(278409),S=e.i(233848),C=e.i(487806),E=e.i(479671),w=e.i(480002),N=e.i(868917);let z=function(e){function n(){var e,t,l;return(0,x.default)(this,n),t=n,l=arguments,t=(0,C.default)(t),(e=(0,w.default)(this,(0,E.default)()?Reflect.construct(t,l||[],(0,C.default)(this).constructor):t.apply(this,l))).state={error:void 0,info:{componentStack:""}},e}return(0,N.default)(n,e),(0,S.default)(n,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:n,id:l,children:i}=this.props,{error:o,info:a}=this.state,r=(null==a?void 0:a.componentStack)||null,s=void 0===e?(o||"").toString():e;return o?t.createElement(j,{id:l,type:"error",message:s,description:t.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===n?r:n)}):i}}])}(t.Component);j.ErrorBoundary=z,e.s(["Alert",0,j],560445)},175712,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),l=e.i(529681),i=e.i(242064),o=e.i(517455),a=e.i(185793),r=e.i(721369),s=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n};let c=e=>{var{prefixCls:l,className:o,hoverable:a=!0}=e,r=s(e,["prefixCls","className","hoverable"]);let{getPrefixCls:c}=t.useContext(i.ConfigContext),d=c("card",l),u=(0,n.default)(`${d}-grid`,o,{[`${d}-grid-hoverable`]:a});return t.createElement("div",Object.assign({},r,{className:u}))};e.i(296059);var d=e.i(915654),u=e.i(183293),g=e.i(246422),m=e.i(838378);let b=(0,g.genStyleHooks)("Card",e=>{let t=(0,m.mergeToken)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[(e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:l,colorBorderSecondary:i,boxShadowTertiary:o,bodyPadding:a,extraColor:r}=e;return{[t]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:o},[`${t}-head`]:(e=>{let{antCls:t,componentCls:n,headerHeight:l,headerPadding:i,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:l,marginBottom:-1,padding:`0 ${(0,d.unit)(i)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)} 0 0`},(0,u.clearFix)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},u.textEllipsis),{[`
- > ${n}-typography,
- > ${n}-typography-edit-content
- `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})})(e),[`${t}-extra`]:{marginInlineStart:"auto",color:r,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:a,borderRadius:`0 0 ${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)}`},[`${t}-grid`]:(e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:l,lineWidth:i}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:`
- ${(0,d.unit)(i)} 0 0 0 ${n},
- 0 ${(0,d.unit)(i)} 0 0 ${n},
- ${(0,d.unit)(i)} ${(0,d.unit)(i)} 0 0 ${n},
- ${(0,d.unit)(i)} 0 0 0 ${n} inset,
- 0 ${(0,d.unit)(i)} 0 0 ${n} inset;
- `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:l}}})(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:(e=>{let{componentCls:t,iconCls:n,actionsLiMargin:l,cardActionsIconSize:i,colorBorderSecondary:o,actionsBg:a}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:a,borderTop:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${o}`,display:"flex",borderRadius:`0 0 ${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)}`},(0,u.clearFix)()),{"& > li":{margin:l,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,d.unit)(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:(0,d.unit)(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${o}`}}})})(e),[`${t}-meta`]:Object.assign(Object.assign({margin:`${(0,d.unit)(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,u.clearFix)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},u.textEllipsis),"&-description":{color:e.colorTextDescription}})}),[`${t}-bordered`]:{border:`${(0,d.unit)(e.lineWidth)} ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${(0,d.unit)(e.borderRadiusLG)} ${(0,d.unit)(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:l}}},[`${t}-type-inner`]:(e=>{let{componentCls:t,colorFillAlter:n,headerPadding:l,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${(0,d.unit)(l)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${(0,d.unit)(e.padding)} ${(0,d.unit)(i)}`}}})(e),[`${t}-loading`]:(e=>{let{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}})(e),[`${t}-rtl`]:{direction:"rtl"}}})(t),(e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:l,headerHeightSM:i,headerFontSizeSM:o}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${(0,d.unit)(l)}`,fontSize:o,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}})(t)]},e=>{var t,n;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!=(t=e.bodyPadding)?t:e.paddingLG,headerPadding:null!=(n=e.headerPadding)?n:e.paddingLG}});var p=e.i(792812),f=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n};let y=e=>{let{actionClasses:n,actions:l=[],actionStyle:i}=e;return t.createElement("ul",{className:n,style:i},l.map((e,n)=>{let i=`action-${n}`;return t.createElement("li",{style:{width:`${100/l.length}%`},key:i},t.createElement("span",null,e))}))},$=t.forwardRef((e,s)=>{let d,{prefixCls:u,className:g,rootClassName:m,style:$,extra:h,headStyle:v={},bodyStyle:O={},title:j,loading:x,bordered:S,variant:C,size:E,type:w,cover:N,actions:z,tabList:k,children:B,activeTabKey:T,defaultActiveTabKey:I,tabBarExtraContent:P,hoverable:L,tabProps:M={},classNames:H,styles:R}=e,G=f(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:W,direction:D,card:A}=t.useContext(i.ConfigContext),[X]=(0,p.default)("card",C,S),F=e=>{var t;return(0,n.default)(null==(t=null==A?void 0:A.classNames)?void 0:t[e],null==H?void 0:H[e])},K=e=>{var t;return Object.assign(Object.assign({},null==(t=null==A?void 0:A.styles)?void 0:t[e]),null==R?void 0:R[e])},q=t.useMemo(()=>{let e=!1;return t.Children.forEach(B,t=>{(null==t?void 0:t.type)===c&&(e=!0)}),e},[B]),Q=W("card",u),[U,V,_]=b(Q),J=t.createElement(a.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},B),Y=void 0!==T,Z=Object.assign(Object.assign({},M),{[Y?"activeKey":"defaultActiveKey"]:Y?T:I,tabBarExtraContent:P}),ee=(0,o.default)(E),et=ee&&"default"!==ee?ee:"large",en=k?t.createElement(r.default,Object.assign({size:et},Z,{className:`${Q}-head-tabs`,onChange:t=>{var n;null==(n=e.onTabChange)||n.call(e,t)},items:k.map(e=>{var{tab:t}=e;return Object.assign({label:t},f(e,["tab"]))})})):null;if(j||h||en){let e=(0,n.default)(`${Q}-head`,F("header")),l=(0,n.default)(`${Q}-head-title`,F("title")),i=(0,n.default)(`${Q}-extra`,F("extra")),o=Object.assign(Object.assign({},v),K("header"));d=t.createElement("div",{className:e,style:o},t.createElement("div",{className:`${Q}-head-wrapper`},j&&t.createElement("div",{className:l,style:K("title")},j),h&&t.createElement("div",{className:i,style:K("extra")},h)),en)}let el=(0,n.default)(`${Q}-cover`,F("cover")),ei=N?t.createElement("div",{className:el,style:K("cover")},N):null,eo=(0,n.default)(`${Q}-body`,F("body")),ea=Object.assign(Object.assign({},O),K("body")),er=t.createElement("div",{className:eo,style:ea},x?J:B),es=(0,n.default)(`${Q}-actions`,F("actions")),ec=(null==z?void 0:z.length)?t.createElement(y,{actionClasses:es,actionStyle:K("actions"),actions:z}):null,ed=(0,l.default)(G,["onTabChange"]),eu=(0,n.default)(Q,null==A?void 0:A.className,{[`${Q}-loading`]:x,[`${Q}-bordered`]:"borderless"!==X,[`${Q}-hoverable`]:L,[`${Q}-contain-grid`]:q,[`${Q}-contain-tabs`]:null==k?void 0:k.length,[`${Q}-${ee}`]:ee,[`${Q}-type-${w}`]:!!w,[`${Q}-rtl`]:"rtl"===D},g,m,V,_),eg=Object.assign(Object.assign({},null==A?void 0:A.style),$);return U(t.createElement("div",Object.assign({ref:s},ed,{className:eu,style:eg}),d,ei,er,ec))});var h=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,l=Object.getOwnPropertySymbols(e);it.indexOf(l[i])&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(n[l[i]]=e[l[i]]);return n};$.Grid=c,$.Meta=e=>{let{prefixCls:l,className:o,avatar:a,title:r,description:s}=e,c=h(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=t.useContext(i.ConfigContext),u=d("card",l),g=(0,n.default)(`${u}-meta`,o),m=a?t.createElement("div",{className:`${u}-meta-avatar`},a):null,b=r?t.createElement("div",{className:`${u}-meta-title`},r):null,p=s?t.createElement("div",{className:`${u}-meta-description`},s):null,f=b||p?t.createElement("div",{className:`${u}-meta-detail`},b,p):null;return t.createElement("div",Object.assign({},c,{className:g}),m,f)},e.s(["Card",0,$],175712)},127952,368869,e=>{"use strict";var t=e.i(843476),n=e.i(560445),l=e.i(175712),i=e.i(869216),o=e.i(311451),a=e.i(212931),r=e.i(898586);e.i(296059);var s=e.i(868297),c=e.i(732961),d=e.i(289882),u=e.i(170517),g=e.i(628882),m=e.i(320890),b=e.i(104458),p=e.i(722319),f=e.i(8398),y=e.i(279728);e.i(765846);var $=e.i(602716),h=e.i(328052);e.i(262370);var v=e.i(135551);let O=(e,t)=>new v.FastColor(e).setA(t).toRgbString(),j=(e,t)=>new v.FastColor(e).lighten(t).toHexString(),x=e=>{let t=(0,$.generate)(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},S=(e,t)=>{let n=e||"#000",l=t||"#fff";return{colorBgBase:n,colorTextBase:l,colorText:O(l,.85),colorTextSecondary:O(l,.65),colorTextTertiary:O(l,.45),colorTextQuaternary:O(l,.25),colorFill:O(l,.18),colorFillSecondary:O(l,.12),colorFillTertiary:O(l,.08),colorFillQuaternary:O(l,.04),colorBgSolid:O(l,.95),colorBgSolidHover:O(l,1),colorBgSolidActive:O(l,.9),colorBgElevated:j(n,12),colorBgContainer:j(n,8),colorBgLayout:j(n,0),colorBgSpotlight:j(n,26),colorBgBlur:O(l,.04),colorBorder:j(n,26),colorBorderSecondary:j(n,19)}},C={defaultSeed:m.defaultConfig.token,useToken:function(){let[e,t,n]=(0,b.useToken)();return{theme:e,token:t,hashId:n}},defaultAlgorithm:p.default,darkAlgorithm:(e,t)=>{let n=Object.keys(u.defaultPresetColors).map(t=>{let n=(0,$.generate)(e[t],{theme:"dark"});return Array.from({length:10},()=>1).reduce((e,l,i)=>(e[`${t}-${i+1}`]=n[i],e[`${t}${i+1}`]=n[i],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{}),l=null!=t?t:(0,p.default)(e),i=(0,h.default)(e,{generateColorPalettes:x,generateNeutralColorPalettes:S});return Object.assign(Object.assign(Object.assign(Object.assign({},l),n),i),{colorPrimaryBg:i.colorPrimaryBorder,colorPrimaryBgHover:i.colorPrimaryBorderHover})},compactAlgorithm:(e,t)=>{let n=null!=t?t:(0,p.default)(e),l=n.fontSizeSM,i=n.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),function(e){let{sizeUnit:t,sizeStep:n}=e,l=n-2;return{sizeXXL:t*(l+10),sizeXL:t*(l+6),sizeLG:t*(l+2),sizeMD:t*(l+2),sizeMS:t*(l+1),size:t*l,sizeSM:t*l,sizeXS:t*(l-1),sizeXXS:t*(l-1)}}(null!=t?t:e)),(0,y.default)(l)),{controlHeight:i}),(0,f.default)(Object.assign(Object.assign({},n),{controlHeight:i})))},getDesignToken:e=>{let t=(null==e?void 0:e.algorithm)?(0,s.createTheme)(e.algorithm):d.default,n=Object.assign(Object.assign({},u.default),null==e?void 0:e.token);return(0,c.getComputedToken)(n,{override:null==e?void 0:e.token},t,g.default)},defaultConfig:m.defaultConfig,_internalContext:m.DesignTokenContext};e.s(["theme",0,C],368869);var E=e.i(270377),w=e.i(271645);function N({isOpen:e,title:s,alertMessage:c,message:d,resourceInformationTitle:u,resourceInformation:g,onCancel:m,onOk:b,confirmLoading:p,requiredConfirmation:f}){let{Title:y,Text:$}=r.Typography,{token:h}=C.useToken(),[v,O]=(0,w.useState)("");return(0,w.useEffect)(()=>{e&&O("")},[e]),(0,t.jsx)(a.Modal,{title:s,open:e,onOk:b,onCancel:m,confirmLoading:p,okText:p?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!f&&v!==f||p},cancelButtonProps:{disabled:p},children:(0,t.jsxs)("div",{className:"space-y-4",children:[c&&(0,t.jsx)(n.Alert,{message:c,type:"warning"}),(0,t.jsx)(l.Card,{title:u,className:"mt-4",styles:{body:{padding:"16px"},header:{backgroundColor:h.colorErrorBg,borderColor:h.colorErrorBorder}},style:{backgroundColor:h.colorErrorBg,borderColor:h.colorErrorBorder},children:(0,t.jsx)(i.Descriptions,{column:1,size:"small",children:g&&g.map(({label:e,value:n,...l})=>(0,t.jsx)(i.Descriptions.Item,{label:(0,t.jsx)("span",{className:"font-semibold",children:e}),children:(0,t.jsx)($,{...l,children:n??"-"})},e))})}),(0,t.jsx)("div",{children:(0,t.jsx)($,{children:d})}),f&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,t.jsxs)($,{className:"block text-base font-medium text-gray-700 dark:text-gray-300 mb-2",children:[(0,t.jsx)($,{children:"Type "}),(0,t.jsx)($,{strong:!0,type:"danger",children:f}),(0,t.jsx)($,{children:" to confirm deletion:"})]}),(0,t.jsx)(o.Input,{value:v,onChange:e=>O(e.target.value),placeholder:f,className:"rounded-md",prefix:(0,t.jsx)(E.ExclamationCircleOutlined,{style:{color:h.colorError}}),autoFocus:!0})]})]})})}e.s(["default",()=>N],127952)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2005c732f6d6cbb4.js b/litellm/proxy/_experimental/out/_next/static/chunks/2005c732f6d6cbb4.js
deleted file mode 100644
index 0ea5e0655a..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/2005c732f6d6cbb4.js
+++ /dev/null
@@ -1,84 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,826910,e=>{"use strict";var t=e.i(201072);e.s(["CheckCircleFilled",()=>t.default])},185357,180766,782719,969641,476993,824296,64352,230312,e=>{"use strict";var t,a,l=e.i(843476),r=e.i(808613),i=e.i(311451),s=e.i(212931),n=e.i(199133),o=e.i(262218),d=e.i(898586),c=e.i(464571),m=e.i(271645),u=e.i(727749),p=e.i(764205),g=e.i(770914),x=e.i(515831),h=e.i(175712),f=e.i(646563),y=e.i(519756);let{Text:j}=d.Typography,{Option:_}=n.Select,b=({visible:e,prebuiltPatterns:t,categories:a,selectedPatternName:r,patternAction:i,onPatternNameChange:o,onActionChange:d,onAdd:m,onCancel:u})=>(0,l.jsxs)(s.Modal,{title:"Add prebuilt pattern",open:e,onCancel:u,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Pattern type"}),(0,l.jsx)(n.Select,{placeholder:"Choose pattern type",value:r,onChange:o,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,a)=>{let l=t.find(e=>e.name===a?.value);return!!l&&(l.display_name.toLowerCase().includes(e.toLowerCase())||l.name.toLowerCase().includes(e.toLowerCase()))},children:a.map(e=>{let a=t.filter(t=>t.category===e);return 0===a.length?null:(0,l.jsx)(n.Select.OptGroup,{label:e,children:a.map(e=>(0,l.jsx)(_,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Action"}),(0,l.jsx)(j,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:i,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(_,{value:"BLOCK",children:"Block"}),(0,l.jsx)(_,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:u,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:m,children:"Add"})]})]}),{Text:v}=d.Typography,{Option:w}=n.Select,N=({visible:e,patternName:t,patternRegex:a,patternAction:r,onNameChange:o,onRegexChange:d,onActionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add custom regex pattern",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Pattern name"}),(0,l.jsx)(i.Input,{placeholder:"e.g., internal_id, employee_code",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Regex pattern"}),(0,l.jsx)(i.Input,{placeholder:"e.g., ID-[0-9]{6}",value:a,onChange:e=>d(e.target.value),style:{marginTop:8}}),(0,l.jsx)(v,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Action"}),(0,l.jsx)(v,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:r,onChange:m,style:{width:"100%"},children:[(0,l.jsx)(w,{value:"BLOCK",children:"Block"}),(0,l.jsx)(w,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]}),{Text:C}=d.Typography,{Option:S}=n.Select,k=({visible:e,keyword:t,action:a,description:r,onKeywordChange:o,onActionChange:d,onDescriptionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add blocked keyword",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Keyword"}),(0,l.jsx)(i.Input,{placeholder:"Enter sensitive keyword or phrase",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Action"}),(0,l.jsx)(C,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,l.jsxs)(n.Select,{value:a,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(S,{value:"BLOCK",children:"Block"}),(0,l.jsx)(S,{value:"MASK",children:"Mask"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Description (optional)"}),(0,l.jsx)(i.Input.TextArea,{placeholder:"Explain why this keyword is sensitive",value:r,onChange:e=>m(e.target.value),rows:3,style:{marginTop:8}})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]});var I=e.i(291542),A=e.i(955135);let{Text:O}=d.Typography,{Option:T}=n.Select,P=({patterns:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,l.jsx)(o.Tag,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,t)=>t.display_name||t.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,l.jsxs)(O,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(T,{value:"BLOCK",children:"Block"}),(0,l.jsx)(T,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})},{Text:L}=d.Typography,{Option:B}=n.Select,F=({keywords:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,"action",e),style:{width:120},size:"small",children:[(0,l.jsx)(B,{value:"BLOCK",children:"Block"}),(0,l.jsx)(B,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})};var $=e.i(362024),E=e.i(993914);let{Title:M,Text:R}=d.Typography,{Option:G}=n.Select,z=({availableCategories:e,selectedCategories:t,onCategoryAdd:a,onCategoryRemove:r,onCategoryUpdate:i,accessToken:s,pendingSelection:d,onPendingSelectionChange:u})=>{let[g,x]=m.default.useState(""),y=void 0!==d?d:g,j=u||x,[_,b]=m.default.useState({}),[v,w]=m.default.useState({}),[N,C]=m.default.useState({}),[S,k]=m.default.useState([]),[O,T]=m.default.useState(""),[P,L]=m.default.useState(!1),B=async e=>{if(s&&!_[e]){C(t=>({...t,[e]:!0}));try{let t=await (0,p.getCategoryYaml)(s,e),a=t.yaml_content;if("json"===t.file_type)try{let e=JSON.parse(a);a=JSON.stringify(e,null,2)}catch(t){console.warn(`Failed to format JSON for ${e}:`,t)}b(t=>({...t,[e]:a})),w(a=>({...a,[e]:t.file_type||"yaml"}))}catch(t){console.error(`Failed to fetch content for category ${e}:`,t)}finally{C(t=>({...t,[e]:!1}))}}};m.default.useEffect(()=>{if(y&&s){let e=_[y];if(e)return void T(e);L(!0),console.log(`Fetching content for category: ${y}`,{accessToken:s?"present":"missing"}),(0,p.getCategoryYaml)(s,y).then(e=>{console.log(`Successfully fetched content for ${y}:`,e);let t=e.yaml_content;if("json"===e.file_type)try{let e=JSON.parse(t);t=JSON.stringify(e,null,2)}catch(e){console.warn(`Failed to format JSON for ${y}:`,e)}T(t),b(e=>({...e,[y]:t})),w(t=>({...t,[y]:e.file_type||"yaml"}))}).catch(e=>{console.error(`Failed to fetch preview content for category ${y}:`,e),T("")}).finally(()=>{L(!1)})}else T(""),L(!1)},[y,s]);let F=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(t,a)=>{let r=e.find(e=>e.name===a.category);return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:t}),r?.description&&(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888",marginTop:"4px"},children:r.description})]})}},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"action",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"BLOCK",children:(0,l.jsx)(o.Tag,{color:"red",children:"BLOCK"})}),(0,l.jsx)(G,{value:"MASK",children:(0,l.jsx)(o.Tag,{color:"orange",children:"MASK"})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"severity_threshold",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"low",children:"Low"}),(0,l.jsx)(G,{value:"medium",children:"Medium"}),(0,l.jsx)(G,{value:"high",children:"High"})]})},{title:"",key:"actions",width:80,render:(e,t)=>(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r(t.id),size:"small",children:"Remove"})}],z=e.filter(e=>!t.some(t=>t.category===e.name));return(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:8},children:[(0,l.jsx)(M,{level:5,style:{margin:0},children:"Blocked topics"}),(0,l.jsx)(R,{type:"secondary",style:{fontSize:12,fontWeight:400},children:"Select topics to block using keyword and semantic analysis"})]}),size:"small",children:[(0,l.jsxs)("div",{style:{marginBottom:16,display:"flex",gap:8},children:[(0,l.jsx)(n.Select,{placeholder:"Select a content category",value:y||void 0,onChange:j,style:{flex:1},showSearch:!0,optionLabelProp:"label",filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),children:z.map(e=>(0,l.jsx)(G,{value:e.name,label:e.display_name,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:e.display_name}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:e.description})]})},e.name))}),(0,l.jsx)(c.Button,{type:"primary",onClick:()=>{if(!y)return;let l=e.find(e=>e.name===y);!l||t.some(e=>e.category===y)||(a({id:`category-${Date.now()}`,category:l.name,display_name:l.display_name,action:l.default_action,severity_threshold:"medium"}),j(""),T(""))},disabled:!y,icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add"})]}),y&&(0,l.jsxs)("div",{style:{marginBottom:16,padding:"12px",background:"#f9f9f9",border:"1px solid #e0e0e0",borderRadius:"4px"},children:[(0,l.jsxs)("div",{style:{marginBottom:8,fontWeight:500,fontSize:"14px"},children:["Preview: ",e.find(e=>e.name===y)?.display_name,v[y]&&(0,l.jsxs)("span",{style:{marginLeft:8,fontSize:"12px",color:"#888",fontWeight:400},children:["(",v[y]?.toUpperCase(),")"]})]}),P?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):O?(0,l.jsx)("pre",{style:{background:"#fff",padding:"12px",borderRadius:"4px",overflow:"auto",maxHeight:"300px",maxWidth:"100%",fontSize:"12px",lineHeight:"1.5",margin:0,border:"1px solid #e0e0e0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,l.jsx)("code",{children:O})}):(0,l.jsx)("div",{style:{padding:"8px",textAlign:"center",color:"#888",fontSize:"12px"},children:"Unable to load category content"})]}),t.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Table,{dataSource:t,columns:F,pagination:!1,size:"small",rowKey:"id"}),(0,l.jsx)("div",{style:{marginTop:16},children:(0,l.jsx)($.Collapse,{activeKey:S,onChange:e=>{let t=Array.isArray(e)?e:e?[e]:[],a=new Set(S);t.forEach(e=>{a.has(e)||_[e]||B(e)}),k(t)},ghost:!0,items:t.map(e=>{let t=(v[e.category]||"yaml").toUpperCase();return{key:e.category,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(E.FileTextOutlined,{}),(0,l.jsxs)("span",{children:["View ",t," for ",e.display_name]})]}),children:N[e.category]?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):_[e.category]?(0,l.jsx)("pre",{style:{background:"#f5f5f5",padding:"16px",borderRadius:"4px",overflow:"auto",maxHeight:"400px",fontSize:"12px",lineHeight:"1.5",margin:0},children:(0,l.jsx)("code",{children:_[e.category]})}):(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Content will load when expanded"})}})})})]}):(0,l.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"#888",border:"1px dashed #d9d9d9",borderRadius:"4px"},children:"No blocked topics selected. Add topics to detect and block harmful content."})]})};var D=e.i(790848),K=e.i(28651);let{Title:H,Text:q}=d.Typography,{Option:J}=n.Select,U={competitor_intent_type:"airline",brand_self:[],locations:[],policy:{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:.7,threshold_medium:.45,threshold_low:.3},W=({enabled:e,config:t,onChange:a,accessToken:i})=>{let s=t??U,[o,d]=(0,m.useState)([]),[c,u]=(0,m.useState)(!1);(0,m.useEffect)(()=>{"airline"===s.competitor_intent_type&&i&&0===o.length&&(u(!0),(0,p.getMajorAirlines)(i).then(e=>d(e.airlines??[])).catch(()=>d([])).finally(()=>u(!1)))},[s.competitor_intent_type,i,o.length]);let x=e=>{a(e,e?{...U}:null)},f=(t,l)=>{a(e,{...s,[t]:l})},y=(t,l)=>{a(e,{...s,policy:{...s.policy,[t]:l}})},j=(t,l)=>{a(e,{...s,[t]:l.filter(Boolean)})};return e?(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(H,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:e,onChange:x})]}),size:"small",children:[(0,l.jsx)(q,{type:"secondary",style:{display:"block",marginBottom:16},children:"Block or reframe competitor comparison questions. Airline type uses major airlines (excluding your brand); generic requires manual competitor list."}),(0,l.jsxs)(r.Form,{layout:"vertical",size:"small",children:[(0,l.jsx)(r.Form.Item,{label:"Type",children:(0,l.jsxs)(n.Select,{value:s.competitor_intent_type,onChange:e=>f("competitor_intent_type",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"airline",children:"Airline (auto-load competitors from IATA)"}),(0,l.jsx)(J,{value:"generic",children:"Generic (specify competitors manually)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Your Brand (brand_self)",required:!0,help:"airline"===s.competitor_intent_type?"Select your airline from the list (excluded from competitors) or type to add a custom term":"Names/codes users use for your brand",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:c?"Loading airlines...":"airline"===s.competitor_intent_type?"Search or select airline, or type to add custom":"Type and press Enter to add",value:s.brand_self,onChange:t=>"airline"===s.competitor_intent_type&&o.length>0?(t=>{let l=t.filter(Boolean),r=[],i=new Set;for(let e of l){let t=o.find(t=>t.match.split("|")[0]?.trim().toLowerCase()===e.toLowerCase());if(t)for(let e of t.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean))i.has(e)||(i.add(e),r.push(e));else i.has(e.toLowerCase())||(i.add(e.toLowerCase()),r.push(e))}a(e,{...s,brand_self:r})})(t??[]):j("brand_self",t??[]),tokenSeparators:[","],loading:c,showSearch:!0,filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),optionFilterProp:"label",options:"airline"===s.competitor_intent_type&&o.length>0?o.map(e=>{let t=e.match.split("|")[0]?.trim()??e.id,a=e.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean);return{value:t.toLowerCase(),label:`${t}${a.length>1?` (${a.slice(1).join(", ")})`:""}`}}):void 0})}),"airline"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Locations (optional)",help:"Countries, cities, airports for disambiguation (e.g. qatar, doha)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.locations??[],onChange:e=>j("locations",e??[]),tokenSeparators:[","]})}),"generic"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Competitors",required:!0,help:"Competitor names to detect (required for generic type)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.competitors??[],onChange:e=>j("competitors",e??[]),tokenSeparators:[","]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.competitor_comparison??"refuse",onChange:e=>y("competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Possible competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.possible_competitor_comparison??"reframe",onChange:e=>y("possible_competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative to backend LLM)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Confidence thresholds",help:(0,l.jsxs)(l.Fragment,{children:["Classify competitor intent by confidence (0–1). Higher confidence → stronger intent.",(0,l.jsxs)("ul",{style:{marginBottom:0,marginTop:4,paddingLeft:20},children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"High (≥)"}),': Treat as full competitor comparison → uses "Competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Medium (≥)"}),': Treat as possible comparison → uses "Possible competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Low (≥)"}),": Log only; allow request. Below Low → allow with no action"]})]}),"Raise thresholds to be more permissive; lower them to be stricter."]}),children:(0,l.jsxs)(g.Space,{wrap:!0,children:[(0,l.jsx)(r.Form.Item,{label:"High",style:{marginBottom:0},help:"e.g. 0.7",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_high??.7,onChange:e=>f("threshold_high",e??.7),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Medium",style:{marginBottom:0},help:"e.g. 0.45",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_medium??.45,onChange:e=>f("threshold_medium",e??.45),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Low",style:{marginBottom:0},help:"e.g. 0.3",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_low??.3,onChange:e=>f("threshold_low",e??.3),style:{width:80}})})]})})]})]}):(0,l.jsx)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(H,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:!1,onChange:x})]}),size:"small",children:(0,l.jsx)(q,{type:"secondary",children:"Block or reframe competitor comparison questions. When enabled, airline type auto-loads competitors from IATA; generic type requires manual competitor list."})})},{Title:V,Text:Y}=d.Typography,Q=({prebuiltPatterns:e,categories:t,selectedPatterns:a,blockedWords:r,onPatternAdd:i,onPatternRemove:s,onPatternActionChange:n,onBlockedWordAdd:o,onBlockedWordRemove:d,onBlockedWordUpdate:j,onFileUpload:_,accessToken:v,showStep:w,contentCategories:C=[],selectedContentCategories:S=[],onContentCategoryAdd:I,onContentCategoryRemove:A,onContentCategoryUpdate:O,pendingCategorySelection:T,onPendingCategorySelectionChange:L,competitorIntentEnabled:B=!1,competitorIntentConfig:$=null,onCompetitorIntentChange:E})=>{let[M,R]=(0,m.useState)(!1),[G,D]=(0,m.useState)(!1),[K,H]=(0,m.useState)(!1),[q,J]=(0,m.useState)(""),[U,Q]=(0,m.useState)("BLOCK"),[Z,X]=(0,m.useState)(""),[ee,et]=(0,m.useState)(""),[ea,el]=(0,m.useState)("BLOCK"),[er,ei]=(0,m.useState)(""),[es,en]=(0,m.useState)("BLOCK"),[eo,ed]=(0,m.useState)(""),[ec,em]=(0,m.useState)(!1),eu=async e=>{em(!0);try{let t=await e.text();if(v){let e=await (0,p.validateBlockedWordsFile)(v,t);if(e.valid)_&&_(t),u.default.success(e.message||"File uploaded successfully");else{let t=e.error||e.errors&&e.errors.join(", ")||"Invalid file";u.default.error(`Validation failed: ${t}`)}}}catch(e){u.default.error(`Failed to upload file: ${e}`)}finally{em(!1)}return!1};return(0,l.jsxs)("div",{className:"space-y-6",children:[!w&&(0,l.jsx)("div",{children:(0,l.jsx)(Y,{type:"secondary",children:"Configure patterns, keywords, and content categories to detect and filter sensitive information in requests and responses."})}),(!w||"patterns"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>R(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add prebuilt pattern"}),(0,l.jsx)(c.Button,{onClick:()=>H(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add custom regex"})]})}),(0,l.jsx)(P,{patterns:a,onActionChange:n,onRemove:s})]}),(!w||"keywords"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>D(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add keyword"}),(0,l.jsx)(x.Upload,{beforeUpload:eu,accept:".yaml,.yml",showUploadList:!1,children:(0,l.jsx)(c.Button,{icon:(0,l.jsx)(y.UploadOutlined,{}),loading:ec,children:"Upload YAML file"})})]})}),(0,l.jsx)(F,{keywords:r,onActionChange:j,onRemove:d})]}),(!w||"competitor_intent"===w||"categories"===w)&&E&&(0,l.jsx)(W,{enabled:B,config:$,onChange:E,accessToken:v}),(!w||"categories"===w)&&C.length>0&&I&&A&&O&&(0,l.jsx)(z,{availableCategories:C,selectedCategories:S,onCategoryAdd:I,onCategoryRemove:A,onCategoryUpdate:O,accessToken:v,pendingSelection:T,onPendingSelectionChange:L}),(0,l.jsx)(b,{visible:M,prebuiltPatterns:e,categories:t,selectedPatternName:q,patternAction:U,onPatternNameChange:J,onActionChange:e=>Q(e),onAdd:()=>{if(!q)return void u.default.error("Please select a pattern");let t=e.find(e=>e.name===q);i({id:`pattern-${Date.now()}`,type:"prebuilt",name:q,display_name:t?.display_name,action:U}),R(!1),J(""),Q("BLOCK")},onCancel:()=>{R(!1),J(""),Q("BLOCK")}}),(0,l.jsx)(N,{visible:K,patternName:Z,patternRegex:ee,patternAction:ea,onNameChange:X,onRegexChange:et,onActionChange:e=>el(e),onAdd:()=>{Z&&ee?(i({id:`custom-${Date.now()}`,type:"custom",name:Z,pattern:ee,action:ea}),H(!1),X(""),et(""),el("BLOCK")):u.default.error("Please provide pattern name and regex")},onCancel:()=>{H(!1),X(""),et(""),el("BLOCK")}}),(0,l.jsx)(k,{visible:G,keyword:er,action:es,description:eo,onKeywordChange:ei,onActionChange:e=>en(e),onDescriptionChange:ed,onAdd:()=>{er?(o({id:`word-${Date.now()}`,keyword:er,action:es,description:eo||void 0}),D(!1),ei(""),ed(""),en("BLOCK")):u.default.error("Please enter a keyword")},onCancel:()=>{D(!1),ei(""),ed(""),en("BLOCK")}})]})};var Z=((t={}).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t);let X={},ee=e=>{let t={};return t.PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t.LlmAsAJudge="LiteLLM LLM as a Judge",Object.entries(e).forEach(([e,a])=>{a&&"object"==typeof a&&"ui_friendly_name"in a&&(t[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=a.ui_friendly_name)}),X=t,t},et=()=>Object.keys(X).length>0?X:Z,ea={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission",BlockCodeExecution:"block_code_execution",Promptguard:"promptguard",LlmAsAJudge:"llm_as_a_judge"},el=e=>{Object.entries(e).forEach(([e,t])=>{t&&"object"==typeof t&&"ui_friendly_name"in t&&(ea[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=e)})},er=e=>!!e&&"Presidio PII"===et()[e],ei=e=>!!e&&"LiteLLM Content Filter"===et()[e],es=e=>!!e&&"llm_as_a_judge"===ea[e],en="../ui/assets/logos/",eo={"Zscaler AI Guard":`${en}zscaler.svg`,"Presidio PII":`${en}microsoft_azure.svg`,"Bedrock Guardrail":`${en}bedrock.svg`,Lakera:`${en}lakeraai.jpeg`,"Azure Content Safety Prompt Shield":`${en}microsoft_azure.svg`,"Azure Content Safety Text Moderation":`${en}microsoft_azure.svg`,"Aporia AI":`${en}aporia.png`,"PANW Prisma AIRS":`${en}palo_alto_networks.jpeg`,"Noma Security":`${en}noma_security.png`,"Javelin Guardrails":`${en}javelin.png`,"Pillar Guardrail":`${en}pillar.jpeg`,"Google Cloud Model Armor":`${en}google.svg`,"Guardrails AI":`${en}guardrails_ai.jpeg`,"Lasso Guardrail":`${en}lasso.png`,"Pangea Guardrail":`${en}pangea.png`,"AIM Guardrail":`${en}aim_security.jpeg`,"OpenAI Moderation":`${en}openai_small.svg`,EnkryptAI:`${en}enkrypt_ai.avif`,"Prompt Security":`${en}prompt_security.png`,PromptGuard:`${en}promptguard.svg`,"LiteLLM Content Filter":`${en}litellm_logo.jpg`,"LiteLLM LLM as a Judge":`${en}litellm_logo.jpg`,Akto:`${en}akto.svg`},ed=e=>{if(!e)return{logo:"",displayName:"-"};let t=Object.keys(ea).find(t=>ea[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let a=et()[t];return{logo:eo[a]||"",displayName:a||e}};function ec(e){return!0===e?"yes":!1===e?"no":"inherit"}function em(e){return"yes"===e||"no"!==e&&void 0}e.s(["choiceToSkipSystemForCreate",()=>em,"getGuardrailLogoAndName",0,ed,"getGuardrailProviders",0,et,"guardrailLogoMap",0,eo,"guardrail_provider_map",0,ea,"populateGuardrailProviderMap",0,el,"populateGuardrailProviders",0,ee,"shouldRenderContentFilterConfigSettings",0,ei,"shouldRenderLLMJudgeFields",0,es,"shouldRenderPIIConfigSettings",0,er,"skipSystemMessageToChoice",()=>ec],180766);var eu=e.i(435451);let{Title:ep}=d.Typography,eg=({field:e,fieldKey:t,fullFieldKey:a,value:s})=>{let[o,d]=m.default.useState([]),[u,p]=m.default.useState(e.dict_key_options||[]);return m.default.useEffect(()=>{if(s&&"object"==typeof s){let t=Object.keys(s);d(t.map(e=>({key:e,id:`${e}_${Date.now()}_${Math.random()}`}))),p((e.dict_key_options||[]).filter(e=>!t.includes(e)))}},[s,e.dict_key_options]),(0,l.jsxs)("div",{className:"space-y-3",children:[o.map(t=>(0,l.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,l.jsx)("div",{className:"w-24 font-medium text-sm",children:t.key}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(r.Form.Item,{name:Array.isArray(a)?[...a,t.key]:[a,t.key],style:{marginBottom:0},initialValue:s&&"object"==typeof s?s[t.key]:void 0,normalize:"number"===e.dict_value_type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"number"===e.dict_value_type?(0,l.jsx)(eu.default,{step:1,width:200,placeholder:`Enter ${t.key} value`}):"boolean"===e.dict_value_type?(0,l.jsxs)(n.Select,{placeholder:`Select ${t.key} value`,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):(0,l.jsx)(i.Input,{placeholder:`Enter ${t.key} value`})})}),(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>{var e,a;return e=t.id,a=t.key,void(d(o.filter(t=>t.id!==e)),p([...u,a].sort()))},children:"Remove"})]},t.id)),u.length>0&&(0,l.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,l.jsx)(n.Select,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&void(!e||(d([...o,{key:e,id:`${e}_${Date.now()}`}]),p(u.filter(t=>t!==e)))),value:void 0,children:u.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}),(0,l.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})},ex=({optionalParams:e,parentFieldKey:t,values:a})=>e.fields&&0!==Object.keys(e.fields).length?(0,l.jsxs)("div",{className:"guardrail-optional-params",children:[(0,l.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,l.jsx)(ep,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,l.jsx)("p",{className:"text-gray-600 text-sm",children:e.description||"Configure additional settings for this guardrail provider"})]}),(0,l.jsx)("div",{className:"space-y-8",children:Object.entries(e.fields).map(([e,s])=>{let o,d;return o=`${t}.${e}`,(console.log("value",d=a?.[e]),"dict"===s.type&&s.dict_key_options)?(0,l.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,l.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,l.jsx)(eg,{field:s,fieldKey:e,fullFieldKey:[t,e],value:d})]},o):(0,l.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,l.jsx)(r.Form.Item,{name:[t,e],label:(0,l.jsxs)("div",{className:"mb-2",children:[(0,l.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:`${e} is required`}]:void 0,className:"mb-0",initialValue:void 0!==d?d:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"select"===s.type&&s.options?(0,l.jsx)(n.Select,{placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,l.jsxs)(n.Select,{placeholder:s.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"number"===s.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:s.description}):(0,l.jsx)(i.Input,{placeholder:s.description})})},o)})})]}):null;var eh=e.i(482725),ef=e.i(850627);let ey=({selectedProvider:e,accessToken:t,providerParams:a=null,value:s=null})=>{let[o,d]=(0,m.useState)(!1),[c,u]=(0,m.useState)(a),[g,x]=(0,m.useState)(null);if((0,m.useEffect)(()=>{if(a)return void u(a);let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,p.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),ee(e),el(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};a||e()},[t,a]),!e)return null;if(o)return(0,l.jsx)(eh.Spin,{tip:"Loading provider parameters..."});if(g)return(0,l.jsx)("div",{className:"text-red-500",children:g});let h=ea[e]?.toLowerCase(),f=c&&c[h];if(console.log("Provider key:",h),console.log("Provider fields:",f),!f||0===Object.keys(f).length)return(0,l.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",s);let y=new Set(["patterns","blocked_words","blocked_words_file","categories","severity_threshold","pattern_redaction_format","keyword_redaction_tag"]),j=ei(e),_=(e,t="",a)=>Object.entries(e).map(([e,o])=>{let d=t?`${t}.${e}`:e,c=a?a[e]:s?.[e];if(console.log("Field value:",c),"ui_friendly_name"===e||"optional_params"===e&&"nested"===o.type&&o.fields||j&&y.has(e))return null;if("nested"===o.type&&o.fields)return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 font-medium",children:e}),(0,l.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:_(o.fields,d,c)})]},d);let m=void 0!==c?c:o.default_value??("percentage"===o.type?.5:void 0);return(0,l.jsx)(r.Form.Item,{name:d,label:e,tooltip:o.description,rules:o.required?[{required:!0,message:`${e} is required`}]:void 0,initialValue:m,children:"select"===o.type&&o.options?(0,l.jsx)(n.Select,{placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===o.type&&o.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===o.type||"boolean"===o.type?(0,l.jsxs)(n.Select,{placeholder:o.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"percentage"===o.type&&null!=o.min&&null!=o.max?(0,l.jsx)(ef.Slider,{min:o.min,max:o.max,step:o.step??.1,marks:{[o.min]:"0%",[(o.min+o.max)/2]:"50%",[o.max]:"100%"}}):"number"===o.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:o.description,defaultValue:void 0!==c?Number(c):void 0}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:o.description,defaultValue:c||""}):(0,l.jsx)(i.Input,{placeholder:o.description,defaultValue:c||""})},d)});return(0,l.jsx)(l.Fragment,{children:_(f)})};var ej=e.i(592968),e_=e.i(750113);let eb=({availableModels:e,form:t})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6,padding:"10px 14px",marginBottom:16,fontSize:13,color:"#389e0d"},children:["After each LLM response, the ",(0,l.jsx)("strong",{children:"Judge Model"})," scores it 0–100 against your criteria. If the weighted average falls below the threshold, the response is blocked (or logged)."]}),(0,l.jsx)(r.Form.Item,{name:"judge_model",label:(0,l.jsxs)("span",{children:["Judge Model ",(0,l.jsx)(ej.Tooltip,{title:"The LLM that reads each response and grades it. Pick a capable model — it never sees end-user data beyond what the LLM returned.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),rules:[{required:!0,message:"Select a judge model"}],children:(0,l.jsx)(n.Select,{showSearch:!0,placeholder:"Select a model",options:e.map(e=>({label:e,value:e}))})}),(0,l.jsx)(r.Form.Item,{name:"overall_threshold",label:(0,l.jsxs)("span",{children:["Minimum Score to Pass ",(0,l.jsx)(ej.Tooltip,{title:"0–100. If the weighted average of criterion scores falls below this, the guardrail triggers. 80 is a good default.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:80,children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"/ 100",style:{width:"100%"}})}),(0,l.jsx)(r.Form.Item,{name:"on_failure",label:(0,l.jsxs)("span",{children:["On Failure ",(0,l.jsx)(ej.Tooltip,{title:"Block: return HTTP 422 when the score is too low. Log: record the result but let the response through.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:"block",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block (return 422)"}),(0,l.jsx)(n.Select.Option,{value:"log",children:"Log only"})]})}),(0,l.jsx)(r.Form.Item,{label:(0,l.jsxs)("span",{children:["Evaluation Criteria ",(0,l.jsx)(ej.Tooltip,{title:"Each criterion is something the judge checks. Weights must add up to 100%.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,l.jsx)(r.Form.List,{name:"criteria",initialValue:[{name:"",weight:100,description:""}],children:(e,{add:a,remove:s})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...a})=>(0,l.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,padding:"12px 12px 0",marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-end"},children:[(0,l.jsx)(r.Form.Item,{...a,name:[t,"name"],rules:[{required:!0,message:"Enter criterion name"}],style:{flex:2,marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"Criterion name (e.g. Policy accuracy)"})}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"weight"],label:(0,l.jsx)(ej.Tooltip,{title:"How much this criterion counts toward the final score. All weights must add up to 100%.",children:(0,l.jsxs)("span",{style:{fontSize:12,color:"#595959"},children:["Weight ",(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#bfbfbf"}})]})}),rules:[{required:!0,message:"Enter weight"}],style:{flex:1,marginBottom:8},children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"%",style:{width:"100%"},placeholder:"e.g. 50"})}),(0,l.jsx)("div",{style:{marginBottom:8},children:(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>s(t),children:"×"})})]}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"description"],rules:[{required:!0,message:"Describe what to check"}],style:{marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"What should the judge check for this criterion?"})})]},e)),(0,l.jsx)(c.Button,{type:"dashed",block:!0,style:{marginTop:4},onClick:()=>a({name:"",weight:0,description:""}),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add Criterion"}),e.length>0&&(0,l.jsx)(r.Form.Item,{shouldUpdate:!0,noStyle:!0,children:()=>{let e=(t.getFieldValue("criteria")||[]).reduce((e,t)=>e+(Number(t?.weight)||0),0),a=100===e;return(0,l.jsxs)("div",{style:{marginTop:6,fontSize:12,color:a?"#52c41a":"#faad14"},children:["Weights total: ",e,"%",a?" ✓":" — must add up to 100%"]})}})]})})})]});var ev=e.i(536916),ew=e.i(149192),eN=e.i(741585),eN=eN,eC=e.i(724154);e.i(247167);var eS=e.i(931067);let ek={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"};var eI=e.i(9583),eA=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:ek}))});let{Text:eO}=d.Typography,{Option:eT}=n.Select,eP=({categories:e,selectedCategories:t,onChange:a})=>(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-2",children:[(0,l.jsx)(eA,{className:"text-gray-500 mr-1"}),(0,l.jsx)(eO,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,l.jsx)(n.Select,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:a,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,l.jsx)(o.Tag,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:e.map(e=>(0,l.jsx)(eT,{value:e.category,children:e.category},e.category))})]}),eL=({onSelectAll:e,onUnselectAll:t,hasSelectedEntities:a})=>(0,l.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(eO,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,l.jsx)(ej.Tooltip,{title:"Apply action to all PII types at once",children:(0,l.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:t,disabled:!a,icon:(0,l.jsx)(ew.CloseOutlined,{}),children:"Unselect All"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(c.Button,{color:"primary",variant:"outlined",onClick:()=>e("MASK"),className:"h-10",block:!0,icon:(0,l.jsx)(eN.default,{}),children:"Select All & Mask"}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:()=>e("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,l.jsx)(eC.StopOutlined,{}),children:"Select All & Block"})]})]}),eB=({entities:e,selectedEntities:t,selectedActions:a,actions:r,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:d})=>(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eO,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,l.jsx)(eO,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===e.length?(0,l.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):e.map(e=>(0,l.jsxs)("div",{className:`px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ${t.includes(e)?"bg-blue-50":""}`,children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)(ev.Checkbox,{checked:t.includes(e),onChange:()=>i(e),className:"mr-3"}),(0,l.jsx)(eO,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:e.replace(/_/g," ")}),d.get(e)&&(0,l.jsx)(o.Tag,{className:"ml-2 text-xs",color:"blue",children:d.get(e)})]}),(0,l.jsx)("div",{className:"w-32",children:(0,l.jsx)(n.Select,{value:t.includes(e)&&a[e]||"MASK",onChange:t=>s(e,t),style:{width:120},disabled:!t.includes(e),className:`${!t.includes(e)?"opacity-50":""}`,dropdownMatchSelectWidth:!1,children:r.map(e=>(0,l.jsx)(eT,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center",children:[(e=>{switch(e){case"MASK":return(0,l.jsx)(eN.default,{style:{marginRight:4}});case"BLOCK":return(0,l.jsx)(eC.StopOutlined,{style:{marginRight:4}});default:return null}})(e),e]})},e))})})]},e))})]}),{Title:eF,Text:e$}=d.Typography,eE=({entities:e,actions:t,selectedEntities:a,selectedActions:r,onEntitySelect:i,onActionSelect:s,entityCategories:n=[]})=>{let[o,d]=(0,m.useState)([]),c=new Map;n.forEach(e=>{e.entities.forEach(t=>{c.set(t,e.category)})});let u=e.filter(e=>0===o.length||o.includes(c.get(e)||""));return(0,l.jsxs)("div",{className:"pii-configuration",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,l.jsx)("div",{className:"flex items-center",children:(0,l.jsx)(eF,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,l.jsxs)(e$,{className:"text-gray-500",children:[a.length," items selected"]})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)(eP,{categories:n,selectedCategories:o,onChange:d}),(0,l.jsx)(eL,{onSelectAll:t=>{e.forEach(e=>{a.includes(e)||i(e),s(e,t)})},onUnselectAll:()=>{a.forEach(e=>{i(e)})},hasSelectedEntities:a.length>0})]}),(0,l.jsx)(eB,{entities:u,selectedEntities:a,selectedActions:r,actions:t,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:c})]})};var eM=e.i(304967),eR=e.i(599724),eG=e.i(312361),ez=e.i(21548),eD=e.i(827252);let eK={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eH=({value:e,onChange:t,disabled:a=!1})=>{let r={...eK,...e||{},rules:e?.rules?[...e.rules]:[]},s=e=>{let a={...r,...e};t?.(a)},o=(e,t)=>{s({rules:r.rules.map((a,l)=>l===e?{...a,...t}:a)})},d=(e,t)=>{let a=r.rules[e];if(!a)return;let l=Object.entries(a.allowed_param_patterns||{});t(l);let i={};l.forEach(([e,t])=>{i[e]=t}),o(e,{allowed_param_patterns:Object.keys(i).length>0?i:void 0})};return(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,l.jsx)(eR.Text,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!a&&(0,l.jsx)(c.Button,{icon:(0,l.jsx)(f.PlusOutlined,{}),type:"primary",onClick:()=>{s({rules:[...r.rules,{id:`rule_${Math.random().toString(36).slice(2,8)}`,decision:"allow",allowed_param_patterns:void 0}]})},className:"!bg-blue-600 !text-white hover:!bg-blue-500",children:"Add Rule"})]}),(0,l.jsx)(eG.Divider,{}),0===r.rules.length?(0,l.jsx)(ez.Empty,{description:"No tool rules added yet"}):(0,l.jsx)("div",{className:"space-y-4",children:r.rules.map((e,t)=>{let m;return(0,l.jsxs)(eM.Card,{className:"bg-gray-50",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,l.jsxs)(eR.Text,{className:"font-semibold",children:["Rule ",t+1]}),(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,type:"text",disabled:a,onClick:()=>{s({rules:r.rules.filter((e,a)=>a!==t)})},children:"Remove"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Rule ID"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"unique_rule_id",value:e.id,onChange:e=>o(t,{id:e.target.value})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^mcp__github_.*$",value:e.tool_name??"",onChange:e=>o(t,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^function$",value:e.tool_type??"",onChange:e=>o(t,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,l.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Decision"}),(0,l.jsxs)(n.Select,{disabled:a,value:e.decision,style:{width:200},onChange:e=>o(t,{decision:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsx)("div",{className:"mt-4",children:0===(m=Object.entries(e.allowed_param_patterns||{})).length?(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),m.map(([r,s],n)=>(0,l.jsxs)(g.Space,{align:"start",children:[(0,l.jsx)(i.Input,{disabled:a,placeholder:"messages[0].content",value:r,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[,t]=e[n];e[n]=[a,t]})}}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^email@.*$",value:s,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[t]=e[n];e[n]=[t,a]})}}),(0,l.jsx)(c.Button,{disabled:a,icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,onClick:()=>d(t,e=>{e.splice(n,1)})})]},`${e.id||t}-${n}`)),(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})})]},e.id||t)})}),(0,l.jsx)(eG.Divider,{}),(0,l.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Default action"}),(0,l.jsxs)(n.Select,{disabled:a,value:r.default_action,onChange:e=>s({default_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(eR.Text,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,l.jsx)(ej.Tooltip,{title:"Block returns an error when a forbidden tool is invoked. Rewrite strips the tool call but lets the rest of the response continue.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})})]}),(0,l.jsxs)(n.Select,{disabled:a,value:r.on_disallowed_action,onChange:e=>s({on_disallowed_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block"}),(0,l.jsx)(n.Select.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,l.jsx)(i.Input.TextArea,{disabled:a,rows:3,placeholder:"This violates our org policy...",value:r.violation_message_template,onChange:e=>s({violation_message_template:e.target.value})})]})]})},{Title:eq,Text:eJ,Link:eU}=d.Typography,{Option:eW}=n.Select,eV={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};e.s(["default",0,({visible:e,onClose:t,accessToken:a,onSuccess:d,preset:g})=>{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(0),[I,A]=(0,m.useState)(null),[O,T]=(0,m.useState)([]),[P,L]=(0,m.useState)(2),[B,F]=(0,m.useState)({}),[$,E]=(0,m.useState)([]),[M,R]=(0,m.useState)([]),[G,z]=(0,m.useState)([]),[D,K]=(0,m.useState)(""),[H,q]=(0,m.useState)(!1),[J,U]=(0,m.useState)(null),[W,V]=(0,m.useState)(""),[Y,Z]=(0,m.useState)(void 0),[X,en]=(0,m.useState)("warn"),[ed,ec]=(0,m.useState)(""),[eu,ep]=(0,m.useState)(!1),[eg,eh]=(0,m.useState)([]),[ef,ej]=(0,m.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),e_=(0,m.useMemo)(()=>!!y&&"tool_permission"===(ea[y]||"").toLowerCase(),[y]);(0,m.useEffect)(()=>{a&&(async()=>{try{let[e,t,l]=await Promise.all([(0,p.getGuardrailUISettings)(a),(0,p.getGuardrailProviderSpecificParams)(a),(0,p.modelAvailableCall)(a,"","").catch(()=>null)]);b(e),A(t),l?.data&&eh(l.data.map(e=>e.id)),ee(t),el(t)}catch(e){console.error("Error fetching guardrail data:",e),u.default.fromBackend("Failed to load guardrail configuration")}})()},[a]),(0,m.useEffect)(()=>{if(!g||!e||!_)return;j(g.provider);let t={provider:g.provider,guardrail_name:g.guardrailNameSuggestion,mode:g.mode,default_on:g.defaultOn,skip_system_message_choice:"inherit"};if("BlockCodeExecution"===g.provider&&(t.confidence_threshold=.5),x.setFieldsValue(t),g.categoryName&&_.content_filter_settings?.content_categories){let e=_.content_filter_settings.content_categories.find(e=>e.name===g.categoryName);e&&z([{id:`category-${Date.now()}`,category:e.name,display_name:e.display_name,action:e.default_action,severity_threshold:"medium"}])}},[g,e,_]);let ev=e=>{j(e);let t={config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0};"BlockCodeExecution"===e&&(t.confidence_threshold=.5),x.setFieldsValue(t),w([]),C({}),T([]),L(2),F({}),E([]),R([]),z([]),K(""),q(!1),U(null),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),"LlmAsAJudge"===e&&x.setFieldsValue({mode:"post_call"})},ew=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eN=(e,t)=>{C(a=>({...a,[e]:t}))},eC=async()=>{try{if(0===S&&(await x.validateFields(["guardrail_name","provider","mode","default_on"]),y)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===y&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await x.validateFields(e)}if(1===S&&er(y)&&0===v.length)return void u.default.fromBackend("Please select at least one PII entity to continue");k(S+1)}catch(e){console.error("Form validation failed:",e)}},eS=()=>{x.resetFields(),j(null),w([]),C({}),T([]),L(2),F({}),E([]),R([]),z([]),K(""),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),V(""),Z(void 0),en("warn"),ec(""),ep(!1),k(0)},ek=()=>{eS(),t()},eI=async()=>{try{f(!0),await x.validateFields();let e=x.getFieldsValue(!0),l=ea[e.provider],r={guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}},i=em(e.skip_system_message_choice);if(void 0!==i&&(r.litellm_params.skip_system_message_in_guardrail=i),"PresidioPII"===e.provider&&v.length>0){let t={};v.forEach(e=>{t[e]=N[e]||"MASK"}),r.litellm_params.pii_entities_config=t,e.presidio_analyzer_api_base&&(r.litellm_params.presidio_analyzer_api_base=e.presidio_analyzer_api_base),e.presidio_anonymizer_api_base&&(r.litellm_params.presidio_anonymizer_api_base=e.presidio_anonymizer_api_base)}if(ei(e.provider)){let e=H&&J?.brand_self?.length>0;if(0===$.length&&0===M.length&&0===G.length&&!e){u.default.fromBackend("Please configure at least one content filter setting (category, pattern, keyword, or competitor intent)"),f(!1);return}$.length>0&&(r.litellm_params.patterns=$.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action}))),M.length>0&&(r.litellm_params.blocked_words=M.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))),G.length>0&&(r.litellm_params.categories=G.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),H&&J?.brand_self?.length>0&&(r.litellm_params.competitor_intent_config={competitor_intent_type:J.competitor_intent_type??"airline",brand_self:J.brand_self,locations:J.locations?.length>0?J.locations:void 0,competitors:"generic"===J.competitor_intent_type&&J.competitors?.length>0?J.competitors:void 0,policy:J.policy,threshold_high:J.threshold_high,threshold_medium:J.threshold_medium,threshold_low:J.threshold_low})}else if(e.config)try{r.guardrail_info=JSON.parse(e.config)}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}if("llm_as_a_judge"===l){let t=e.criteria||[];if(0===t.length){u.default.fromBackend("Add at least one evaluation criterion"),f(!1);return}let a=t.reduce((e,t)=>e+(Number(t?.weight)||0),0);if(100!==a){u.default.fromBackend(`Criterion weights must sum to 100% (currently ${a}%)`),f(!1);return}r.litellm_params.judge_model=e.judge_model,r.litellm_params.overall_threshold=e.overall_threshold??80,r.litellm_params.on_failure=e.on_failure??"block",r.litellm_params.criteria=t.map(e=>({name:e.name,weight:Number(e.weight),description:e.description||""}))}if("tool_permission"===l){if(0===ef.rules.length){u.default.fromBackend("Add at least one tool permission rule"),f(!1);return}r.litellm_params.rules=ef.rules,r.litellm_params.default_action=ef.default_action,r.litellm_params.on_disallowed_action=ef.on_disallowed_action,ef.violation_message_template&&(r.litellm_params.violation_message_template=ef.violation_message_template)}if(ei(e.provider)&&(void 0!==Y&&Y>0&&(r.litellm_params.end_session_after_n_fails=Y),X&&"realtime"===W&&(r.litellm_params.on_violation=X),ed.trim()&&(r.litellm_params.realtime_violation_message=ed.trim())),console.log("values: ",JSON.stringify(e)),I&&y&&"llm_as_a_judge"!==l){let t=ea[y]?.toLowerCase();console.log("providerKey: ",t);let a=I[t]||{},l=new Set;console.log("providerSpecificParams: ",JSON.stringify(a)),Object.keys(a).forEach(e=>{"optional_params"!==e&&l.add(e)}),a.optional_params&&a.optional_params.fields&&Object.keys(a.optional_params.fields).forEach(e=>{l.add(e)}),console.log("allowedParams: ",l),l.forEach(t=>{let a=e[t];(null==a||""===a)&&(a=e.optional_params?.[t]),null!=a&&""!==a&&(r.litellm_params[t]=a)})}if(!a)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(r)),await (0,p.createGuardrailCall)(a,r),u.default.success("Guardrail created successfully"),eS(),d(),t()}catch(e){console.error("Failed to create guardrail:",e),u.default.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}},eA=e=>{if(!_||!ei(y))return null;let t=_.content_filter_settings;return t?(0,l.jsx)(Q,{prebuiltPatterns:t.prebuilt_patterns||[],categories:t.pattern_categories||[],selectedPatterns:$,blockedWords:M,onPatternAdd:e=>E([...$,e]),onPatternRemove:e=>E($.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>{E($.map(a=>a.id===e?{...a,action:t}:a))},onBlockedWordAdd:e=>R([...M,e]),onBlockedWordRemove:e=>R(M.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>{R(M.map(l=>l.id===e?{...l,[t]:a}:l))},contentCategories:t.content_categories||[],selectedContentCategories:G,onContentCategoryAdd:e=>z([...G,e]),onContentCategoryRemove:e=>z(G.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>{z(G.map(l=>l.id===e?{...l,[t]:a}:l))},pendingCategorySelection:D,onPendingCategorySelectionChange:K,accessToken:a,showStep:e,competitorIntentEnabled:H,competitorIntentConfig:J,onCompetitorIntentChange:(e,t)=>{q(e),U(t)}}):null},eO=ei(y)?[{title:"Basic Info",optional:!1},{title:"Topics",optional:!1},{title:"Patterns",optional:!1},{title:"Keywords",optional:!1},{title:"Endpoint Settings (Optional)",optional:!0}]:er(y)?[{title:"Basic Info",optional:!1},{title:"PII Configuration",optional:!1}]:[{title:"Basic Info",optional:!1},{title:"Provider Configuration",optional:!1}];return(0,l.jsx)(s.Modal,{title:null,open:e,onCancel:ek,footer:null,width:1e3,closable:!1,className:"top-8",styles:{body:{padding:0}},children:(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 m-0",children:"Create guardrail"}),(0,l.jsx)("button",{onClick:ek,className:"text-gray-400 hover:text-gray-600 bg-transparent border-none cursor-pointer text-base leading-none p-1",children:"✕"})]}),(0,l.jsx)("div",{className:"overflow-auto px-6 py-4",style:{maxHeight:"calc(80vh - 120px)"},children:(0,l.jsx)(r.Form,{form:x,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1,skip_system_message_choice:"inherit"},children:eO.map((e,t)=>{let s=t{s&&k(t)},style:{minHeight:24},children:[(0,l.jsx)("span",{className:"text-sm",style:{fontWeight:d?600:500,color:d?"#1e293b":s?"#4f46e5":"#94a3b8"},children:e.title}),e.optional&&!d&&(0,l.jsx)("span",{className:"text-[11px] text-slate-400",children:"optional"}),s&&(0,l.jsx)("span",{className:"text-[11px] text-indigo-500 hover:underline",children:"Edit"})]}),d&&(0,l.jsx)("div",{className:"mt-3",children:(()=>{switch(S){case 0:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:ev,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(eW,{value:e,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]}),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{optionLabelProp:"label",mode:"multiple",children:_?.supported_modes?.map(e=>(0,l.jsx)(eW,{value:e,label:e,children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:e}),"pre_call"===e&&(0,l.jsx)(o.Tag,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV[e]})]})},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eW,{value:"pre_call",label:"pre_call",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"pre_call"})," ",(0,l.jsx)(o.Tag,{color:"green",children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.pre_call})]})}),(0,l.jsx)(eW,{value:"during_call",label:"during_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"during_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.during_call})]})}),(0,l.jsx)(eW,{value:"post_call",label:"post_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"post_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.post_call})]})}),(0,l.jsx)(eW,{value:"logging_only",label:"logging_only",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"logging_only"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.logging_only})]})})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: omit role: system from guardrail evaluation input (OpenAI chat + Anthropic messages). The model still receives full messages. Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),!e_&&!ei(y)&&!es(y)&&(0,l.jsx)(ey,{selectedProvider:y,accessToken:a,providerParams:I})]});case 1:if(er(y))return _&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:ew,onActionSelect:eN,entityCategories:_.pii_entity_categories}):null;if(ei(y))return eA("categories");if(es(y))return(0,l.jsx)(eb,{availableModels:eg,form:x});if(!y)return null;if(e_)return(0,l.jsx)(eH,{value:ef,onChange:ej});if(!I)return null;console.log("guardrail_provider_map: ",ea),console.log("selectedProvider: ",y);let e=ea[y]?.toLowerCase(),t=I&&I[e];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null;case 2:if(ei(y))return eA("patterns");return null;case 3:if(ei(y))return eA("keywords");return null;case 4:return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Configure settings for a specific call type. Most guardrails don't need this — skip it unless you're using a specific endpoint like ",(0,l.jsx)("code",{children:"/v1/realtime"}),"."]})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Call type"}),(0,l.jsx)(n.Select,{placeholder:"Select a call type",value:W||void 0,onChange:e=>{V(e),ep(!1)},style:{width:260},allowClear:!0,options:[{value:"realtime",label:"/v1/realtime"}]}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"More call types coming soon."})]}),"realtime"===W&&(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>ep(e=>!e),className:"w-full flex items-center justify-between px-4 py-3 bg-gray-50 hover:bg-gray-100 text-sm font-medium text-gray-700",children:[(0,l.jsx)("span",{children:"/v1/realtime settings"}),(0,l.jsx)("svg",{className:`w-4 h-4 text-gray-500 transition-transform ${eu?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),eu&&(0,l.jsxs)("div",{className:"space-y-5 px-4 py-4 border-t border-gray-200",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"End session after X violations"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Automatically close the session after this many guardrail violations. Leave empty to never auto-close."}),(0,l.jsx)("input",{type:"number",min:1,placeholder:"e.g. 3",value:Y??"",onChange:e=>Z(e.target.value?parseInt(e.target.value,10):void 0),className:"border border-gray-300 rounded px-3 py-1.5 text-sm w-32"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"On violation"}),(0,l.jsx)("div",{className:"space-y-2",children:["warn","end_session"].map(e=>(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"on_violation",value:e,checked:X===e,onChange:()=>en(e),className:"mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"warn"===e?"Warn":"End session"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 m-0",children:"warn"===e?"Bot speaks the message, session continues":"Bot speaks the message, connection closes immediately"})]})]},e))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message the user hears"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"What the bot says aloud when this guardrail fires. Falls back to the default violation message if empty."}),(0,l.jsx)("textarea",{rows:3,placeholder:"e.g. I'm not able to continue this conversation. Please contact us at 1-800-774-2678.",value:ed,onChange:e=>ec(e.target.value),className:"border border-gray-300 rounded px-3 py-2 text-sm w-full resize-none"})]})]})]})]});default:return null}})()})]})]},t)})})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 px-6 py-3 border-t border-gray-200",children:[(0,l.jsx)(c.Button,{onClick:ek,children:"Cancel"}),S>0&&(0,l.jsx)(c.Button,{onClick:()=>{k(S-1)},children:"Previous"}),S{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(g?.provider||null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({});(0,m.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);b(e)}catch(e){console.error("Error fetching guardrail settings:",e),u.default.fromBackend("Failed to load guardrail settings")}})()},[a]),(0,m.useEffect)(()=>{g?.pii_entities_config&&Object.keys(g.pii_entities_config).length>0&&(w(Object.keys(g.pii_entities_config)),C(g.pii_entities_config))},[g]);let S=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},k=(e,t)=>{C(a=>({...a,[e]:t}))},I=async()=>{try{f(!0);let e=await x.validateFields(),l=ea[e.provider],r=c&&"object"==typeof c?{...c}:{};r.guardrail=l,r.mode=e.mode,r.default_on=e.default_on;let i=e.skip_system_message_choice;"yes"===i?r.skip_system_message_in_guardrail=!0:"no"===i?r.skip_system_message_in_guardrail=!1:delete r.skip_system_message_in_guardrail;let s={};if("PresidioPII"===e.provider&&v.length>0){let e={};v.forEach(t=>{e[t]=N[t]||"MASK"}),r.pii_entities_config=e}else if(e.config)try{let t=JSON.parse(e.config);"Bedrock"===e.provider&&t?(t.guardrail_id&&(r.guardrailIdentifier=t.guardrail_id),t.guardrail_version&&(r.guardrailVersion=t.guardrail_version)):s=t}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}let n={guardrail_id:d,guardrail:{guardrail_name:e.guardrail_name,litellm_params:r,guardrail_info:s}};if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(n));let m=`/guardrails/${d}`,g=await fetch(m,{method:"PUT",headers:{[(0,p.getGlobalLitellmHeaderName)()]:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!g.ok){let e=await g.text();throw Error(e||"Failed to update guardrail")}u.default.success("Guardrail updated successfully"),o(),t()}catch(e){console.error("Failed to update guardrail:",e),u.default.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}};return(0,l.jsx)(s.Modal,{title:"Edit Guardrail",open:e,onCancel:t,footer:null,width:700,children:(0,l.jsxs)(r.Form,{form:x,layout:"vertical",initialValues:g,children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(tt.TextInput,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:e=>{j(e),x.setFieldsValue({config:void 0}),w([]),C({})},disabled:!0,optionLabelProp:"label",children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(tr,{value:e,label:t,children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{children:_?.supported_modes?.map(e=>(0,l.jsx)(tr,{value:e,children:e},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tr,{value:"pre_call",children:"pre_call"}),(0,l.jsx)(tr,{value:"post_call",children:"post_call"})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,l.jsx)(D.Switch,{})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: whether role: system content is omitted from guardrail input (LLM still receives full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(tr,{value:"inherit",children:"Use global default"}),(0,l.jsx)(tr,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(tr,{value:"no",children:"No — always include in scan"})]})}),(()=>{if(!y)return null;if("PresidioPII"===y)return _&&y&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:S,onActionSelect:k,entityCategories:_.pii_entity_categories}):null;switch(y){case"Aporia":return(0,l.jsx)(r.Form.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_aporia_api_key",
- "project_name": "your_project_name"
-}`})});case"AimSecurity":return(0,l.jsx)(r.Form.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_aim_api_key"
-}`})});case"Bedrock":return(0,l.jsx)(r.Form.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "guardrail_id": "your_guardrail_id",
- "guardrail_version": "your_guardrail_version"
-}`})});case"GuardrailsAI":return(0,l.jsx)(r.Form.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_guardrails_api_key",
- "guardrail_id": "your_guardrail_id"
-}`})});case"LakeraAI":return(0,l.jsx)(r.Form.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "api_key": "your_lakera_api_key"
-}`})});case"PromptInjection":return(0,l.jsx)(r.Form.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "threshold": 0.8
-}`})});default:return(0,l.jsx)(r.Form.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
- "key1": "value1",
- "key2": "value2"
-}`})})}})(),(0,l.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:I,loading:h,children:"Update Guardrail"})]})]})})};var ts=((a={}).DB="db",a.CONFIG="config",a);e.s(["default",0,({guardrailsList:e,isLoading:t,onDeleteClick:a,accessToken:r,onGuardrailUpdated:i,isAdmin:s=!1,onGuardrailClick:n})=>{let[o,d]=(0,m.useState)([{id:"created_at",desc:!0}]),[c,u]=(0,m.useState)(!1),[p,g]=(0,m.useState)(null),x=e=>e?new Date(e).toLocaleString():"-",h=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,l.jsx)(ej.Tooltip,{title:String(e.getValue()||""),children:(0,l.jsx)(e4.Button,{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 overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?`${String(e.getValue()).slice(0,7)}...`:""})})},{header:"Name",accessorKey:"guardrail_name",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.guardrail_name,children:(0,l.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:({row:e})=>{let{logo:t,displayName:a}=ed(e.original.litellm_params.guardrail);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:`${a} logo`,className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)("span",{className:"text-xs",children:a})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:({row:e})=>{let t=e.original;return(0,l.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(e7.Badge,{color:t.litellm_params?.default_on?"green":"gray",className:"text-xs font-normal",size:"xs",children:t.litellm_params?.default_on?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.created_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.updated_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.updated_at)})})}},{id:"actions",header:"Actions",cell:({row:e})=>{let t=e.original,r=t.guardrail_definition_location===ts.CONFIG;return(0,l.jsx)("div",{className:"flex space-x-2",children:r?(0,l.jsx)(ej.Tooltip,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,l.jsx)(e2.Icon,{"data-testid":"config-delete-icon",icon:e5.TrashIcon,size:"sm",className:"cursor-not-allowed text-gray-400",title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.","aria-label":"Delete guardrail (config)"})}):(0,l.jsx)(ej.Tooltip,{title:"Delete guardrail",children:(0,l.jsx)(e2.Icon,{icon:e5.TrashIcon,size:"sm",onClick:()=>t.guardrail_id&&a(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],f=(0,e9.useReactTable)({data:e,columns:h,state:{sorting:o},onSortingChange:d,getCoreRowModel:(0,te.getCoreRowModel)(),getSortedRowModel:(0,te.getSortedRowModel)(),enableSorting:!0});return(0,l.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)(eY.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,l.jsx)(eX.TableHead,{children:f.getHeaderGroups().map(e=>(0,l.jsx)(e1.TableRow,{children:e.headers.map(e=>(0,l.jsx)(e0.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,e9.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,l.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,l.jsx)(e8.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,l.jsx)(e3.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,l.jsx)(e6.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,l.jsx)(eQ.TableBody,{children:t?(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eZ.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"Loading..."})})})}):e.length>0?f.getRowModel().rows.map(e=>(0,l.jsx)(e1.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,l.jsx)(eZ.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,e9.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eZ.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"No guardrails found"})})})})})]})}),p&&(0,l.jsx)(ti,{visible:c,onClose:()=>u(!1),accessToken:r,onSuccess:()=>{u(!1),g(null),i()},guardrailId:p.guardrail_id||"",fullLitellmParams:p.litellm_params,initialValues:{guardrail_name:p.guardrail_name||"",provider:Object.keys(ea).find(e=>ea[e]===p?.litellm_params.guardrail)||"",mode:p.litellm_params.mode,default_on:p.litellm_params.default_on,pii_entities_config:p.litellm_params.pii_entities_config,skip_system_message_choice:ec(p.litellm_params?.skip_system_message_in_guardrail),...p.guardrail_info}})]})}],782719);var tn=e.i(500330),to=e.i(245094),eN=eN,td=e.i(530212),tc=e.i(350967),tm=e.i(197647),tu=e.i(653824),tp=e.i(881073),tg=e.i(404206),tx=e.i(723731),th=e.i(629569),tf=e.i(678784),ty=e.i(118366),tj=e.i(560445);let{Text:t_}=d.Typography,{Option:tb}=n.Select,tv=({categories:e,onActionChange:t,onSeverityChange:a,onRemove:r,readOnly:i=!1})=>{let s=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(t_,{strong:!0,children:e}),e!==t.category&&(0,l.jsx)("div",{children:(0,l.jsx)(t_,{type:"secondary",style:{fontSize:12},children:t.category})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>i?(0,l.jsx)(o.Tag,{color:{high:"red",medium:"orange",low:"yellow"}[e],children:e.toUpperCase()}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>a?.(t.id,e),style:{width:150},size:"small",children:[(0,l.jsx)(tb,{value:"high",children:"High"}),(0,l.jsx)(tb,{value:"medium",children:"Medium"}),(0,l.jsx)(tb,{value:"low",children:"Low"})]})},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>i?(0,l.jsx)(o.Tag,{color:"BLOCK"===e?"red":"blue",children:e}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>t?.(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(tb,{value:"BLOCK",children:"Block"}),(0,l.jsx)(tb,{value:"MASK",children:"Mask"})]})}];return(i||s.push({title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r?.(t.id),children:"Delete"})}),0===e.length)?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No categories configured."}):(0,l.jsx)(I.Table,{dataSource:e,columns:s,rowKey:"id",pagination:!1,size:"small"})},tw=({patterns:e,blockedWords:t,categories:a=[],readOnly:r=!0,onPatternActionChange:i,onPatternRemove:s,onBlockedWordUpdate:n,onBlockedWordRemove:o,onCategoryActionChange:d,onCategorySeverityChange:c,onCategoryRemove:m})=>{if(0===e.length&&0===t.length&&0===a.length)return null;let u=()=>{};return(0,l.jsxs)(l.Fragment,{children:[a.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Content Categories"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[a.length," categories configured"]})]}),(0,l.jsx)(tv,{categories:a,onActionChange:r?void 0:d,onSeverityChange:r?void 0:c,onRemove:r?void 0:m,readOnly:r})]}),e.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[e.length," patterns configured"]})]}),(0,l.jsx)(P,{patterns:e,onActionChange:r?u:i||u,onRemove:r?u:s||u})]}),t.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[t.length," keywords configured"]})]}),(0,l.jsx)(F,{keywords:t,onActionChange:r?u:n||u,onRemove:r?u:o||u})]})]})},{Text:tN}=d.Typography,tC=({guardrailData:e,guardrailSettings:t,isEditing:a,accessToken:r,onDataChange:i,onUnsavedChanges:s})=>{let[n,o]=(0,m.useState)([]),[d,c]=(0,m.useState)([]),[u,p]=(0,m.useState)([]),[g,x]=(0,m.useState)([]),[h,f]=(0,m.useState)([]),[y,j]=(0,m.useState)([]),[_,b]=(0,m.useState)(!1),[v,w]=(0,m.useState)(null),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(e?.litellm_params?.patterns){let t=e.litellm_params.patterns.map((e,t)=>({id:`pattern-${t}`,type:"prebuilt"===e.pattern_type?"prebuilt":"custom",name:e.pattern_name||e.name,display_name:e.display_name,pattern:e.pattern,action:e.action||"BLOCK"}));o(t),x(t)}else o([]),x([]);if(e?.litellm_params?.blocked_words){let t=e.litellm_params.blocked_words.map((e,t)=>({id:`word-${t}`,keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));c(t),f(t)}else c([]),f([]);if(e?.litellm_params?.categories?.length>0){let a=t?.content_filter_settings?.content_categories?Object.fromEntries(t.content_filter_settings.content_categories.map(e=>[e.name,e])):{},l=e.litellm_params.categories.map((e,t)=>{let l=a[e.category];return{id:`category-${t}`,category:e.category,display_name:l?.display_name??e.category,action:e.action||"BLOCK",severity_threshold:e.severity_threshold||"medium"}});p(l),j(l)}else p([]),j([]);let a=e?.litellm_params?.competitor_intent_config;if(a&&"object"==typeof a){let e=!!(a.brand_self&&Array.isArray(a.brand_self)&&a.brand_self.length>0),t={competitor_intent_type:a.competitor_intent_type??"airline",brand_self:Array.isArray(a.brand_self)?a.brand_self:[],locations:Array.isArray(a.locations)?a.locations:[],competitors:Array.isArray(a.competitors)?a.competitors:[],policy:a.policy??{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:"number"==typeof a.threshold_high?a.threshold_high:.7,threshold_medium:"number"==typeof a.threshold_medium?a.threshold_medium:.45,threshold_low:"number"==typeof a.threshold_low?a.threshold_low:.3};b(e),w(t),C(e),k(t)}else b(!1),w(null),C(!1),k(null)},[e,t?.content_filter_settings?.content_categories]),(0,m.useEffect)(()=>{i&&i(n,d,u,_,v)},[n,d,u,_,v,i]);let I=m.default.useMemo(()=>{let e=JSON.stringify(n)!==JSON.stringify(g),t=JSON.stringify(d)!==JSON.stringify(h),a=JSON.stringify(u)!==JSON.stringify(y),l=_!==N||JSON.stringify(v)!==JSON.stringify(S);return e||t||a||l},[n,d,u,_,v,g,h,y,N,S]);return((0,m.useEffect)(()=>{a&&s&&s(I)},[I,a,s]),e?.litellm_params?.guardrail!=="litellm_content_filter")?null:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"Content Filter Configuration"}),I&&(0,l.jsx)(tj.Alert,{type:"warning",showIcon:!0,className:"mb-4",message:(0,l.jsx)(tN,{children:'You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,l.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,l.jsx)(Q,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:n,blockedWords:d,onPatternAdd:e=>o([...n,e]),onPatternRemove:e=>o(n.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>o(n.map(a=>a.id===e?{...a,action:t}:a)),onBlockedWordAdd:e=>c([...d,e]),onBlockedWordRemove:e=>c(d.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>c(d.map(l=>l.id===e?{...l,[t]:a}:l)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r,contentCategories:t.content_filter_settings.content_categories||[],selectedContentCategories:u,onContentCategoryAdd:e=>p([...u,e]),onContentCategoryRemove:e=>p(u.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>p(u.map(l=>l.id===e?{...l,[t]:a}:l)),competitorIntentEnabled:_,competitorIntentConfig:v,onCompetitorIntentChange:(e,t)=>{b(e),w(t)}})})]}):(0,l.jsx)(tw,{patterns:n,blockedWords:d,categories:u,readOnly:!0})};var tS=e.i(788191),tk=e.i(245704),tI=e.i(518617);let tA={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};var tO=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tA}))}),tT=e.i(987432);let tP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M892 772h-80v-80c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v80h-80c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h80v80c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-80h80c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM373.5 498.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.8-1.7-203.2 89.2-203.2 200 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.8-1.1 6.4-4.8 5.9-8.8zM824 472c0-109.4-87.9-198.3-196.9-200C516.3 270.3 424 361.2 424 472c0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C357 742.6 326 814.8 324 891.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.5C505.8 695.7 563 672 624 672c110.4 0 200-89.5 200-200zm-109.5 90.5C690.3 586.7 658.2 600 624 600s-66.3-13.3-90.5-37.5a127.26 127.26 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-.1 34.2-13.4 66.3-37.6 90.5z"}}]},name:"usergroup-add",theme:"outlined"};var tL=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tP}))}),tB=e.i(872934);let{Panel:tF}=$.Collapse,{TextArea:t$}=i.Input,tE={empty:{name:"Empty Template",code:`async def apply_guardrail(inputs, request_data, input_type):
- # inputs: {texts, images, tools, tool_calls, structured_messages, model}
- # request_data: {model, user_id, team_id, end_user_id, metadata}
- # input_type: "request" or "response"
- return allow()`},blockSSN:{name:"Block SSN",code:`def apply_guardrail(inputs, request_data, input_type):
- for text in inputs["texts"]:
- if regex_match(text, r"\\d{3}-\\d{2}-\\d{4}"):
- return block("SSN detected")
- return allow()`},redactEmail:{name:"Redact Emails",code:`def apply_guardrail(inputs, request_data, input_type):
- pattern = r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
- modified = []
- for text in inputs["texts"]:
- modified.append(regex_replace(text, pattern, "[EMAIL REDACTED]"))
- return modify(texts=modified)`},blockSQL:{name:"Block SQL Injection",code:`def apply_guardrail(inputs, request_data, input_type):
- if input_type != "request":
- return allow()
- for text in inputs["texts"]:
- if contains_code_language(text, ["sql"]):
- return block("SQL code not allowed")
- return allow()`},validateJSON:{name:"Validate JSON",code:`def apply_guardrail(inputs, request_data, input_type):
- if input_type != "response":
- return allow()
-
- schema = {"type": "object", "required": ["name", "value"]}
-
- for text in inputs["texts"]:
- obj = json_parse(text)
- if obj is None:
- return block("Invalid JSON response")
- if not json_schema_valid(obj, schema):
- return block("Response missing required fields")
- return allow()`},externalAPI:{name:"External API Check (async)",code:`async def apply_guardrail(inputs, request_data, input_type):
- # Call an external moderation API (async for non-blocking)
- for text in inputs["texts"]:
- response = await http_post(
- "https://api.example.com/moderate",
- body={"text": text, "user_id": request_data["user_id"]},
- headers={"Authorization": "Bearer YOUR_API_KEY"},
- timeout=10
- )
-
- if not response["success"]:
- # API call failed, allow by default or block
- return allow()
-
- if response["body"].get("flagged"):
- return block(response["body"].get("reason", "Content flagged"))
-
- return allow()`}},tM={"Return Values":[{name:"allow()",desc:"Let request/response through"},{name:"block(reason)",desc:"Reject with message"},{name:"modify(texts=[], images=[], tool_calls=[])",desc:"Transform content"}],"HTTP Requests (async)":[{name:"await http_request(url, method, headers, body)",desc:"Make async HTTP request"},{name:"await http_get(url, headers)",desc:"Async GET request"},{name:"await http_post(url, body, headers)",desc:"Async POST request"}],"Regex Functions":[{name:"regex_match(text, pattern)",desc:"Returns True if pattern found"},{name:"regex_replace(text, pattern, replacement)",desc:"Replace all matches"},{name:"regex_find_all(text, pattern)",desc:"Return list of matches"}],"JSON Functions":[{name:"json_parse(text)",desc:"Parse JSON string, returns None on error"},{name:"json_stringify(obj)",desc:"Convert to JSON string"},{name:"json_schema_valid(obj, schema)",desc:"Validate against JSON schema"}],"URL Functions":[{name:"extract_urls(text)",desc:"Extract all URLs from text"},{name:"is_valid_url(url)",desc:"Check if URL is valid"},{name:"all_urls_valid(text)",desc:"Check all URLs in text are valid"}],"Code Detection":[{name:"detect_code(text)",desc:"Returns True if code detected"},{name:"detect_code_languages(text)",desc:"Returns list of detected languages"},{name:'contains_code_language(text, ["sql"])',desc:"Check for specific languages"}],"Text Utilities":[{name:"contains(text, substring)",desc:"Check if substring exists"},{name:"contains_any(text, [substr1, substr2])",desc:"Check if any substring exists"},{name:"word_count(text)",desc:"Count words"},{name:"char_count(text)",desc:"Count characters"},{name:"lower(text) / upper(text) / trim(text)",desc:"String transforms"}]},tR=[{value:"pre_call",label:"pre_call (Request)"},{value:"post_call",label:"post_call (Response)"},{value:"during_call",label:"during_call (Parallel)"},{value:"logging_only",label:"logging_only"},{value:"pre_mcp_call",label:"pre_mcp_call (Before MCP Tool Call)"},{value:"post_mcp_call",label:"post_mcp_call (After MCP Tool Call)"},{value:"during_mcp_call",label:"during_mcp_call (During MCP Tool Call)"}],tG=({visible:e,onClose:t,onSuccess:a,accessToken:r,editData:i})=>{let o=!!i,[d,c]=(0,m.useState)(""),[g,x]=(0,m.useState)(["pre_call"]),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)("empty"),[_,b]=(0,m.useState)(tE.empty.code),[v,w]=(0,m.useState)(!1),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(!1),I={texts:["Hello, my SSN is 123-45-6789"],images:[],tools:[{type:"function",function:{name:"get_weather",description:"Get the current weather in a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"}},required:["location"]}}}],tool_calls:[],structured_messages:[{role:"system",content:"You are a helpful assistant."},{role:"user",content:"Hello, my SSN is 123-45-6789"}],model:"gpt-4"},A={texts:["The weather in San Francisco is 72°F and sunny."],images:[],tools:[],tool_calls:[{id:"call_abc123",type:"function",function:{name:"get_weather",arguments:'{"location": "San Francisco"}'}}],structured_messages:[],model:"gpt-4"},O={texts:['Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'],images:[],tools:[{type:"function",function:{name:"read_wiki_structure",description:"Read the structure of a GitHub repository (MCP tool passed as OpenAI tool)",parameters:{type:"object",properties:{repoName:{type:"string",description:"Repository name, e.g. BerriAI/litellm"}},required:["repoName"]}}}],tool_calls:[{id:"call_mcp_001",type:"function",function:{name:"read_wiki_structure",arguments:'{"repoName": "BerriAI/litellm"}'}}],structured_messages:[{role:"user",content:'Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'}],model:"mcp-tool-call"},[T,P]=(0,m.useState)(JSON.stringify(I,null,2)),[L,B]=(0,m.useState)(null),[F,E]=(0,m.useState)(null),M=(0,m.useRef)(null),R=e=>null==e?["pre_call"]:Array.isArray(e)?e.length?e:["pre_call"]:[e];(0,m.useEffect)(()=>{e&&(i?(c(i.guardrail_name||""),x(R(i.litellm_params?.mode)),f(i.litellm_params?.default_on||!1),b(i.litellm_params?.custom_code||tE.empty.code),j("")):(c(""),x(["pre_call"]),f(!1),j("empty"),b(tE.empty.code)),B(null),k(!1))},[e,i]);let G=async e=>{try{await navigator.clipboard.writeText(e),E(e),setTimeout(()=>E(null),2e3)}catch(e){console.error("Failed to copy:",e)}},z=async()=>{if(!d.trim())return void u.default.fromBackend("Please enter a guardrail name");if(!_.trim())return void u.default.fromBackend("Please enter custom code");if(!r)return void u.default.fromBackend("No access token available");w(!0);try{if(o&&i){let e={litellm_params:{custom_code:_}};d!==i.guardrail_name&&(e.guardrail_name=d);let t=R(i.litellm_params?.mode);(g.length!==t.length||g.some((e,a)=>e!==t[a]))&&(e.litellm_params.mode=g),h!==i.litellm_params?.default_on&&(e.litellm_params.default_on=h),await (0,p.updateGuardrailCall)(r,i.guardrail_id,e),u.default.success("Custom code guardrail updated successfully")}else await (0,p.createGuardrailCall)(r,{guardrail_name:d,litellm_params:{guardrail:"custom_code",mode:g,default_on:h,custom_code:_},guardrail_info:{}}),u.default.success("Custom code guardrail created successfully");a(),t()}catch(e){console.error("Failed to save guardrail:",e),u.default.fromBackend(`Failed to ${o?"update":"create"} guardrail: `+(e instanceof Error?e.message:String(e)))}finally{w(!1)}},K=async()=>{if(!r)return void B({error:"No access token available"});C(!0),B(null);try{let e;try{e=JSON.parse(T)}catch(e){B({error:"Invalid test input JSON"}),C(!1);return}e.texts||(e.texts=[]);let t=["pre_call","pre_mcp_call"],a=["post_call","post_mcp_call"],l=g.some(e=>t.includes(e))?"request":g.some(e=>a.includes(e))?"response":"request",i=await (0,p.testCustomCodeGuardrail)(r,{custom_code:_,test_input:e,input_type:l,request_data:{model:"test-model",metadata:{}}});i.success&&i.result?B(i.result):i.error?B({error:i.error,error_type:i.error_type}):B({error:"Unknown error occurred"})}catch(e){console.error("Failed to test custom code:",e),B({error:e instanceof Error?e.message:"Failed to test custom code"})}finally{C(!1)}},H=_.split("\n").length;return(0,l.jsxs)(s.Modal,{open:e,onCancel:t,footer:null,width:1400,className:"custom-code-modal",closable:!0,destroyOnClose:!0,children:[(0,l.jsxs)("div",{className:"flex flex-col h-[80vh]",children:[(0,l.jsxs)("div",{className:"pb-4 border-b border-gray-200",children:[(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:o?"Edit Custom Guardrail":"Create Custom Guardrail"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Define custom logic using Python-like syntax"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4 py-4 border-b border-gray-100",children:[(0,l.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Guardrail Name"}),(0,l.jsx)(tt.TextInput,{value:d,onValueChange:c,placeholder:"e.g., block-pii-custom"})]}),(0,l.jsxs)("div",{className:"w-[280px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Mode (can select multiple)"}),(0,l.jsx)(n.Select,{mode:"multiple",value:g,onChange:x,options:tR,className:"w-full",size:"middle",placeholder:"Select modes"})]}),(0,l.jsxs)("div",{className:"w-[180px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Template"}),(0,l.jsx)(n.Select,{value:y,onChange:e=>{j(e),b(tE[e].code)},className:"w-full",size:"middle",dropdownRender:e=>(0,l.jsxs)(l.Fragment,{children:[e,(0,l.jsx)(eG.Divider,{style:{margin:"8px 0"}}),(0,l.jsxs)("div",{style:{padding:"8px 12px",cursor:"pointer",color:"#1890ff",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},onClick:e=>{e.preventDefault(),window.open("https://models.litellm.ai/guardrails","_blank")},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f0f0f0"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,l.jsx)(tL,{}),(0,l.jsx)("span",{children:"Browse Community templates"}),(0,l.jsx)(tB.ExportOutlined,{style:{fontSize:"10px"}})]})]}),children:(0,l.jsx)(n.Select.OptGroup,{label:"STANDARD",children:Object.entries(tE).map(([e,t])=>(0,l.jsx)(n.Select.Option,{value:e,children:t.name},e))})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pt-5",children:[(0,l.jsx)("span",{className:"text-sm text-gray-600",children:"Default On"}),(0,l.jsx)(D.Switch,{checked:h,onChange:f})]})]}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-hidden mt-4 gap-6",children:[(0,l.jsxs)("div",{className:"flex-[2] flex flex-col min-w-0 overflow-y-auto",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2 flex-shrink-0",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Python Logic"}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Restricted environment (no imports)"})]}),(0,l.jsxs)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e] flex-shrink-0",style:{minHeight:"300px",maxHeight:"400px"},children:[(0,l.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-12 bg-[#1e1e1e] border-r border-gray-700 text-right pr-3 pt-3 select-none overflow-hidden",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6"},children:Array.from({length:Math.max(H,20)},(e,t)=>(0,l.jsx)("div",{className:"text-gray-500 h-[22.4px]",children:t+1},t+1))}),(0,l.jsx)("textarea",{ref:M,value:_,onChange:e=>b(e.target.value),onKeyDown:e=>{if("Tab"===e.key){e.preventDefault();let t=e.currentTarget,a=t.selectionStart,l=t.selectionEnd;b(_.substring(0,a)+" "+_.substring(l)),setTimeout(()=>{t.selectionStart=t.selectionEnd=a+4},0)}},spellCheck:!1,className:"w-full h-full pl-14 pr-4 pt-3 pb-3 resize-none focus:outline-none bg-transparent text-gray-200",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6",tabSize:4}})]}),(0,l.jsx)($.Collapse,{activeKey:S?["test"]:[],onChange:e=>k(e.includes("test")),className:"mt-3 bg-white border border-gray-200 rounded-lg flex-shrink-0",expandIcon:({isActive:e})=>(0,l.jsx)(tO,{rotate:90*!!e}),children:(0,l.jsx)(tF,{header:(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,l.jsx)(tS.PlayCircleOutlined,{className:"text-blue-500"}),"Test Your Guardrail"]}),children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600",children:"Test Input (JSON)"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs text-gray-500",children:"Load example:"}),(0,l.jsx)("button",{type:"button",onClick:()=>P(JSON.stringify(I,null,2)),className:"px-2 py-1 text-xs rounded border border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 transition-colors",children:"Pre-call"}),(0,l.jsx)("button",{type:"button",onClick:()=>P(JSON.stringify(O,null,2)),className:"px-2 py-1 text-xs rounded border border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 transition-colors",children:"Pre MCP"}),(0,l.jsx)("button",{type:"button",onClick:()=>P(JSON.stringify(A,null,2)),className:"px-2 py-1 text-xs rounded border border-green-200 bg-green-50 text-green-700 hover:bg-green-100 transition-colors",children:"Post-call"})]})]}),(0,l.jsx)("div",{className:"mb-2 p-2 bg-gray-50 rounded text-xs text-gray-600 border border-gray-200",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"texts"}),": Message content (always)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"images"}),": Base64 images (vision)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tools"}),": Tool definitions ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"}),", MCP as OpenAI tool ",(0,l.jsx)("span",{className:"text-purple-600",children:"(pre_mcp_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tool_calls"}),": LLM tool calls ",(0,l.jsx)("span",{className:"text-green-600",children:"(post_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"structured_messages"}),": Full messages ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"model"}),": Model name (always)"]})]})}),(0,l.jsx)(t$,{value:T,onChange:e=>P(e.target.value),rows:8,className:"font-mono text-xs",placeholder:'{"texts": ["test message"], ...}'})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{size:"xs",onClick:K,disabled:N,icon:tS.PlayCircleOutlined,children:N?"Running...":"Run Test"}),L&&(0,l.jsx)("div",{className:`flex items-center gap-2 text-sm ${L.error?"text-red-600":"allow"===L.action?"text-green-600":"block"===L.action?"text-orange-600":"text-blue-600"}`,children:L.error?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{}),(0,l.jsxs)("span",{children:[L.error_type&&(0,l.jsxs)("span",{className:"font-medium",children:["[",L.error_type,"] "]}),L.error]})]}):"allow"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Allowed"]}):"block"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{})," Blocked: ",L.reason]}):"modify"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Modified",L.texts&&L.texts.length>0&&(0,l.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:["→ ",L.texts[0].substring(0,50),L.texts[0].length>50?"...":""]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," ",L.action||"Unknown"]})})]})]})},"test")}),(0,l.jsxs)("div",{className:"mt-3 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-lg flex items-center justify-between flex-shrink-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"bg-blue-100 rounded-full p-2",children:(0,l.jsx)(tL,{className:"text-blue-600 text-lg"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Built a useful guardrail?"}),(0,l.jsx)("div",{className:"text-xs text-gray-600",children:"Share it with the community and help others build faster"})]})]}),(0,l.jsx)(e4.Button,{size:"xs",onClick:()=>window.open("https://github.com/BerriAI/litellm-guardrails","_blank"),icon:tB.ExportOutlined,className:"bg-blue-600 hover:bg-blue-700 text-white border-0",children:"Contribute Template"})]})]}),(0,l.jsxs)("div",{className:"w-[300px] flex-shrink-0 overflow-auto border-l border-gray-200 pl-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)("span",{className:"font-semibold text-gray-700",children:"Available Primitives"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Click to copy functions to clipboard"}),(0,l.jsx)($.Collapse,{defaultActiveKey:["Return Values"],className:"primitives-collapse bg-transparent border-0",expandIconPosition:"end",children:Object.entries(tM).map(([e,t])=>(0,l.jsx)(tF,{header:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e}),className:"bg-white mb-2 rounded-lg border border-gray-200",children:(0,l.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,l.jsx)("button",{onClick:()=>G(e.name),className:`w-full text-left px-2 py-2 rounded transition-colors ${F===e.name?"bg-green-100":"bg-gray-50 hover:bg-blue-50"}`,children:F===e.name?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-mono text-green-700",children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Copied!"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-xs font-mono text-gray-800",children:e.name}),(0,l.jsx)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:e.desc})]})},e.name))})},e))})]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-gray-200",children:[(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Changes are auto-saved to local draft"}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:z,loading:v,disabled:v||!d.trim(),icon:tT.SaveOutlined,children:o?"Update Guardrail":"Save Guardrail"})]})]})]}),(0,l.jsx)("style",{children:`
- .custom-code-modal .ant-modal-content {
- padding: 24px;
- }
- .custom-code-modal .ant-modal-close {
- top: 20px;
- right: 20px;
- }
- .primitives-collapse .ant-collapse-item {
- border: none !important;
- }
- .primitives-collapse .ant-collapse-header {
- padding: 8px 12px !important;
- }
- .primitives-collapse .ant-collapse-content-box {
- padding: 8px 12px !important;
- }
- `})]})};e.s(["default",0,({guardrailId:e,onClose:t,accessToken:a,isAdmin:s})=>{let o,[d,g]=(0,m.useState)(null),[x,h]=(0,m.useState)(null),[f,y]=(0,m.useState)(!0),[j,_]=(0,m.useState)(!1),[b]=r.Form.useForm(),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(null),[I,A]=(0,m.useState)({}),[O,T]=(0,m.useState)(!1),P={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[L,B]=(0,m.useState)(P),[F,$]=(0,m.useState)(!1),[E,M]=(0,m.useState)(!1),R=m.default.useRef({patterns:[],blockedWords:[],categories:[]}),G=(0,m.useCallback)((e,t,a,l,r)=>{R.current={patterns:e,blockedWords:t,categories:a||[],competitorIntentEnabled:l,competitorIntentConfig:r}},[]),z=async()=>{try{if(y(!0),!a)return;let t=await (0,p.getGuardrailInfo)(a,e);if(g(t),t.litellm_params?.pii_entities_config){let e=t.litellm_params.pii_entities_config;if(w([]),C({}),Object.keys(e).length>0){let t=[],a={};Object.entries(e).forEach(([e,l])=>{t.push(e),a[e]="string"==typeof l?l:"MASK"}),w(t),C(a)}}else w([]),C({})}catch(e){u.default.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{y(!1)}},D=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailProviderSpecificParams)(a);h(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},K=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);k(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,m.useEffect)(()=>{D()},[a]),(0,m.useEffect)(()=>{z(),K()},[e,a]),(0,m.useEffect)(()=>{if(d&&b){let e={...d.litellm_params||{}};delete e.skip_system_message_in_guardrail,b.setFieldsValue({guardrail_name:d.guardrail_name,...e,skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}})}},[d,x,b]);let H=(0,m.useCallback)(()=>{d?.litellm_params?.guardrail==="tool_permission"?B({rules:d.litellm_params?.rules||[],default_action:(d.litellm_params?.default_action||"deny").toLowerCase(),on_disallowed_action:(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),violation_message_template:d.litellm_params?.violation_message_template||""}):B(P),$(!1)},[d]);(0,m.useEffect)(()=>{H()},[H]);let q=async t=>{try{if(!a)return;let o={litellm_params:{}};t.guardrail_name!==d.guardrail_name&&(o.guardrail_name=t.guardrail_name),t.default_on!==d.litellm_params?.default_on&&(o.litellm_params.default_on=t.default_on);let c=ec(d.litellm_params?.skip_system_message_in_guardrail),m=t.skip_system_message_choice;void 0!==m&&m!==c&&("inherit"===m?o.litellm_params.skip_system_message_in_guardrail=null:"yes"===m?o.litellm_params.skip_system_message_in_guardrail=!0:o.litellm_params.skip_system_message_in_guardrail=!1);let g=d.guardrail_info,h=t.guardrail_info?JSON.parse(t.guardrail_info):void 0;JSON.stringify(g)!==JSON.stringify(h)&&(o.guardrail_info=h);let f=d.litellm_params?.pii_entities_config||{},y={};if(v.forEach(e=>{y[e]=N[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(y)&&(o.litellm_params.pii_entities_config=y),d.litellm_params?.guardrail==="litellm_content_filter"&&O){var l,r,i,s,n;let e,t=(l=R.current.patterns||[],r=R.current.blockedWords||[],i=R.current.categories||[],s=R.current.competitorIntentEnabled,n=R.current.competitorIntentConfig,e={patterns:l.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action})),blocked_words:r.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))},void 0!==i&&(e.categories=i.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),s&&n&&n.brand_self.length>0&&(e.competitor_intent_config={competitor_intent_type:n.competitor_intent_type,brand_self:n.brand_self,locations:n.locations?.length?n.locations:void 0,competitors:"generic"===n.competitor_intent_type&&n.competitors?.length?n.competitors:void 0,policy:n.policy,threshold_high:n.threshold_high,threshold_medium:n.threshold_medium,threshold_low:n.threshold_low}),e);o.litellm_params.patterns=t.patterns,o.litellm_params.blocked_words=t.blocked_words,o.litellm_params.categories=t.categories,o.litellm_params.competitor_intent_config=t.competitor_intent_config??null}if(d.litellm_params?.guardrail==="tool_permission"){let e=d.litellm_params?.rules||[],t=L.rules||[],a=JSON.stringify(e)!==JSON.stringify(t),l=(d.litellm_params?.default_action||"deny").toLowerCase(),r=(L.default_action||"deny").toLowerCase(),i=l!==r,s=(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),n=(L.on_disallowed_action||"block").toLowerCase(),c=s!==n,m=d.litellm_params?.violation_message_template||"",u=L.violation_message_template||"",p=m!==u;(F||a||i||c||p)&&(o.litellm_params.rules=t,o.litellm_params.default_action=r,o.litellm_params.on_disallowed_action=n,o.litellm_params.violation_message_template=u||null)}let j=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);console.log("values: ",JSON.stringify(t)),console.log("currentProvider: ",j);let b=d.litellm_params?.guardrail==="tool_permission";if(x&&j&&!b){let e=x[ea[j]?.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(e)),Object.keys(e).forEach(e=>{"optional_params"!==e&&a.add(e)}),e.optional_params&&e.optional_params.fields&&Object.keys(e.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{if("patterns"===e||"blocked_words"===e||"categories"===e)return;let a=t[e];(null==a||""===a)&&(a=t.optional_params?.[e]);let l=d.litellm_params?.[e];JSON.stringify(a)!==JSON.stringify(l)&&(null!=a&&""!==a?o.litellm_params[e]=a:null!=l&&""!==l&&(o.litellm_params[e]=null))})}if(0===Object.keys(o.litellm_params).length&&delete o.litellm_params,0===Object.keys(o).length){u.default.info("No changes detected"),_(!1);return}await (0,p.updateGuardrailCall)(a,e,o),u.default.success("Guardrail updated successfully"),T(!1),z(),_(!1)}catch(e){console.error("Error updating guardrail:",e),u.default.fromBackend("Failed to update guardrail")}};if(f)return(0,l.jsx)("div",{className:"p-4",children:"Loading..."});if(!d)return(0,l.jsx)("div",{className:"p-4",children:"Guardrail not found"});let J=e=>e?new Date(e).toLocaleString():"-",{logo:U,displayName:W}=ed(d.litellm_params?.guardrail||""),V=async(e,t)=>{await (0,tn.copyToClipboard)(e)&&(A(e=>({...e,[t]:!0})),setTimeout(()=>{A(e=>({...e,[t]:!1}))},2e3))},Y="config"===d.guardrail_definition_location;return(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Button,{type:"text",icon:(0,l.jsx)(td.ArrowLeftIcon,{className:"w-4 h-4"}),onClick:t,className:"mb-4",children:"Back to Guardrails"}),(0,l.jsx)(th.Title,{children:d.guardrail_name||"Unnamed Guardrail"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(eR.Text,{className:"text-gray-500 font-mono",children:d.guardrail_id}),(0,l.jsx)(c.Button,{type:"text",size:"small",icon:I["guardrail-id"]?(0,l.jsx)(tf.CheckIcon,{size:12}):(0,l.jsx)(ty.CopyIcon,{size:12}),onClick:()=>V(d.guardrail_id,"guardrail-id"),className:`left-2 z-10 transition-all duration-200 ${I["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,l.jsxs)(tu.TabGroup,{children:[(0,l.jsxs)(tp.TabList,{className:"mb-4",children:[(0,l.jsx)(tm.Tab,{children:"Overview"},"overview"),s?(0,l.jsx)(tm.Tab,{children:"Settings"},"settings"):(0,l.jsx)(l.Fragment,{})]}),(0,l.jsxs)(tx.TabPanels,{children:[(0,l.jsxs)(tg.TabPanel,{children:[(0,l.jsxs)(tc.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Provider"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[U&&(0,l.jsx)("img",{src:U,alt:`${W} logo`,className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)(th.Title,{children:W})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Mode"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:d.litellm_params?.mode||"-"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Default On":"Default Off"})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Created At"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:J(d.created_at)}),(0,l.jsxs)(eR.Text,{children:["Last Updated: ",J(d.updated_at)]})]})]})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsx)(eR.Text,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(d.litellm_params?.pii_entities_config).map(([e,t])=>(0,l.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-medium text-gray-900",children:e}),(0,l.jsx)(eR.Text,{className:"flex-1",children:(0,l.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${"MASK"===t?"text-blue-600":"text-red-600"}`,children:["MASK"===t?(0,l.jsx)(eN.default,{}):(0,l.jsx)(eC.StopOutlined,{}),String(t)]})})]},e))})]})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsx)(eH,{value:L,disabled:!0})}),d.litellm_params?.guardrail==="custom_code"&&d.litellm_params?.custom_code&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)(eR.Text,{className:"font-medium text-lg",children:"Custom Code"})]}),s&&!Y&&(0,l.jsx)(c.Button,{size:"small",icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"})]}),(0,l.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e]",children:(0,l.jsx)("pre",{className:"p-4 text-sm text-gray-200 overflow-x-auto",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace"},children:(0,l.jsx)("code",{children:d.litellm_params.custom_code})})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!1,accessToken:a})]}),s&&(0,l.jsx)(tg.TabPanel,{children:(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(th.Title,{children:"Guardrail Settings"}),Y&&(0,l.jsx)(ej.Tooltip,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})}),!j&&!Y&&(d.litellm_params?.guardrail==="custom_code"?(0,l.jsx)(c.Button,{icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"}):(0,l.jsx)(c.Button,{onClick:()=>_(!0),children:"Edit Settings"}))]}),j?(0,l.jsxs)(r.Form,{form:b,onFinish:q,initialValues:{guardrail_name:d.guardrail_name,...(o={...d.litellm_params||{}},delete o.skip_system_message_in_guardrail,o),skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}},layout:"vertical",children:[(0,l.jsx)(r.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter guardrail name"})}),(0,l.jsx)(r.Form.Item,{label:"Default On",name:"default_on",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{label:"Skip system messages in guardrail",name:"skip_system_message_choice",tooltip:"Unified guardrails: omit role: system from guardrail input (LLM still gets full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),d.litellm_params?.guardrail==="presidio"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"PII Protection"}),(0,l.jsx)("div",{className:"mb-6",children:S&&(0,l.jsx)(eE,{entities:S.supported_entities,actions:S.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onActionSelect:(e,t)=>{C(a=>({...a,[e]:t}))},entityCategories:S.pii_entity_categories})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!0,accessToken:a,onDataChange:G,onUnsavedChanges:T}),(d.litellm_params?.guardrail==="tool_permission"||x)&&(0,l.jsx)(eG.Divider,{orientation:"left",children:"Provider Settings"}),d.litellm_params?.guardrail==="tool_permission"?(0,l.jsx)(eH,{value:L,onChange:B}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey,{selectedProvider:Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail)||null,accessToken:a,providerParams:x,value:d.litellm_params}),x&&(()=>{let e=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);if(!e)return null;let t=x[ea[e]?.toLowerCase()];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:d.litellm_params}):null})()]}),(0,l.jsx)(eG.Divider,{orientation:"left",children:"Advanced Settings"}),(0,l.jsx)(r.Form.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,l.jsx)(i.Input.TextArea,{rows:5})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,l.jsx)(c.Button,{onClick:()=>{_(!1),T(!1),H()},children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail ID"}),(0,l.jsx)("div",{className:"font-mono",children:d.guardrail_id})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail Name"}),(0,l.jsx)("div",{children:d.guardrail_name||"Unnamed Guardrail"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Provider"}),(0,l.jsx)("div",{children:W})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Mode"}),(0,l.jsx)("div",{children:d.litellm_params?.mode||"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Default On"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Yes":"No"})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Created At"}),(0,l.jsx)("div",{children:J(d.created_at)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Last Updated"}),(0,l.jsx)("div",{children:J(d.updated_at)})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eH,{value:L,disabled:!0})]})]})})]})]}),(0,l.jsx)(tG,{visible:E,onClose:()=>M(!1),onSuccess:()=>{M(!1),z()},accessToken:a,editData:d?{guardrail_id:d.guardrail_id,guardrail_name:d.guardrail_name,litellm_params:d.litellm_params}:null})]})}],969641);var tz=e.i(573421),tD=e.i(19732),tK=e.i(928685),tH=e.i(166406),tq=e.i(637235),tJ=e.i(755151),tU=e.i(240647);let{Text:tW}=d.Typography,tV=function({results:e,errors:t}){let[a,r]=(0,m.useState)(new Set),i=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),r(t)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return e||t?(0,l.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),e&&e.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-green-50 border-green-200",children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>i(e.guardrailName),children:[t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"}),(0,l.jsx)(tk.CheckCircleOutlined,{className:"text-green-600 text-lg"}),(0,l.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tq.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!t&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tH.CopyOutlined,onClick:async()=>{await s(e.response_text)?u.default.success("Result copied to clipboard"):u.default.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,l.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,l.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,l.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,l.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),t&&t.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-red-50 border-red-200",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>i(e.guardrailName),children:t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"})}),(0,l.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,l.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>i(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tq.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!t&&(0,l.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null},{TextArea:tY}=i.Input,{Text:tQ}=d.Typography,tZ=function({guardrailNames:e,onSubmit:t,isLoading:a,results:r,errors:i,onClose:s}){let[n,o]=(0,m.useState)(""),d=()=>{n.trim()?t(n):u.default.fromBackend("Please enter text to test")},c=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},p=async()=>{await c(n)?u.default.success("Input copied to clipboard"):u.default.fromBackend("Failed to copy input")};return(0,l.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,l.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,l.jsx)("div",{className:"flex items-center space-x-3",children:(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,l.jsx)("div",{className:"inline-flex items-center space-x-1 bg-blue-50 px-3 py-1 rounded-md border border-blue-200",children:(0,l.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",e.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,l.jsx)(ej.Tooltip,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,l.jsx)(eD.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),n&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tH.CopyOutlined,onClick:p,children:"Copy Input"})]}),(0,l.jsx)(tY,{value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),d())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,l.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Press ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Shift+Enter"})," for new line"]}),(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Characters: ",n.length]})]})]}),(0,l.jsx)("div",{className:"pt-2",children:(0,l.jsx)(e4.Button,{onClick:d,loading:a,disabled:!n.trim(),className:"w-full",children:a?`Testing ${e.length} guardrail${e.length>1?"s":""}...`:`Test ${e.length} guardrail${e.length>1?"s":""}`})})]}),(0,l.jsx)(tV,{results:r,errors:i})]})]})};e.s(["default",0,({guardrailsList:e,isLoading:t,accessToken:a,onClose:r})=>{let[s,n]=(0,m.useState)(new Set),[o,c]=(0,m.useState)(""),[g,x]=(0,m.useState)([]),[f,y]=(0,m.useState)([]),[j,_]=(0,m.useState)(!1),b=e.filter(e=>e.guardrail_name?.toLowerCase().includes(o.toLowerCase())),v=async e=>{if(0===s.size||!a)return;_(!0),x([]),y([]);let t=[],l=[];await Promise.all(Array.from(s).map(async r=>{let i=Date.now();try{let l=await (0,p.applyGuardrail)(a,r,e,null,null),s=Date.now()-i;t.push({guardrailName:r,response_text:l.response_text,latency:s})}catch(t){let e=Date.now()-i;console.error(`Error testing guardrail ${r}:`,t),l.push({guardrailName:r,error:t,latency:e})}})),x(t),y(l),_(!1),t.length>0&&u.default.success(`${t.length} guardrail${t.length>1?"s":""} applied successfully`),l.length>0&&u.default.fromBackend(`${l.length} guardrail${l.length>1?"s":""} failed`)};return(0,l.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,l.jsx)(h.Card,{className:"h-full",styles:{body:{padding:0,height:"100%"}},children:(0,l.jsxs)("div",{className:"flex h-full",children:[(0,l.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,l.jsx)(i.Input,{prefix:(0,l.jsx)(tK.SearchOutlined,{}),placeholder:"Search guardrails...",value:o,onChange:e=>c(e.target.value)})]})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto",children:t?(0,l.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,l.jsx)(eh.Spin,{})}):0===b.length?(0,l.jsx)("div",{className:"p-4",children:(0,l.jsx)(ez.Empty,{description:o?"No guardrails match your search":"No guardrails available"})}):(0,l.jsx)(tz.List,{dataSource:b,renderItem:e=>(0,l.jsx)(tz.List.Item,{onClick:()=>{var t;let a;e.guardrail_name&&(t=e.guardrail_name,(a=new Set(s)).has(t)?a.delete(t):a.add(t),n(a))},style:{paddingLeft:24,paddingRight:16},className:`cursor-pointer hover:bg-gray-50 transition-colors ${s.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"}`,children:(0,l.jsx)(tz.List.Item.Meta,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(tD.ExperimentOutlined,{className:"text-gray-400"}),(0,l.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,l.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Type: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,l.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,l.jsxs)(d.Typography.Text,{className:"text-xs text-gray-600",children:[s.size," of ",b.length," selected"]})})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(d.Typography.Title,{level:2,className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===s.size?(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(tD.ExperimentOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-center text-gray-500 max-w-md",children:"Choose one or more guardrails from the left sidebar to start testing and comparing results."})]}):(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(tZ,{guardrailNames:Array.from(s),onSubmit:v,results:g.length>0?g:null,errors:f.length>0?f:null,isLoading:j,onClose:()=>n(new Set)})})})]})]})})})}],476993),e.s([],824296),e.s(["CustomCodeModal",0,tG],64352);let tX="../ui/assets/logos/",t0=[{id:"cf_denied_financial",name:"Denied Financial Advice",description:"Detects requests for personalized financial advice, investment recommendations, or financial planning.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:207,latency:"<0.1ms"}},{id:"cf_denied_insults",name:"Insults & Personal Attacks",description:"Detects insults, name-calling, and personal attacks directed at the chatbot, staff, or other people.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:299,latency:"<0.1ms"}},{id:"cf_denied_legal",name:"Denied Legal Advice",description:"Detects requests for unauthorized legal advice, case analysis, or legal recommendations.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_denied_medical",name:"Denied Medical Advice",description:"Detects requests for medical diagnosis, treatment recommendations, or health advice.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_harmful_violence",name:"Harmful Violence",description:"Detects content related to violence, criminal planning, attacks, and violent threats.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_self_harm",name:"Harmful Self-Harm",description:"Detects content related to self-harm, suicide, and dangerous self-destructive behavior.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_child_safety",name:"Harmful Child Safety",description:"Detects content that could endanger child safety or exploit minors.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_illegal_weapons",name:"Harmful Illegal Weapons",description:"Detects content related to illegal weapons manufacturing, distribution, or acquisition.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_bias_gender",name:"Bias: Gender",description:"Detects gender-based discrimination, stereotypes, and biased language.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_racial",name:"Bias: Racial",description:"Detects racial discrimination, stereotypes, and racially biased content.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_religious",name:"Bias: Religious",description:"Detects religious discrimination, intolerance, and religiously biased content.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_sexual_orientation",name:"Bias: Sexual Orientation",description:"Detects discrimination based on sexual orientation and related biased content.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_prompt_injection_jailbreak",name:"Prompt Injection: Jailbreak",description:"Detects jailbreak attempts designed to bypass AI safety guidelines and restrictions.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_data_exfil",name:"Prompt Injection: Data Exfiltration",description:"Detects attempts to extract sensitive data through prompt manipulation.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_sql",name:"Prompt Injection: SQL",description:"Detects SQL injection attempts embedded in prompts.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_malicious_code",name:"Prompt Injection: Malicious Code",description:"Detects attempts to inject malicious code through prompts.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_system_prompt",name:"Prompt Injection: System Prompt",description:"Detects attempts to extract or override system prompts.",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_toxic_abuse",name:"Toxic & Abusive Language",description:"Detects toxic, abusive, and hateful language across multiple languages (EN, AU, DE, ES, FR).",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Toxicity"]},{id:"cf_patterns",name:"Pattern Matching",description:"Detect and block sensitive data patterns like SSNs, credit card numbers, API keys, and custom regex patterns.",category:"litellm",subcategory:"Patterns",logo:`${tX}litellm_logo.jpg`,tags:["PII","Regex","Data Protection"]},{id:"cf_keywords",name:"Keyword Blocking",description:"Block or mask content containing specific keywords or phrases. Upload custom word lists or add individual terms.",category:"litellm",subcategory:"Keywords",logo:`${tX}litellm_logo.jpg`,tags:["Keywords","Blocklist"]},{id:"block_code_execution",name:"Block Code Execution",description:"Detects markdown fenced code blocks in requests and responses. Block or mask executable code (e.g. Python, JavaScript, Bash) by language with configurable confidence.",category:"litellm",subcategory:"Code Safety",logo:`${tX}litellm_logo.jpg`,tags:["Code","Safety","Prompt Injection"]},{id:"cf_competitor_intent",name:"Competitor Name Blocking",description:"Block or reframe competitor comparison and ranking intent. Detect when users ask to compare or recommend competitors (airline or generic competitor lists).",category:"litellm",subcategory:"Content Category",logo:`${tX}litellm_logo.jpg`,tags:["Content Category","Competitor","Topic Blocker"]},{id:"presidio",name:"Presidio PII",description:"Microsoft Presidio for PII detection and anonymization. Supports 30+ entity types with configurable actions.",category:"partner",logo:`${tX}microsoft_azure.svg`,tags:["PII","Microsoft"],providerKey:"PresidioPII"},{id:"bedrock",name:"Bedrock Guardrail",description:"AWS Bedrock Guardrails for content filtering, topic avoidance, and sensitive information detection.",category:"partner",logo:`${tX}bedrock.svg`,tags:["AWS","Content Safety"],providerKey:"Bedrock"},{id:"lakera",name:"Lakera",description:"AI security platform protecting against prompt injections, data leakage, and harmful content.",category:"partner",logo:`${tX}lakeraai.jpeg`,tags:["Security","Prompt Injection"],providerKey:"Lakera"},{id:"openai_moderation",name:"OpenAI Moderation",description:"OpenAI's content moderation API for detecting harmful content across multiple categories.",category:"partner",logo:`${tX}openai_small.svg`,tags:["Content Moderation","OpenAI"]},{id:"google_model_armor",name:"Google Cloud Model Armor",description:"Google Cloud's model protection service for safe and responsible AI deployments.",category:"partner",logo:`${tX}google.svg`,tags:["Google Cloud","Safety"]},{id:"guardrails_ai",name:"Guardrails AI",description:"Open-source framework for adding structural, type, and quality guarantees to LLM outputs.",category:"partner",logo:`${tX}guardrails_ai.jpeg`,tags:["Open Source","Validation"]},{id:"zscaler",name:"Zscaler AI Guard",description:"Enterprise AI security from Zscaler for monitoring and protecting AI/ML workloads.",category:"partner",logo:`${tX}zscaler.svg`,tags:["Enterprise","Security"]},{id:"panw",name:"PANW Prisma AIRS",description:"Palo Alto Networks Prisma AI Runtime Security for securing AI applications in production.",category:"partner",logo:`${tX}palo_alto_networks.jpeg`,tags:["Enterprise","Security"]},{id:"noma",name:"Noma Security",description:"AI security platform for detecting and preventing AI-specific threats and vulnerabilities.",category:"partner",logo:`${tX}noma_security.png`,tags:["Security","Threat Detection"]},{id:"aporia",name:"Aporia AI",description:"Real-time AI guardrails for hallucination detection, topic control, and policy enforcement.",category:"partner",logo:`${tX}aporia.png`,tags:["Hallucination","Policy"]},{id:"aim",name:"AIM Guardrail",description:"AIM Security guardrails for comprehensive AI threat detection and mitigation.",category:"partner",logo:`${tX}aim_security.jpeg`,tags:["Security","Threat Detection"]},{id:"prompt_security",name:"Prompt Security",description:"Protect against prompt injection attacks, data leakage, and other LLM security threats.",category:"partner",logo:`${tX}prompt_security.png`,tags:["Prompt Injection","Security"]},{id:"lasso",name:"Lasso Guardrail",description:"Content moderation and safety guardrails for responsible AI deployments.",category:"partner",logo:`${tX}lasso.png`,tags:["Content Moderation"]},{id:"pangea",name:"Pangea Guardrail",description:"Pangea's AI guardrails for secure, compliant, and trustworthy AI applications.",category:"partner",logo:`${tX}pangea.png`,tags:["Compliance","Security"]},{id:"enkryptai",name:"EnkryptAI",description:"AI security and governance platform for enterprise AI safety and compliance.",category:"partner",logo:`${tX}enkrypt_ai.avif`,tags:["Enterprise","Governance"]},{id:"javelin",name:"Javelin Guardrails",description:"AI gateway with built-in guardrails for secure and compliant AI operations.",category:"partner",logo:`${tX}javelin.png`,tags:["Gateway","Security"]},{id:"pillar",name:"Pillar Guardrail",description:"AI safety platform for monitoring, testing, and securing AI systems.",category:"partner",logo:`${tX}pillar.jpeg`,tags:["Monitoring","Safety"]},{id:"akto",name:"Akto Guardrail",description:"AI security platform from Akto.io with automatic monitoring and guardrails for AI/ML applications.",category:"partner",logo:`${tX}akto.svg`,tags:["Security","Safety","Monitoring"]},{id:"promptguard",name:"PromptGuard",description:"AI security gateway with prompt injection detection, PII redaction, topic filtering, entity blocklists, and hallucination detection. Self-hostable with drop-in proxy integration.",category:"partner",logo:`${tX}promptguard.svg`,tags:["Security","Prompt Injection","PII"],providerKey:"Promptguard",eval:{f1:94.9,precision:100,recall:90.4,testCases:5384,latency:"~150ms"}}];e.s(["ALL_CARDS",0,t0],230312)},487304,168118,e=>{"use strict";var t=e.i(843476),a=e.i(271645),l=e.i(464571),r=e.i(326373),i=e.i(653496),s=e.i(755151),n=e.i(646563),o=e.i(245094),d=e.i(764205),c=e.i(185357),m=e.i(782719),u=e.i(708347),p=e.i(969641),g=e.i(476993),x=e.i(727749),h=e.i(127952),f=e.i(180766);e.i(824296);var y=e.i(64352),j=e.i(311451),_=e.i(928685),b=e.i(266537),v=e.i(230312),w=e.i(826910);let N=({src:e,name:l})=>{let[r,i]=(0,a.useState)(!1);return r||!e?(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:6,backgroundColor:"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:600,color:"#6b7280",flexShrink:0},children:l?.charAt(0)||"?"}):(0,t.jsx)("img",{src:e,alt:"",style:{width:28,height:28,borderRadius:6,objectFit:"contain",flexShrink:0},onError:()=>i(!0)})},C=({card:e,onClick:l})=>{let[r,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{onClick:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,border:r?"1px solid #93c5fd":"1px solid #e5e7eb",backgroundColor:"#ffffff",padding:"20px 20px 16px 20px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",display:"flex",flexDirection:"column",minHeight:170,boxShadow:r?"0 1px 6px rgba(59,130,246,0.08)":"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[(0,t.jsx)(N,{src:e.logo,name:e.name}),(0,t.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"#111827",lineHeight:1.3},children:e.name})]}),(0,t.jsx)("p",{className:"line-clamp-3",style:{fontSize:12,color:"#6b7280",lineHeight:1.6,margin:0,flex:1},children:e.description}),e.eval&&(0,t.jsxs)("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)(w.CheckCircleFilled,{style:{color:"#16a34a",fontSize:12}}),(0,t.jsxs)("span",{style:{fontSize:11,color:"#16a34a",fontWeight:500},children:["F1: ",e.eval.f1,"% · ",e.eval.testCases," test cases"]})]})]})};var S=e.i(447566);let k={cf_denied_financial:{provider:"LitellmContentFilter",categoryName:"denied_financial_advice",guardrailNameSuggestion:"Denied Financial Advice",mode:"pre_call",defaultOn:!1},cf_denied_legal:{provider:"LitellmContentFilter",categoryName:"denied_legal_advice",guardrailNameSuggestion:"Denied Legal Advice",mode:"pre_call",defaultOn:!1},cf_denied_medical:{provider:"LitellmContentFilter",categoryName:"denied_medical_advice",guardrailNameSuggestion:"Denied Medical Advice",mode:"pre_call",defaultOn:!1},cf_denied_insults:{provider:"LitellmContentFilter",categoryName:"denied_insults",guardrailNameSuggestion:"Insults & Personal Attacks",mode:"pre_call",defaultOn:!1},cf_harmful_violence:{provider:"LitellmContentFilter",categoryName:"harmful_violence",guardrailNameSuggestion:"Harmful Violence",mode:"pre_call",defaultOn:!1},cf_harmful_self_harm:{provider:"LitellmContentFilter",categoryName:"harmful_self_harm",guardrailNameSuggestion:"Harmful Self-Harm",mode:"pre_call",defaultOn:!1},cf_harmful_child_safety:{provider:"LitellmContentFilter",categoryName:"harmful_child_safety",guardrailNameSuggestion:"Harmful Child Safety",mode:"pre_call",defaultOn:!1},cf_harmful_illegal_weapons:{provider:"LitellmContentFilter",categoryName:"harmful_illegal_weapons",guardrailNameSuggestion:"Harmful Illegal Weapons",mode:"pre_call",defaultOn:!1},cf_bias_gender:{provider:"LitellmContentFilter",categoryName:"bias_gender",guardrailNameSuggestion:"Bias: Gender",mode:"pre_call",defaultOn:!1},cf_bias_racial:{provider:"LitellmContentFilter",categoryName:"bias_racial",guardrailNameSuggestion:"Bias: Racial",mode:"pre_call",defaultOn:!1},cf_bias_religious:{provider:"LitellmContentFilter",categoryName:"bias_religious",guardrailNameSuggestion:"Bias: Religious",mode:"pre_call",defaultOn:!1},cf_bias_sexual_orientation:{provider:"LitellmContentFilter",categoryName:"bias_sexual_orientation",guardrailNameSuggestion:"Bias: Sexual Orientation",mode:"pre_call",defaultOn:!1},cf_prompt_injection_jailbreak:{provider:"LitellmContentFilter",categoryName:"prompt_injection_jailbreak",guardrailNameSuggestion:"Prompt Injection: Jailbreak",mode:"pre_call",defaultOn:!1},cf_prompt_injection_data_exfil:{provider:"LitellmContentFilter",categoryName:"prompt_injection_data_exfiltration",guardrailNameSuggestion:"Prompt Injection: Data Exfiltration",mode:"pre_call",defaultOn:!1},cf_prompt_injection_sql:{provider:"LitellmContentFilter",categoryName:"prompt_injection_sql",guardrailNameSuggestion:"Prompt Injection: SQL",mode:"pre_call",defaultOn:!1},cf_prompt_injection_malicious_code:{provider:"LitellmContentFilter",categoryName:"prompt_injection_malicious_code",guardrailNameSuggestion:"Prompt Injection: Malicious Code",mode:"pre_call",defaultOn:!1},cf_prompt_injection_system_prompt:{provider:"LitellmContentFilter",categoryName:"prompt_injection_system_prompt",guardrailNameSuggestion:"Prompt Injection: System Prompt",mode:"pre_call",defaultOn:!1},cf_toxic_abuse:{provider:"LitellmContentFilter",categoryName:"harm_toxic_abuse",guardrailNameSuggestion:"Toxic & Abusive Language",mode:"pre_call",defaultOn:!1},cf_patterns:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Pattern Matching",mode:"pre_call",defaultOn:!1},cf_keywords:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Keyword Blocking",mode:"pre_call",defaultOn:!1},block_code_execution:{provider:"BlockCodeExecution",guardrailNameSuggestion:"Block Code Execution",mode:"pre_call",defaultOn:!1},cf_competitor_intent:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Competitor Name Blocking",mode:"pre_call",defaultOn:!1},presidio:{provider:"PresidioPII",guardrailNameSuggestion:"Presidio PII",mode:"pre_call",defaultOn:!1},bedrock:{provider:"Bedrock",guardrailNameSuggestion:"Bedrock Guardrail",mode:"pre_call",defaultOn:!1},lakera:{provider:"Lakera",guardrailNameSuggestion:"Lakera",mode:"pre_call",defaultOn:!1},openai_moderation:{provider:"OpenaiModeration",guardrailNameSuggestion:"OpenAI Moderation",mode:"pre_call",defaultOn:!1},google_model_armor:{provider:"ModelArmor",guardrailNameSuggestion:"Google Cloud Model Armor",mode:"pre_call",defaultOn:!1},guardrails_ai:{provider:"GuardrailsAi",guardrailNameSuggestion:"Guardrails AI",mode:"pre_call",defaultOn:!1},zscaler:{provider:"ZscalerAiGuard",guardrailNameSuggestion:"Zscaler AI Guard",mode:"pre_call",defaultOn:!1},panw:{provider:"PanwPrismaAirs",guardrailNameSuggestion:"PANW Prisma AIRS",mode:"pre_call",defaultOn:!1},noma:{provider:"Noma",guardrailNameSuggestion:"Noma Security",mode:"pre_call",defaultOn:!1},aporia:{provider:"AporiaAi",guardrailNameSuggestion:"Aporia AI",mode:"pre_call",defaultOn:!1},aim:{provider:"Aim",guardrailNameSuggestion:"AIM Guardrail",mode:"pre_call",defaultOn:!1},prompt_security:{provider:"PromptSecurity",guardrailNameSuggestion:"Prompt Security",mode:"pre_call",defaultOn:!1},lasso:{provider:"Lasso",guardrailNameSuggestion:"Lasso Guardrail",mode:"pre_call",defaultOn:!1},pangea:{provider:"Pangea",guardrailNameSuggestion:"Pangea Guardrail",mode:"pre_call",defaultOn:!1},enkryptai:{provider:"Enkryptai",guardrailNameSuggestion:"EnkryptAI",mode:"pre_call",defaultOn:!1},javelin:{provider:"Javelin",guardrailNameSuggestion:"Javelin Guardrails",mode:"pre_call",defaultOn:!1},pillar:{provider:"Pillar",guardrailNameSuggestion:"Pillar Guardrail",mode:"pre_call",defaultOn:!1},akto:{provider:"Akto",guardrailNameSuggestion:"Akto Guardrail",mode:"pre_call",defaultOn:!1},promptguard:{provider:"Promptguard",guardrailNameSuggestion:"PromptGuard",mode:"pre_call",defaultOn:!1}},I=({card:e,onBack:r,accessToken:i,onGuardrailCreated:s})=>{let[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)("overview"),u=[{property:"Provider",value:"litellm"===e.category?"LiteLLM Content Filter":"Partner Guardrail"},...e.subcategory?[{property:"Subcategory",value:e.subcategory}]:[],..."litellm"===e.category?[{property:"Cost",value:"$0 / request"}]:[],..."litellm"===e.category?[{property:"External Dependencies",value:"None"}]:[],..."litellm"===e.category?[{property:"Latency",value:e.eval?.latency||"<1ms"}]:[]],p=e.eval?[{metric:"Precision",value:`${e.eval.precision}%`},{metric:"Recall",value:`${e.eval.recall}%`},{metric:"F1 Score",value:`${e.eval.f1}%`},{metric:"Test Cases",value:String(e.eval.testCases)},{metric:"False Positives",value:"0"},{metric:"False Negatives",value:"0"},{metric:"Latency (p50)",value:e.eval.latency}]:[],g=[{key:"overview",label:"Overview"},...e.eval?[{key:"eval",label:"Eval Results"}]:[]];return(0,t.jsxs)("div",{style:{maxWidth:960,margin:"0 auto"},children:[(0,t.jsxs)("div",{onClick:r,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(S.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:e.name})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:8},children:[(0,t.jsx)("img",{src:e.logo,alt:"",style:{width:40,height:40,borderRadius:8,objectFit:"contain"},onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name})]}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 20px 0",lineHeight:1.6},children:e.description}),(0,t.jsx)("div",{style:{display:"flex",gap:10,marginBottom:32},children:(0,t.jsx)(l.Button,{onClick:()=>o(!0),style:{borderRadius:20,padding:"4px 20px",height:36,borderColor:"#dadce0",color:"#1a73e8",fontWeight:500,fontSize:14},children:"Create Guardrail"})}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:g.map(e=>(0,t.jsx)("div",{onClick:()=>m(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 12px 0"},children:"Overview"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#3c4043",lineHeight:1.7,margin:"0 0 32px 0"},children:e.description}),(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Guardrail Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Details are as follows"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:200},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:u.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},a))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Guardrail ID"}),(0,t.jsxs)("div",{style:{fontSize:13,color:"#202124",wordBreak:"break-all"},children:["litellm/",e.id]})]}),(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Type"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#202124"},children:"litellm"===e.category?"Content Filter":"Partner"})]}),e.tags.length>0&&(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.tags.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]})]})]}),"eval"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 16px 0"},children:"Eval Results"}),(0,t.jsxs)("table",{style:{width:"100%",maxWidth:560,borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Metric"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Value"})]})}),(0,t.jsx)("tbody",{children:p.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#3c4043"},children:e.metric}),(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#202124",fontWeight:500},children:e.value})]},a))})]})]}),(0,t.jsx)(c.default,{visible:n,onClose:()=>o(!1),accessToken:i,onSuccess:()=>{o(!1),s()},preset:k[e.id]})]})},A=({accessToken:e,onGuardrailCreated:l})=>{let[r,i]=(0,a.useState)(""),[s,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),c=v.ALL_CARDS.filter(e=>{if(!r)return!0;let t=r.toLowerCase();return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))}),m=c.filter(e=>"litellm"===e.category),u=c.filter(e=>"partner"===e.category);return s?(0,t.jsx)(I,{card:s,onBack:()=>n(null),accessToken:e,onGuardrailCreated:l}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{marginBottom:24},children:(0,t.jsx)(j.Input,{size:"large",placeholder:"Search guardrails",prefix:(0,t.jsx)(_.SearchOutlined,{style:{color:"#9ca3af"}}),value:r,onChange:e=>i(e.target.value),style:{borderRadius:8}})}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:0},children:"LiteLLM Content Filter"}),(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:14,color:"#1a73e8",cursor:"pointer"},onClick:()=>d(!o),children:o?(0,t.jsx)(t.Fragment,{children:"Show less"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.ArrowRightOutlined,{style:{fontSize:12}}),`Show all (${m.length})`]})})]}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Built-in guardrails powered by LiteLLM. Zero latency, no external dependencies, no additional cost."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:(o?m:m.slice(0,10)).map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:"0 0 4px 0"},children:"Partner Guardrails"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Third-party guardrail integrations from leading AI security providers."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:u.map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]})]})};var O=e.i(988846),T=e.i(837007),P=e.i(409797),L=e.i(54131),B=e.i(995926),F=e.i(678784),$=e.i(634831),E=e.i(438100),M=e.i(302202),R=e.i(328196),G=e.i(879664);e.s(["InfoIcon",()=>G.default],168118);var G=G,z=e.i(212931),D=e.i(808613),K=e.i(199133),H=e.i(663435),q=e.i(954616),J=e.i(912598),U=e.i(135214),W=e.i(243652);let V=async(e,t)=>{let a=(0,d.getProxyBaseUrl)(),l=`${a}/guardrails/register`,r=await fetch(l,{method:"POST",headers:{[(0,d.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.json().catch(()=>({})),t=(0,d.deriveErrorMessage)(e);throw(0,d.handleError)(t),Error(t)}return r.json()},Y=(0,W.createQueryKeys)("guardrails");function Q(e){var t;let a=e.litellm_params??{},l=e.guardrail_info??{},r=a.headers,i=Array.isArray(r)?r.map(e=>({key:(e.key??e.name??"").toString(),value:String(e.value??"")})):"object"==typeof r&&null!==r?Object.entries(r).map(([e,t])=>({key:e,value:String(t??"")})):[],s=a.api_base??a.url??"",n=l.model??a.model??"—",o=a.forward_api_key??!0,d=Array.isArray(a.extra_headers)?a.extra_headers.filter(e=>"string"==typeof e):[];return{id:e.guardrail_id,team:e.team_id??"—",name:e.guardrail_name,endpoint:s,status:"pending_review"===(t=e.status)?"pending":"active"===t||"rejected"===t?t:"active",model:n,forwardKey:o,description:l.description??"",method:a.method??"POST",customHeaders:i,extraHeaders:d,submittedAt:function(e){if(!e)return"—";try{let t=new Date(e);return isNaN(t.getTime())?e:t.toISOString().slice(0,10)}catch{return e}}(e.submitted_at),submittedBy:e.submitted_by_email??e.submitted_by_user_id??"—",mode:a.mode,unreachable_fallback:a.unreachable_fallback,additionalProviderParams:a.additional_provider_specific_params,guardrailType:a.guardrail}}let Z={active:{label:"Active",bg:"bg-green-50",text:"text-green-700",dot:"bg-green-500"},pending:{label:"Pending Review",bg:"bg-yellow-50",text:"text-yellow-700",dot:"bg-yellow-500"},rejected:{label:"Rejected",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"}},X={"ML Platform":"bg-purple-100 text-purple-700","Data Science":"bg-blue-100 text-blue-700",Security:"bg-red-100 text-red-700","Customer Success":"bg-orange-100 text-orange-700",Legal:"bg-gray-100 text-gray-700",Finance:"bg-green-100 text-green-700"};function ee({label:e,value:a,color:l}){return(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg px-4 py-3",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${l}`,children:a}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e})]})}function et({enabled:e,onToggle:a}){return(0,t.jsx)("button",{type:"button",onClick:a,role:"switch","aria-checked":e,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${e?"bg-blue-500":"bg-gray-200"}`,children:(0,t.jsx)("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ${e?"translate-x-4":"translate-x-0.5"}`})})}function ea({guardrail:e,isSelected:a,isHeadersExpanded:l,onSelect:r,onToggleForwardKey:i,onToggleHeaders:s,onApprove:n,onReject:o}){let d=Z[e.status],c=X[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsxs)("div",{className:`bg-white border rounded-lg p-4 transition-all ${a?"border-blue-400 ring-1 ring-blue-200":"border-gray-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${c}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${d.bg} ${d.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${d.dot}`}),d.label]})]}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-2 line-clamp-1",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(M.ServerIcon,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-gray-500 font-mono truncate",children:e.endpoint})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-gray-500",children:[(0,t.jsxs)("span",{children:["Model: ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.model})]}),(0,t.jsxs)("span",{children:["Submitted:"," ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.submittedAt})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:"Forward API Key"}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:i})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs border border-gray-300 text-gray-600 hover:bg-gray-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:a?"Close":"Review"}),"pending"===e.status&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:n,className:"text-xs bg-green-500 hover:bg-green-600 text-white px-3 py-1.5 rounded-md transition-colors font-medium",children:"Approve"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"text-xs border border-red-300 text-red-600 hover:bg-red-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:"Reject"})]})]})]})]}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[(0,t.jsxs)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-700 transition-colors",children:[l?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5"}):(0,t.jsx)(P.ChevronDownIcon,{className:"h-3.5 w-3.5"}),"Static headers",e.customHeaders.length>0&&(0,t.jsx)("span",{className:"ml-1 bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),l&&(0,t.jsx)("div",{className:"mt-2",children:0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic",children:"No static headers configured."}):(0,t.jsx)("div",{className:"space-y-1",children:e.customHeaders.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-mono",children:[(0,t.jsx)("span",{className:"text-gray-500 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.key}),(0,t.jsx)("span",{className:"text-gray-400",children:":"}),(0,t.jsx)("span",{className:"text-gray-700 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.value})]},`${e.key}-${a}`))})})]})]})}function el({label:e,children:a}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),(0,t.jsx)("div",{children:a})]})}function er({guardrail:e,onClose:l,onApprove:r,onReject:i,onToggleForwardKey:s,onUpdateCustomHeaders:n,onUpdateExtraHeaders:o}){let[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[p,g]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),f=Z[e.status],y=X[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsx)("div",{className:"w-96 flex-shrink-0 bg-white overflow-auto",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${y}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${f.bg} ${f.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${f.dot}`}),f.label]})]}),(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["Submitted by ",e.submittedBy," on ",e.submittedAt]})]}),(0,t.jsx)("button",{type:"button",onClick:l,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close detail panel",children:(0,t.jsx)(B.XIcon,{className:"h-4 w-4"})})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-5",children:e.description}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(el,{label:"Endpoint",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"text-xs font-mono text-gray-700 break-all",children:e.endpoint}),(0,t.jsx)("a",{href:e.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-blue-500 flex-shrink-0",children:(0,t.jsx)($.ExternalLinkIcon,{className:"h-3.5 w-3.5"})})]})}),(0,t.jsx)(el,{label:"Method",children:(0,t.jsx)("span",{className:"text-xs font-mono font-medium text-gray-700 bg-gray-100 px-2 py-0.5 rounded",children:e.method})}),(0,t.jsxs)("div",{className:"border border-blue-100 bg-blue-50 rounded-lg p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(E.KeyIcon,{className:"h-3.5 w-3.5 text-blue-500"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-blue-800",children:"Forward LiteLLM API Key"})]}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:s})]}),(0,t.jsxs)("p",{className:"text-xs text-blue-700 leading-relaxed",children:["When enabled, the caller's LiteLLM API key is forwarded as an"," ",(0,t.jsx)("code",{className:"font-mono bg-blue-100 px-1 rounded",children:"Authorization"})," ","header to your guardrail endpoint. This allows your guardrail to authenticate model calls using the original caller's credentials."]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Static headers"}),e.customHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Sent with every request to the guardrail."}),0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No static headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.customHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsxs)("span",{className:"text-gray-700 truncate",children:[a.key,": ",a.value]}),(0,t.jsx)("button",{type:"button",onClick:()=>n(e.customHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a.key}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a.key}-${l}`))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:"Header name (e.g. X-API-Key)",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"Value",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=p.trim(),a=x.trim();t&&!e.customHeaders.some(e=>e.key.toLowerCase()===t.toLowerCase())&&(n([...e.customHeaders,{key:t,value:a}]),g(""),h(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors flex-shrink-0",children:"Add"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Forward client headers"}),e.extraHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.extraHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Allowed header names to forward from the client request to the guardrail (e.g. x-request-id)."}),0===e.extraHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No forward client headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.extraHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-gray-700 truncate",children:a}),(0,t.jsx)("button",{type:"button",onClick:()=>o(e.extraHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a}-${l}`))}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"e.g. x-request-id",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=m.trim().toLowerCase();a&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(a)&&(o([...e.extraHeaders,a]),u(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=m.trim().toLowerCase();t&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(t)&&(o([...e.extraHeaders,t]),u(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors",children:"Add"})]})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(!d),className:"w-full flex items-center justify-between px-3 py-2 text-left text-xs font-semibold text-gray-700 bg-gray-50 hover:bg-gray-100 transition-colors",children:[(0,t.jsx)("span",{children:"Equivalent config"}),d?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5 text-gray-500"}):(0,t.jsx)(P.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-500"})]}),d&&(0,t.jsx)("pre",{className:"p-3 text-xs font-mono text-gray-700 bg-white border-t border-gray-200 overflow-x-auto whitespace-pre-wrap break-all",children:function(e){let t=["litellm_settings:"," guardrails:",` - guardrail_name: "${e.name.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`," litellm_params:",` guardrail: ${e.guardrailType??"generic_guardrail_api"}`,` mode: ${e.mode??"pre_call"} # or post_call, during_call`,` api_base: ${e.endpoint||"https://your-guardrail-api.com"}`," api_key: os.environ/YOUR_GUARDRAIL_API_KEY # optional",` unreachable_fallback: ${e.unreachable_fallback??"fail_closed"} # default: fail_closed. Set to fail_open to proceed if the guardrail endpoint is unreachable.`,` forward_api_key: ${e.forwardKey}`];if(e.model&&"—"!==e.model&&t.push(` model: "${e.model}" # LLM model name sent to the guardrail for context`),e.customHeaders.length>0)for(let a of(t.push(" headers: # static headers (sent with every request)"),e.customHeaders))t.push(` ${a.key}: "${String(a.value).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`);if(e.extraHeaders.length>0)for(let a of(t.push(" extra_headers: # forward these client request headers to the guardrail"),e.extraHeaders))t.push(` - ${a}`);if(e.additionalProviderParams&&Object.keys(e.additionalProviderParams).length>0)for(let[a,l]of(t.push(" additional_provider_specific_params:"),Object.entries(e.additionalProviderParams))){let e="string"==typeof l?`"${l}"`:String(l);t.push(` ${a}: ${e}`)}return t.join("\n")}(e)})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,t.jsx)(G.default,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 mt-0.5"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 leading-relaxed",children:["This guardrail runs on a separate instance. It receives the user request and forwards the result to the next step in the pipeline. See"," ",(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/adding_provider/generic_guardrail_api",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:"LiteLLM Generic Guardrail API docs"})," ","for configuration details."]})]})]}),(0,t.jsxs)("div",{className:"mt-5 pt-4 border-t border-gray-100 space-y-2",children:[(0,t.jsxs)("button",{type:"button",className:"w-full flex items-center justify-center gap-2 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)($.ExternalLinkIcon,{className:"h-4 w-4"}),"Test Endpoint"]}),"pending"===e.status&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:r,className:"flex-1 flex items-center justify-center gap-1.5 bg-green-500 hover:bg-green-600 text-white text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(F.CheckIcon,{className:"h-4 w-4"}),"Approve"]}),(0,t.jsxs)("button",{type:"button",onClick:i,className:"flex-1 flex items-center justify-center gap-1.5 border border-red-300 text-red-600 hover:bg-red-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(B.XIcon,{className:"h-4 w-4"}),"Reject"]})]})]})]})})}function ei({action:e,guardrailName:a,onConfirm:l,onCancel:r}){let i="approve"===e;return(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-50",children:(0,t.jsxs)("div",{className:"bg-white rounded-xl shadow-xl p-6 max-w-sm w-full mx-4",children:[(0,t.jsx)("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mb-4 ${i?"bg-green-100":"bg-red-100"}`,children:i?(0,t.jsx)(F.CheckIcon,{className:"h-5 w-5 text-green-600"}):(0,t.jsx)(R.AlertCircleIcon,{className:"h-5 w-5 text-red-600"})}),(0,t.jsx)("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:i?"Approve Guardrail":"Reject Guardrail"}),(0,t.jsxs)("p",{className:"text-sm text-gray-500 mb-5",children:["Are you sure you want to ",e," ",(0,t.jsxs)("span",{className:"font-medium text-gray-700",children:['"',a,'"']}),"?"," ",i?"This will make it active and available for use.":"This will mark it as rejected and notify the team."]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"flex-1 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:l,className:`flex-1 text-white text-sm font-medium py-2 rounded-md transition-colors ${i?"bg-green-500 hover:bg-green-600":"bg-red-500 hover:bg-red-600"}`,children:i?"Approve":"Reject"})]})]})})}function es({accessToken:e}){let[l,r]=(0,a.useState)([]),[i,s]=(0,a.useState)({total:0,pending_review:0,active:0,rejected:0}),[n,o]=(0,a.useState)(""),[c,m]=(0,a.useState)("all"),[u,p]=(0,a.useState)(null),[g,h]=(0,a.useState)(new Set),[f,y]=(0,a.useState)(null),[_,b]=(0,a.useState)(!0),[v,w]=(0,a.useState)(null),[N,C]=(0,a.useState)(""),[S,k]=(0,a.useState)(!1),[I]=D.Form.useForm(),A=(()=>{let{accessToken:e}=(0,U.default)(),t=(0,J.useQueryClient)();return(0,q.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return V(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Y.all})}})})();(0,a.useEffect)(()=>{let e=setTimeout(()=>C(n),300);return()=>clearTimeout(e)},[n]);let P=(0,a.useCallback)(async()=>{if(!e)return void b(!1);b(!0),w(null);try{let t="all"===c?void 0:"pending"===c?"pending_review":c,a=await (0,d.listGuardrailSubmissions)(e,{status:t,search:N.trim()||void 0});r(a.submissions.map(Q)),s(a.summary)}catch(e){w(e instanceof Error?e.message:"Failed to load submissions"),r([])}finally{b(!1)}},[e,c,N]);(0,a.useEffect)(()=>{P()},[P]);let L=l.find(e=>e.id===u)??null,B=i.total,F=i.pending_review,$=i.active,E=i.rejected;async function M(t){if(!e)return;let a=l.find(e=>e.id===t);if(!a)return;let i=!a.forwardKey;try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{forward_api_key:i}}),r(e=>e.map(e=>e.id===t?{...e,forwardKey:i}:e)),x.default.success(i?"Forward API key enabled":"Forward API key disabled")}catch{x.default.fromBackend("Failed to update forward API key")}}async function R(t,a){if(!e)return;let l={};for(let{key:e,value:t}of a)e.trim()&&(l[e.trim()]=t);try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{headers:l}}),r(e=>e.map(e=>e.id===t?{...e,customHeaders:a.filter(e=>e.key.trim())}:e)),x.default.success("Static headers updated")}catch{x.default.fromBackend("Failed to update static headers")}}async function G(t,a){if(e)try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{extra_headers:a}}),r(e=>e.map(e=>e.id===t?{...e,extraHeaders:a}:e)),x.default.success("Forward client headers updated")}catch{x.default.fromBackend("Failed to update forward client headers")}}async function W(t){if(e)try{await (0,d.approveGuardrailSubmission)(e,t),y(null),u===t&&p(null),await P(),x.default.success("Guardrail approved")}catch{x.default.fromBackend("Failed to approve guardrail")}}async function Z(t){if(e)try{await (0,d.rejectGuardrailSubmission)(e,t),y(null),u===t&&p(null),await P(),x.default.success("Guardrail rejected")}catch{x.default.fromBackend("Failed to reject guardrail")}}return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:`flex-1 min-w-0 p-6 overflow-auto ${L?"border-r border-gray-200":""}`,children:[(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[(0,t.jsx)(ee,{label:"Total Submitted",value:B,color:"text-gray-900"}),(0,t.jsx)(ee,{label:"Pending Review",value:F,color:"text-yellow-600"}),(0,t.jsx)(ee,{label:"Active",value:$,color:"text-green-600"}),(0,t.jsx)(ee,{label:"Rejected",value:E,color:"text-red-600"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(O.SearchIcon,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,t.jsx)("input",{type:"text",placeholder:"Search guardrails...",value:n,onChange:e=>o(e.target.value),className:"w-full pl-9 pr-4 py-2 border border-gray-200 rounded-md text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"})]}),(0,t.jsxs)("select",{value:c,onChange:e=>m(e.target.value),className:"border border-gray-200 rounded-md px-3 py-2 text-sm text-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 bg-white",children:[(0,t.jsx)("option",{value:"all",children:"All Status"}),(0,t.jsx)("option",{value:"pending",children:"Pending Review"}),(0,t.jsx)("option",{value:"active",children:"Active"}),(0,t.jsx)("option",{value:"rejected",children:"Rejected"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>k(!0),className:"ml-auto flex items-center gap-2 bg-blue-500 hover:bg-blue-600 text-white text-sm font-medium px-4 py-2 rounded-md transition-colors",children:[(0,t.jsx)(T.PlusIcon,{className:"h-4 w-4"}),"Add Guardrail"]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[_&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-500 text-sm",children:"Loading submissions…"}),v&&(0,t.jsx)("div",{className:"text-center py-12 text-red-600 text-sm",children:v}),!_&&!v&&0===l.length&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-400 text-sm",children:"No guardrails match your filters."}),!_&&!v&&l.map(e=>(0,t.jsx)(ea,{guardrail:e,isSelected:u===e.id,isHeadersExpanded:g.has(e.id),onSelect:()=>p(u===e.id?null:e.id),onToggleForwardKey:()=>M(e.id),onToggleHeaders:()=>{var t;return t=e.id,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},onApprove:()=>y({id:e.id,action:"approve"}),onReject:()=>y({id:e.id,action:"reject"})},e.id))]})]}),L&&(0,t.jsx)(er,{guardrail:L,onClose:()=>p(null),onApprove:()=>y({id:L.id,action:"approve"}),onReject:()=>y({id:L.id,action:"reject"}),onToggleForwardKey:()=>M(L.id),onUpdateCustomHeaders:e=>R(L.id,e),onUpdateExtraHeaders:e=>G(L.id,e)}),f&&(0,t.jsx)(ei,{action:f.action,guardrailName:l.find(e=>e.id===f.id)?.name??"",onConfirm:()=>"approve"===f.action?W(f.id):Z(f.id),onCancel:()=>y(null)}),(0,t.jsxs)(z.Modal,{title:"Submit Guardrail for Review",open:S,onCancel:()=>{k(!1),I.resetFields()},onOk:()=>I.submit(),okText:"Submit for Review",children:[(0,t.jsx)("div",{className:"rounded-md bg-blue-50 border border-blue-200 px-4 py-3 text-sm text-blue-800 mb-4",children:"Your guardrail will be sent for admin review before it becomes active."}),(0,t.jsxs)(D.Form,{form:I,layout:"vertical",initialValues:{mode:"pre_call"},onFinish:async e=>{let t={...e.extra_litellm_params?JSON.parse(e.extra_litellm_params):{},guardrail:"generic_guardrail_api",mode:e.mode,api_base:e.api_base};try{await A.mutateAsync({team_id:e.team_id,guardrail_name:e.guardrail_name,litellm_params:t,guardrail_info:e.guardrail_info?JSON.parse(e.guardrail_info):void 0}),x.default.success("Guardrail submitted for review"),k(!1),I.resetFields(),P()}catch{}},children:[(0,t.jsx)(D.Form.Item,{label:"Team",name:"team_id",rules:[{required:!0,message:"Select a team"}],children:(0,t.jsx)(H.default,{})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Enter a guardrail name"}],children:(0,t.jsx)(j.Input,{placeholder:"e.g. pii-detection"})}),(0,t.jsx)(D.Form.Item,{label:"Mode",name:"mode",rules:[{required:!0,message:"Select a mode"}],children:(0,t.jsxs)(K.Select,{children:[(0,t.jsx)(K.Select.Option,{value:"pre_call",children:"Pre Call"}),(0,t.jsx)(K.Select.Option,{value:"post_call",children:"Post Call"}),(0,t.jsx)(K.Select.Option,{value:"during_call",children:"During Call"})]})}),(0,t.jsx)(D.Form.Item,{label:"API Base URL",name:"api_base",rules:[{required:!0,message:"Enter the API base URL"},{type:"url",message:"Must be a valid URL"}],children:(0,t.jsx)(j.Input,{placeholder:"https://your-guardrail-api.com/v1/check",className:"font-mono"})}),(0,t.jsx)(D.Form.Item,{label:"Additional litellm_params (optional)",name:"extra_litellm_params",tooltip:"JSON object merged into litellm_params. e.g. forward_api_key, headers, model, unreachable_fallback",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{let e=JSON.parse(t);if("object"!=typeof e||Array.isArray(e))return Promise.reject("Must be a JSON object");return Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"forward_api_key": true, "headers": {"X-Custom": "value"}}'})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Info (optional)",name:"guardrail_info",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"description": "Detects PII in requests"}'})})]})]})]})}e.s(["default",0,({accessToken:e,userRole:j})=>{let[_,b]=(0,a.useState)([]),[v,w]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),[S,k]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[T,P]=(0,a.useState)(null),[L,B]=(0,a.useState)(!1),[F,$]=(0,a.useState)(null),E=!!j&&(0,u.isAdminRole)(j),M=async()=>{if(e){k(!0);try{let t=await (0,d.getGuardrailsList)(e);console.log(`guardrails: ${JSON.stringify(t)}`),b(t.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{k(!1)}}};(0,a.useEffect)(()=>{M()},[e]);let R=()=>{M()},G=async()=>{if(T&&e){O(!0);try{await (0,d.deleteGuardrailCall)(e,T.guardrail_id),x.default.success(`Guardrail "${T.guardrail_name}" deleted successfully`),await M()}catch(e){console.error("Error deleting guardrail:",e),x.default.fromBackend("Failed to delete guardrail")}finally{O(!1),B(!1),P(null)}}},z=T&&T.litellm_params?(0,f.getGuardrailLogoAndName)(T.litellm_params.guardrail).displayName:void 0;return(0,t.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,t.jsx)(i.Tabs,{defaultActiveKey:"submitted",items:[...E?[{key:"garden",label:"Guardrail Garden",children:(0,t.jsx)(A,{accessToken:e,onGuardrailCreated:R})},{key:"guardrails",label:"Guardrails",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)(r.Dropdown,{menu:{items:[{key:"provider",icon:(0,t.jsx)(n.PlusOutlined,{}),label:"Add Provider Guardrail",onClick:()=>{F&&$(null),w(!0)}},{key:"custom_code",icon:(0,t.jsx)(o.CodeOutlined,{}),label:"Create Custom Code Guardrail",onClick:()=>{F&&$(null),C(!0)}}]},trigger:["click"],disabled:!e,children:(0,t.jsxs)(l.Button,{disabled:!e,children:["+ Add New Guardrail ",(0,t.jsx)(s.DownOutlined,{className:"ml-2"})]})})}),F?(0,t.jsx)(p.default,{guardrailId:F,onClose:()=>$(null),accessToken:e,isAdmin:E}):(0,t.jsx)(m.default,{guardrailsList:_,isLoading:S,onDeleteClick:(e,t)=>{P(_.find(t=>t.guardrail_id===e)||null),B(!0)},accessToken:e,onGuardrailUpdated:M,isAdmin:E,onGuardrailClick:e=>$(e)}),(0,t.jsx)(c.default,{visible:v,onClose:()=>{w(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(y.CustomCodeModal,{visible:N,onClose:()=>{C(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(h.default,{isOpen:L,title:"Delete Guardrail",message:`Are you sure you want to delete guardrail: ${T?.guardrail_name}? This action cannot be undone.`,resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:T?.guardrail_name},{label:"ID",value:T?.guardrail_id,code:!0},{label:"Provider",value:z},{label:"Mode",value:T?.litellm_params.mode},{label:"Default On",value:T?.litellm_params.default_on?"Yes":"No"}],onCancel:()=>{B(!1),P(null)},onOk:G,confirmLoading:I})]})},{key:"playground",label:"Test Playground",disabled:!e,children:(0,t.jsx)(g.default,{guardrailsList:_,isLoading:S,accessToken:e,onClose:()=>{}})}]:[],{key:"submitted",label:"Submitted Guardrails",children:(0,t.jsx)(es,{accessToken:e})}]})})}],487304)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/23491c78faf959c9.js b/litellm/proxy/_experimental/out/_next/static/chunks/23491c78faf959c9.js
new file mode 100644
index 0000000000..f7c193058b
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/23491c78faf959c9.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,309426,e=>{"use strict";var t=e.i(290571),r=e.i(444755),i=e.i(673706),n=e.i(271645),s=e.i(46757);let a=(0,i.makeClassName)("Col"),o=n.default.forwardRef((e,i)=>{let o,l,c,d,{numColSpan:u=1,numColSpanSm:h,numColSpanMd:f,numColSpanLg:p,children:m,className:g}=e,y=(0,t.__rest)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),x=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return n.default.createElement("div",Object.assign({ref:i,className:(0,r.tremorTwMerge)(a("root"),(o=x(u,s.colSpan),l=x(h,s.colSpanSm),c=x(f,s.colSpanMd),d=x(p,s.colSpanLg),(0,r.tremorTwMerge)(o,l,c,d)),g)},y),m)});o.displayName="Col",e.s(["Col",()=>o],309426)},409797,e=>{"use strict";var t=e.i(631171);e.s(["ChevronDownIcon",()=>t.default])},246349,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",()=>t])},91739,e=>{"use strict";var t=e.i(544195);e.s(["Radio",()=>t.default])},988297,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.s(["PlusIcon",0,r],988297)},797672,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});e.s(["PencilIcon",0,r],797672)},992619,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(779241),n=e.i(599724),s=e.i(199133),a=e.i(983561),o=e.i(689020);e.s(["default",0,({accessToken:e,value:l,placeholder:c="Select a Model",onChange:d,disabled:u=!1,style:h,className:f,showLabel:p=!0,labelText:m="Select Model"})=>{let[g,y]=(0,r.useState)(l),[x,b]=(0,r.useState)(!1),[_,v]=(0,r.useState)([]),w=(0,r.useRef)(null);return(0,r.useEffect)(()=>{y(l)},[l]),(0,r.useEffect)(()=>{e&&(async()=>{try{let t=await (0,o.fetchAvailableModels)(e);console.log("Fetched models for selector:",t),t.length>0&&v(t)}catch(e){console.error("Error fetching model info:",e)}})()},[e]),(0,t.jsxs)("div",{children:[p&&(0,t.jsxs)(n.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.RobotOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(s.Select,{value:g,placeholder:c,onChange:e=>{"custom"===e?(b(!0),y(void 0)):(b(!1),y(e),d&&d(e))},options:[...Array.from(new Set(_.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...h},showSearch:!0,className:`rounded-md ${f||""}`,disabled:u}),x&&(0,t.jsx)(i.TextInput,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{y(e),d&&d(e)},500)},disabled:u})]})}])},500727,699857,696609,531516,e=>{"use strict";var t=e.i(266027),r=e.i(243652),i=e.i(764205),n=e.i(135214);let s=(0,r.createQueryKeys)("mcpServers");e.s(["useMCPServers",0,e=>{let{accessToken:r}=(0,n.default)();return(0,t.useQuery)({queryKey:s.list(e?{filters:{teamId:e}}:void 0),queryFn:async()=>await (0,i.fetchMCPServers)(r,e),enabled:!!r})}],500727);let a=(0,r.createQueryKeys)("mcpToolsets");e.s(["useMCPToolsets",0,()=>{let{accessToken:e}=(0,n.default)();return(0,t.useQuery)({queryKey:a.list(),queryFn:async()=>await (0,i.fetchMCPToolsets)(e),enabled:!!e})}],699857);var o=e.i(843476),l=e.i(271645),c=e.i(536916),d=e.i(599724),u=e.i(409797),h=e.i(246349),h=h;let f=/\b(delete|remove|destroy|purge|drop|erase|unlink)\b/i,p=/\b(create|add|insert|new|post|submit|register|make|generate|write|upload)\b/i,m=/\b(update|edit|modify|change|patch|put|set|rename|move|transform)\b/i,g=/\b(get|read|list|fetch|search|find|query|retrieve|show|view|check|describe|info)\b/i;function y(e,t=""){let r=e.toLowerCase();if(g.test(r))return"read";if(f.test(r))return"delete";if(m.test(r))return"update";if(p.test(r))return"create";if(t){let e=t.toLowerCase();if(g.test(e))return"read";if(f.test(e))return"delete";if(m.test(e))return"update";if(p.test(e))return"create"}return"unknown"}function x(e){let t={read:[],create:[],update:[],delete:[],unknown:[]};for(let r of e)t[y(r.name,r.description)].push(r);return t}let b={read:{label:"Read",description:"Safe operations — fetch, list, search. No side effects.",risk:"low"},create:{label:"Create",description:"Add new resources — insert, upload, register.",risk:"medium"},update:{label:"Update",description:"Modify existing resources — edit, patch, rename.",risk:"medium"},delete:{label:"Delete",description:"Destructive operations — remove, purge, destroy.",risk:"high"},unknown:{label:"Other",description:"Operations that could not be automatically classified.",risk:"unknown"}};e.s(["CRUD_GROUP_META",0,b,"classifyToolOp",()=>y,"groupToolsByCrud",()=>x],696609);let _=["read","create","update","delete","unknown"],v={low:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-red-100 text-red-800 font-semibold",unknown:"bg-gray-100 text-gray-700"},w={read:"border-green-200",create:"border-blue-200",update:"border-yellow-200",delete:"border-red-300",unknown:"border-gray-200"},k={read:"bg-green-50",create:"bg-blue-50",update:"bg-yellow-50",delete:"bg-red-50",unknown:"bg-gray-50"};e.s(["default",0,({tools:e,value:t,onChange:r,readOnly:i=!1,searchFilter:n=""})=>{let[s,a]=(0,l.useState)({read:!1,create:!1,update:!1,delete:!1,unknown:!0}),f=(0,l.useMemo)(()=>x(e),[e]),p=(0,l.useMemo)(()=>new Set(void 0===t?e.map(e=>e.name):t),[t,e]),m=e=>{if(i)return;let t=new Set(p);t.has(e)?t.delete(e):t.add(e),r(Array.from(t))};return 0===e.length?null:(0,o.jsx)("div",{className:"space-y-3",children:_.map(e=>{let t,l=f[e];if(0===l.length)return null;if(n){let e=n.toLowerCase();if(!l.some(t=>t.name.toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)))return null}let g=b[e],y=(t=f[e]).length>0&&t.every(e=>p.has(e.name)),x=(e=>{let t=f[e];if(0===t.length)return!1;let r=t.filter(e=>p.has(e.name)).length;return r>0&&r{a(t=>({...t,[e]:!t[e]}))},children:[_?(0,o.jsx)(h.default,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}):(0,o.jsx)(u.ChevronDownIcon,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}),(0,o.jsx)("span",{className:"font-semibold text-gray-900 text-sm",children:g.label}),(0,o.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full ${v[g.risk]}`,children:"high"===g.risk?"High Risk":"medium"===g.risk?"Medium Risk":"low"===g.risk?"Safe":"Unclassified"}),(0,o.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:[l.filter(e=>p.has(e.name)).length,"/",l.length," allowed"]})]}),!i&&(0,o.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,o.jsx)(d.Text,{className:"text-xs text-gray-500",children:y?"All on":x?"Partial":"All off"}),(0,o.jsx)(c.Checkbox,{checked:y,indeterminate:x,onChange:t=>((e,t)=>{if(i)return;let n=new Set(p);for(let r of f[e])t?n.add(r.name):n.delete(r.name);r(Array.from(n))})(e,t.target.checked),onClick:e=>e.stopPropagation()})]})]}),!_&&(0,o.jsx)("div",{className:"px-4 pt-2 pb-1 text-xs text-gray-500 bg-white border-b border-gray-100",children:g.description}),!_&&(0,o.jsx)("div",{className:"bg-white divide-y divide-gray-50",children:l.filter(e=>!n||e.name.toLowerCase().includes(n.toLowerCase())||(e.description??"").toLowerCase().includes(n.toLowerCase())).map(e=>{let t,r=(t=e.name,p.has(t));return(0,o.jsxs)("div",{className:`flex items-start gap-3 px-4 py-2.5 transition-colors hover:bg-gray-50 ${!i?"cursor-pointer":""} ${r?"":"opacity-60"}`,onClick:()=>m(e.name),children:[(0,o.jsx)(c.Checkbox,{checked:r,onChange:()=>m(e.name),disabled:i,onClick:e=>e.stopPropagation()}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)(d.Text,{className:"font-medium text-gray-900 text-sm",children:e.name}),e.description&&(0,o.jsx)(d.Text,{className:"text-xs text-gray-500 mt-0.5 leading-snug",children:e.description})]}),(0,o.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${r?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:r?"on":"off"})]},e.name)})})]},e)})})}],531516)},743151,(e,t,r)=>{"use strict";function i(e){return(i="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)}Object.defineProperty(r,"__esModule",{value:!0}),r.CopyToClipboard=void 0;var n=o(e.r(271645)),s=o(e.r(844343)),a=["text","onCopy","options","children"];function o(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function c(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),i=n.default.Children.only(t);return n.default.cloneElement(i,c(c({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r{"use strict";var i=e.r(743151).CopyToClipboard;i.CopyToClipboard=i,t.exports=i},519756,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={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"};var n=e.i(9583),s=r.forwardRef(function(e,s){return r.createElement(n.default,(0,t.default)({},e,{ref:s,icon:i}))});e.s(["UploadOutlined",0,s],519756)},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},500330,e=>{"use strict";var t=e.i(727749);function r(e,t){let r=structuredClone(e);for(let[e,i]of Object.entries(t))e in r&&(r[e]=i);return r}let i=(e,t=0,r=!1,i=!0)=>{if(null==e||!Number.isFinite(e)||0===e&&!i)return"-";let n={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",n);let s=e<0?"-":"",a=Math.abs(e),o=a,l="";return a>=1e6?(o=a/1e6,l="M"):a>=1e3&&(o=a/1e3,l="K"),`${s}${o.toLocaleString("en-US",n)}${l}`},n=async(e,r="Copied to clipboard")=>{if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return s(e,r);try{return await navigator.clipboard.writeText(e),t.default.success(r),!0}catch(t){return console.error("Clipboard API failed: ",t),s(e,r)}},s=(e,r)=>{try{let i=document.createElement("textarea");i.value=e,i.style.position="fixed",i.style.left="-999999px",i.style.top="-999999px",i.setAttribute("readonly",""),document.body.appendChild(i),i.focus(),i.select();let n=document.execCommand("copy");if(document.body.removeChild(i),n)return t.default.success(r),!0;throw Error("execCommand failed")}catch(e){return t.default.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};e.s(["copyToClipboard",0,n,"formatNumberWithCommas",0,i,"getSpendString",0,(e,t=6)=>{if(null==e||!Number.isFinite(e)||0===e)return"-";let r=i(e,t,!1,!1);if(0===Number(r.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return`< $${e}`}return`$${r}`},"updateExistingKeys",()=>r])},663435,152473,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(199133),n=e.i(898586),s=e.i(56456);let a={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class o{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...a,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function l(e,t){let[i,n]=(0,r.useState)(e),s=function(e,t){let[i]=(0,r.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new o(e,t))).filter(e=>"function"==typeof r[e]).reduce((e,t)=>{let i=r[t];return"function"==typeof i&&(e[t]=i.bind(r)),e},{})});return i.setOptions(t),i}(n,t);return[i,s.maybeExecute,s]}e.s(["useDebouncedState",()=>l],152473);var c=e.i(785242);let{Text:d}=n.Typography;e.s(["default",0,({value:e,onChange:n,onTeamSelect:a,disabled:o,organizationId:u,pageSize:h=20})=>{let[f,p]=(0,r.useState)(""),[m,g]=l("",{wait:300}),{data:y,fetchNextPage:x,hasNextPage:b,isFetchingNextPage:_,isLoading:v}=(0,c.useInfiniteTeams)(h,m||void 0,u),w=(0,r.useMemo)(()=>{if(!y?.pages)return[];let e=new Set,t=[];for(let r of y.pages)for(let i of r.teams)e.has(i.team_id)||(e.add(i.team_id),t.push(i));return t},[y]);return(0,t.jsx)(i.Select,{showSearch:!0,placeholder:"Search or select a team",value:e||void 0,onChange:e=>{n?.(e??""),a&&a(e?w.find(t=>t.team_id===e)??null:null)},disabled:o,allowClear:!0,filterOption:!1,onSearch:e=>{p(e),g(e)},searchValue:f,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&b&&!_&&x()},loading:v,notFoundContent:v?(0,t.jsx)(s.LoadingOutlined,{spin:!0}):"No teams found","data-testid":"team-dropdown",popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,_&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(s.LoadingOutlined,{spin:!0})})]}),children:w.map(e=>(0,t.jsxs)(i.Select.Option,{value:e.team_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,t.jsxs)(d,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})}],663435)},107233,37727,e=>{"use strict";var t=e.i(603908);e.s(["Plus",()=>t.default],107233);var r=e.i(841947);e.s(["X",()=>r.default],37727)},361653,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t])},603908,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",()=>t])},841947,e=>{"use strict";let t=(0,e.i(475254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},158392,419470,e=>{"use strict";var t=e.i(843476),r=e.i(311451);let i={ttl:3600,lowest_latency_buffer:0},n=({routingStrategyArgs:e})=>{let n={ttl:"Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Latency-Based Configuration"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Fine-tune latency-based routing behavior"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e||i).map(([e,i])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:e.replace(/_/g," ")}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:n[e]||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:"object"==typeof i?JSON.stringify(i,null,2):i?.toString(),className:"font-mono text-sm w-full"})]})},e))})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"})]})},s=({routerSettings:e,routerFieldsMetadata:i})=>(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Reliability & Retries"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure retry logic and failure handling"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e).filter(([e,t])=>"fallbacks"!=e&&"context_window_fallbacks"!=e&&"routing_strategy_args"!=e&&"routing_strategy"!=e&&"enable_tag_filtering"!=e).map(([e,n])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:i[e]?.ui_field_name||e}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:i[e]?.field_description||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:null==n||"null"===n?"":"object"==typeof n?JSON.stringify(n,null,2):n?.toString()||"",placeholder:"—",className:"font-mono text-sm w-full"})]})},e))})]});var a=e.i(199133);let o=({selectedStrategy:e,availableStrategies:r,routingStrategyDescriptions:i,routerFieldsMetadata:n,onStrategyChange:s})=>(0,t.jsxs)("div",{className:"space-y-2 max-w-3xl",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:n.routing_strategy?.ui_field_name||"Routing Strategy"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:n.routing_strategy?.field_description||""})]}),(0,t.jsx)("div",{className:"routing-strategy-select max-w-3xl",children:(0,t.jsx)(a.Select,{value:e,onChange:s,style:{width:"100%"},size:"large",children:r.map(e=>(0,t.jsx)(a.Select.Option,{value:e,label:e,children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 py-1",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e}),i[e]&&(0,t.jsx)("span",{className:"text-xs text-gray-500 font-normal",children:i[e]})]})},e))})})]});var l=e.i(790848);let c=({enabled:e,routerFieldsMetadata:r,onToggle:i})=>(0,t.jsx)("div",{className:"space-y-3 max-w-3xl",children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:r.enable_tag_filtering?.ui_field_name||"Enable Tag Filtering"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[r.enable_tag_filtering?.field_description||"",r.enable_tag_filtering?.link&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("a",{href:r.enable_tag_filtering.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Learn more"})]})]})]}),(0,t.jsx)(l.Switch,{checked:e,onChange:i,className:"ml-4"})]})});e.s(["default",0,({value:e,onChange:r,routerFieldsMetadata:i,availableRoutingStrategies:a,routingStrategyDescriptions:l})=>(0,t.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Routing Settings"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure how requests are routed to deployments"})]}),a.length>0&&(0,t.jsx)(o,{selectedStrategy:e.selectedStrategy||e.routerSettings.routing_strategy||null,availableStrategies:a,routingStrategyDescriptions:l,routerFieldsMetadata:i,onStrategyChange:t=>{r({...e,selectedStrategy:t})}}),(0,t.jsx)(c,{enabled:e.enableTagFiltering,routerFieldsMetadata:i,onToggle:t=>{r({...e,enableTagFiltering:t})}})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),"latency-based-routing"===e.selectedStrategy&&(0,t.jsx)(n,{routingStrategyArgs:e.routerSettings.routing_strategy_args}),(0,t.jsx)(s,{routerSettings:e.routerSettings,routerFieldsMetadata:i})]})],158392);var d=e.i(994388),u=e.i(653496),h=e.i(107233),f=e.i(271645),p=e.i(888259),m=e.i(592968),g=e.i(361653),g=g;let y=(0,e.i(475254).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var x=e.i(37727);function b({group:e,onChange:r,availableModels:i,maxFallbacks:n}){let s=i.filter(t=>t!==e.primaryModel),o=e.fallbackModels.length{let i=[...e.fallbackModels];i.includes(t)&&(i=i.filter(e=>e!==t)),r({...e,primaryModel:t,fallbackModels:i})},showSearch:!0,getPopupContainer:e=>e.parentElement||document.body,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:i.map(e=>({label:e,value:e}))}),!e.primaryModel&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-amber-600 text-xs bg-amber-50 p-2 rounded",children:[(0,t.jsx)(g.default,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Select a model to begin configuring fallbacks"})]})]}),(0,t.jsx)("div",{className:"flex items-center justify-center -my-4 z-10",children:(0,t.jsxs)("div",{className:"bg-indigo-50 text-indigo-500 px-4 py-1 rounded-full text-xs font-bold border border-indigo-100 flex items-center gap-2 shadow-sm",children:[(0,t.jsx)(y,{className:"w-4 h-4"}),"IF FAILS, TRY..."]})}),(0,t.jsxs)("div",{className:`transition-opacity duration-300 ${!e.primaryModel?"opacity-50 pointer-events-none":"opacity-100"}`,children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Fallback Chain ",(0,t.jsx)("span",{className:"text-red-500",children:"*"}),(0,t.jsxs)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:["(Max ",n," fallbacks at a time)"]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-200",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(a.Select,{mode:"multiple",className:"w-full",size:"large",placeholder:o?"Select fallback models to add...":`Maximum ${n} fallbacks reached`,value:e.fallbackModels,onChange:t=>{let i=t.slice(0,n);r({...e,fallbackModels:i})},disabled:!e.primaryModel,getPopupContainer:e=>e.parentElement||document.body,options:s.map(e=>({label:e,value:e})),optionRender:(r,i)=>{let n=e.fallbackModels.includes(r.value),s=n?e.fallbackModels.indexOf(r.value)+1:null;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[n&&null!==s&&(0,t.jsx)("span",{className:"flex items-center justify-center w-5 h-5 rounded bg-indigo-100 text-indigo-600 text-xs font-bold",children:s}),(0,t.jsx)("span",{children:r.label})]})},maxTagCount:"responsive",maxTagPlaceholder:e=>(0,t.jsx)(m.Tooltip,{styles:{root:{pointerEvents:"none"}},title:e.map(({value:e})=>e).join(", "),children:(0,t.jsxs)("span",{children:["+",e.length," more"]})}),showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1 ml-1",children:o?`Search and select multiple models. Selected models will appear below in order. (${e.fallbackModels.length}/${n} used)`:`Maximum ${n} fallbacks reached. Remove some to add more.`})]}),(0,t.jsx)("div",{className:"space-y-2 min-h-[100px]",children:0===e.fallbackModels.length?(0,t.jsxs)("div",{className:"h-32 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)("span",{className:"text-sm",children:"No fallback models selected"}),(0,t.jsx)("span",{className:"text-xs mt-1",children:"Add models from the dropdown above"})]}):e.fallbackModels.map((i,n)=>(0,t.jsxs)("div",{className:"group flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200 hover:border-indigo-300 hover:shadow-sm transition-all",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded bg-gray-100 text-gray-400 group-hover:text-indigo-500 group-hover:bg-indigo-50",children:(0,t.jsx)("span",{className:"text-xs font-bold",children:n+1})}),(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"font-medium text-gray-800",children:i})})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t;return t=e.fallbackModels.filter((e,t)=>t!==n),void r({...e,fallbackModels:t})},className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-400 hover:text-red-500 p-1",children:(0,t.jsx)(x.X,{className:"w-4 h-4"})})]},`${i}-${n}`))})]})]})]})}function _({groups:e,onGroupsChange:r,availableModels:i,maxFallbacks:n=10,maxGroups:s=5}){let[a,o]=(0,f.useState)(e.length>0?e[0].id:"1");(0,f.useEffect)(()=>{e.length>0?e.some(e=>e.id===a)||o(e[0].id):o("1")},[e]);let l=()=>{if(e.length>=s)return;let t=Date.now().toString();r([...e,{id:t,primaryModel:null,fallbackModels:[]}]),o(t)},c=t=>{r(e.map(e=>e.id===t.id?t:e))},m=e.map((r,s)=>{let a=r.primaryModel?r.primaryModel:`Group ${s+1}`;return{key:r.id,label:a,closable:e.length>1,children:(0,t.jsx)(b,{group:r,onChange:c,availableModels:i,maxFallbacks:n})}});return 0===e.length?(0,t.jsxs)("div",{className:"text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300",children:[(0,t.jsx)("p",{className:"text-gray-500 mb-4",children:"No fallback groups configured"}),(0,t.jsx)(d.Button,{variant:"primary",onClick:l,icon:()=>(0,t.jsx)(h.Plus,{className:"w-4 h-4"}),children:"Create First Group"})]}):(0,t.jsx)(u.Tabs,{type:"editable-card",activeKey:a,onChange:o,onEdit:(t,i)=>{"add"===i?l():"remove"===i&&e.length>1&&(t=>{if(1===e.length)return p.default.warning("At least one group is required");let i=e.filter(e=>e.id!==t);r(i),a===t&&i.length>0&&o(i[i.length-1].id)})(t)},items:m,className:"fallback-tabs",tabBarStyle:{marginBottom:0},hideAdd:e.length>=s})}e.s(["FallbackSelectionForm",()=>_],419470)},689020,e=>{"use strict";var t=e.i(764205);let r=async e=>{try{let r=await (0,t.modelHubCall)(e);if(console.log("model_info:",r),r?.data.length>0){let e=r.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,r])},737434,e=>{"use strict";var t=e.i(184163);e.s(["DownloadOutlined",()=>t.default])},916940,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(199133),n=e.i(764205);e.s(["default",0,({onChange:e,value:s,className:a,accessToken:o,placeholder:l="Select vector stores",disabled:c=!1})=>{let[d,u]=(0,r.useState)([]),[h,f]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){f(!0);try{let e=await (0,n.vectorStoreListCall)(o);e.data&&u(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{f(!1)}}})()},[o]),(0,t.jsx)("div",{children:(0,t.jsx)(i.Select,{mode:"multiple",placeholder:l,onChange:e,value:s,loading:h,className:a,allowClear:!0,options:d.map(e=>({label:`${e.vector_store_name||e.vector_store_id} (${e.vector_store_id})`,value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:c})})}])},59935,(e,t,r)=>{var i;let n;e.e,i=function e(){var t,r="u">typeof self?self:"u">typeof window?window:void 0!==r?r:{},i=!r.document&&!!r.postMessage,n=r.IS_PAPA_WORKER||!1,s={},a=0,o={};function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new f(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview,n)r.postMessage({results:s,workerId:o.WORKER_ID,finished:i});else if(v(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=s=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!i||!v(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),i||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){v(this._config.error)?this._config.error(e):n&&this._config.error&&r.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),l.call(this,e),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),i||(t.onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var e,r,n=this._config.downloadRequestHeaders;for(r in n)t.setRequestHeader(r,n[r])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}i&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function d(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),l.call(this,e);var t,r,i="u">typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,i?((t=new FileReader).onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function u(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,r;if(!this._finished)return t=(e=this._config.chunkSize)?(r=t.substring(0,e),t.substring(e)):(r=t,""),this._finished=!t,this.parseChunk(r)}}function h(e){l.call(this,e=e||{});var t=[],r=!0,i=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=_(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=_(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=_(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=_(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function f(e){var t,r,i,n,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,c=0,d=0,u=!1,h=!1,f=[],g={data:[],errors:[],meta:{}};function y(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function x(){if(g&&i&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),i=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!y(e)})),_()){if(g)if(Array.isArray(g.data[0])){for(var t,r=0;_()&&r(e.dynamicTypingFunction&&void 0===e.dynamicTyping[t]&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping))?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&((e=>{if(s.test(e)&&-0x20000000000000<(e=parseFloat(e))&&e<0x20000000000000)return 1})(r)?parseFloat(r):a.test(r)?new Date(r):""===r?null:r):r)(o=e.header?n>=f.length?"__parsed_extra":f[n]:o,l=e.transform?e.transform(l,o):l);"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(l)):i[o]=l}return e.header&&(n>f.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+f.length+" fields but parsed "+n,d+r):ne.preview?r.abort():(g.data=g.data[0],n(g,l))))}),this.parse=function(n,s,a){var l=e.quoteChar||'"',l=(e.newline||(e.newline=this.guessLineEndings(n,l)),i=!1,e.delimiter?v(e.delimiter)&&(e.delimiter=e.delimiter(n),g.meta.delimiter=e.delimiter):((l=((t,r,i,n,s)=>{var a,l,c,d;s=s||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var u=0;u=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,r=e.newline,i=e.comments,n=e.step,s=e.preview,a=e.fastMode,l=null,c=!1,d=null==e.quoteChar?'"':e.quoteChar,u=d;if(void 0!==e.escapeChar&&(u=e.escapeChar),("string"!=typeof t||-1=s)return D(!0);break}j.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:k.length,index:h}),M++}}else if(i&&0===C.length&&o.substring(h,h+_)===i){if(-1===R)return D();h=R+b,R=o.indexOf(r,h),E=o.indexOf(t,h)}else if(-1!==E&&(E=s)return D(!0)}return A();function P(e){k.push(e),S=h}function F(e){return -1!==e&&(e=o.substring(M+1,e))&&""===e.trim()?e.length:0}function A(e){return g||(void 0===e&&(e=o.substring(h)),C.push(e),h=y,P(C),w&&z()),D()}function I(e){h=e,P(C),C=[],R=o.indexOf(r,h)}function D(i){if(e.header&&!m&&k.length&&!c){var n=k[0],s=Object.create(null),a=new Set(n);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(n=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(r=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(i=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");d=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+a),t.escapeFormulae instanceof RegExp?u=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(u=/^[=+\-@\t\r].*$/)}})(),RegExp(p(a),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(d||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||d),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function f(e,t,r){var a="",o=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var r=0;r{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let 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"};var r=e.i(9583),l=s.forwardRef(function(e,l){return s.createElement(r.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["TeamOutlined",0,l],645526)},109799,e=>{"use strict";var t=e.i(135214),s=e.i(764205),a=e.i(266027),r=e.i(912598);let l=(0,e.i(243652).createQueryKeys)("organizations");e.s(["organizationKeys",0,l,"useOrganization",0,e=>{let i=(0,r.useQueryClient)(),{accessToken:n}=(0,t.default)();return(0,a.useQuery)({queryKey:l.detail(e),enabled:!!(n&&e),queryFn:async()=>{if(!n||!e)throw Error("Missing auth or teamId");return(0,s.organizationInfoCall)(n,e)},initialData:()=>{if(!e)return;let t=i.getQueryData(l.list({}));return t?.find(t=>t.organization_id===e)}})},"useOrganizations",0,()=>{let{accessToken:e,userId:r,userRole:i}=(0,t.default)();return(0,a.useQuery)({queryKey:l.list({}),queryFn:async()=>await (0,s.organizationListCall)(e),enabled:!!(e&&r&&i)})}])},993914,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let 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"};var r=e.i(9583),l=s.forwardRef(function(e,l){return s.createElement(r.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["FileTextOutlined",0,l],993914)},631171,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",()=>t])},621482,e=>{"use strict";var t=e.i(869230),s=e.i(992571),a=class extends t.QueryObserver{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:(0,s.infiniteQueryBehavior)()})}getOptimisticResult(e){return e.behavior=(0,s.infiniteQueryBehavior)(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:a}=e,r=super.createResult(e,t),{isFetching:l,isRefetching:i,isError:n,isRefetchError:o}=r,d=a.fetchMeta?.fetchMore?.direction,c=n&&"forward"===d,u=l&&"forward"===d,m=n&&"backward"===d,p=l&&"backward"===d;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,s.hasNextPage)(t,a.data),hasPreviousPage:(0,s.hasPreviousPage)(t,a.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:m,isFetchingPreviousPage:p,isRefetchError:o&&!c&&!m,isRefetching:i&&!u&&!p}}},r=e.i(469637);function l(e,t){return(0,r.useBaseQuery)(e,a,t)}e.s(["useInfiniteQuery",()=>l],621482)},785242,270345,e=>{"use strict";var t=e.i(619273),s=e.i(621482),a=e.i(266027),r=e.i(912598),l=e.i(135214),i=e.i(764205);let n=async(e,t,s,a)=>"Admin"!=s&&"Admin Viewer"!=s?await (0,i.teamListCall)(e,a?.organization_id||null,t):await (0,i.teamListCall)(e,a?.organization_id||null);e.s(["fetchTeams",0,n],270345);var o=e.i(243652);let d=async(e,t,s,a={})=>{try{let r=(0,i.getProxyBaseUrl)(),l=new URLSearchParams(Object.entries({team_id:a.teamID,organization_id:a.organizationID,team_alias:a.team_alias,user_id:a.userID,page:t,page_size:s,sort_by:a.sortBy,sort_order:a.sortOrder,status:a.status}).filter(([,e])=>null!=e).map(([e,t])=>[e,String(t)])),n=`${r?`${r}/v2/team/list`:"/v2/team/list"}?${l}`,o=await fetch(n,{method:"GET",headers:{[(0,i.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=(0,i.deriveErrorMessage)(e);throw(0,i.handleError)(t),Error(t)}let d=await o.json();return console.log("/v2/team/list API Response:",d),d}catch(e){throw console.error("Failed to list teams:",e),e}},c=(0,o.createQueryKeys)("teams"),u=(0,o.createQueryKeys)("infiniteTeams"),m=async(e,t,s,a={})=>{try{let r=(0,i.getProxyBaseUrl)(),l=new URLSearchParams(Object.entries({team_id:a.teamID,organization_id:a.organizationID,team_alias:a.team_alias,user_id:a.userID,page:t,page_size:s,sort_by:a.sortBy,sort_order:a.sortOrder,status:"deleted"}).filter(([,e])=>null!=e).map(([e,t])=>[e,String(t)])),n=`${r?`${r}/v2/team/list`:"/v2/team/list"}?${l}`,o=await fetch(n,{method:"GET",headers:{[(0,i.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=(0,i.deriveErrorMessage)(e);throw(0,i.handleError)(t),Error(t)}let d=await o.json();if(console.log("/team/list?status=deleted API Response:",d),d&&"object"==typeof d&&"teams"in d)return d.teams;return d}catch(e){throw console.error("Failed to list deleted teams:",e),e}},p=(0,o.createQueryKeys)("deletedTeams");e.s(["teamListCall",0,d,"useDeletedTeams",0,(e,s,r={})=>{let{accessToken:i}=(0,l.default)();return(0,a.useQuery)({queryKey:p.list({page:e,limit:s,...r}),queryFn:async()=>await m(i,e,s,r),enabled:!!i,staleTime:3e4,placeholderData:t.keepPreviousData})},"useInfiniteTeams",0,(e=50,t,a)=>{let{accessToken:r,userId:i,userRole:n}=(0,l.default)(),o="Admin"===n||"Admin Viewer"===n;return(0,s.useInfiniteQuery)({queryKey:u.list({filters:{pageSize:e,...t&&{search:t},...a&&{organizationId:a},...i&&{userId:i}}}),queryFn:async({pageParam:s})=>await d(r,s,e,{team_alias:t||void 0,organizationID:a,userID:o?void 0:i}),initialPageParam:1,getNextPageParam:e=>{if(e.page{let{accessToken:t}=(0,l.default)(),s=(0,r.useQueryClient)();return(0,a.useQuery)({queryKey:c.detail(e),enabled:!!(t&&e),queryFn:async()=>{if(!t||!e)throw Error("Missing auth or teamId");return(0,i.teamInfoCall)(t,e)},initialData:()=>{if(!e)return;let t=s.getQueryData(c.list({}));return t?.find(t=>t.team_id===e)}})},"useTeams",0,()=>{let{accessToken:e,userId:t,userRole:s}=(0,l.default)();return(0,a.useQuery)({queryKey:c.list({}),queryFn:async()=>await n(e,t,s,null),enabled:!!e})}],785242)},107233,37727,e=>{"use strict";var t=e.i(603908);e.s(["Plus",()=>t.default],107233);var s=e.i(841947);e.s(["X",()=>s.default],37727)},361653,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t])},841947,e=>{"use strict";let t=(0,e.i(475254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},603908,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",()=>t])},158392,419470,e=>{"use strict";var t=e.i(843476),s=e.i(311451);let a={ttl:3600,lowest_latency_buffer:0},r=({routingStrategyArgs:e})=>{let r={ttl:"Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Latency-Based Configuration"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Fine-tune latency-based routing behavior"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e||a).map(([e,a])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:e.replace(/_/g," ")}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:r[e]||""}),(0,t.jsx)(s.Input,{name:e,defaultValue:"object"==typeof a?JSON.stringify(a,null,2):a?.toString(),className:"font-mono text-sm w-full"})]})},e))})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"})]})},l=({routerSettings:e,routerFieldsMetadata:a})=>(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Reliability & Retries"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure retry logic and failure handling"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e).filter(([e,t])=>"fallbacks"!=e&&"context_window_fallbacks"!=e&&"routing_strategy_args"!=e&&"routing_strategy"!=e&&"enable_tag_filtering"!=e).map(([e,r])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:a[e]?.ui_field_name||e}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:a[e]?.field_description||""}),(0,t.jsx)(s.Input,{name:e,defaultValue:null==r||"null"===r?"":"object"==typeof r?JSON.stringify(r,null,2):r?.toString()||"",placeholder:"—",className:"font-mono text-sm w-full"})]})},e))})]});var i=e.i(199133);let n=({selectedStrategy:e,availableStrategies:s,routingStrategyDescriptions:a,routerFieldsMetadata:r,onStrategyChange:l})=>(0,t.jsxs)("div",{className:"space-y-2 max-w-3xl",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:r.routing_strategy?.ui_field_name||"Routing Strategy"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:r.routing_strategy?.field_description||""})]}),(0,t.jsx)("div",{className:"routing-strategy-select max-w-3xl",children:(0,t.jsx)(i.Select,{value:e,onChange:l,style:{width:"100%"},size:"large",children:s.map(e=>(0,t.jsx)(i.Select.Option,{value:e,label:e,children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 py-1",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e}),a[e]&&(0,t.jsx)("span",{className:"text-xs text-gray-500 font-normal",children:a[e]})]})},e))})})]});var o=e.i(790848);let d=({enabled:e,routerFieldsMetadata:s,onToggle:a})=>(0,t.jsx)("div",{className:"space-y-3 max-w-3xl",children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:s.enable_tag_filtering?.ui_field_name||"Enable Tag Filtering"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[s.enable_tag_filtering?.field_description||"",s.enable_tag_filtering?.link&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("a",{href:s.enable_tag_filtering.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Learn more"})]})]})]}),(0,t.jsx)(o.Switch,{checked:e,onChange:a,className:"ml-4"})]})});e.s(["default",0,({value:e,onChange:s,routerFieldsMetadata:a,availableRoutingStrategies:i,routingStrategyDescriptions:o})=>(0,t.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Routing Settings"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure how requests are routed to deployments"})]}),i.length>0&&(0,t.jsx)(n,{selectedStrategy:e.selectedStrategy||e.routerSettings.routing_strategy||null,availableStrategies:i,routingStrategyDescriptions:o,routerFieldsMetadata:a,onStrategyChange:t=>{s({...e,selectedStrategy:t})}}),(0,t.jsx)(d,{enabled:e.enableTagFiltering,routerFieldsMetadata:a,onToggle:t=>{s({...e,enableTagFiltering:t})}})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),"latency-based-routing"===e.selectedStrategy&&(0,t.jsx)(r,{routingStrategyArgs:e.routerSettings.routing_strategy_args}),(0,t.jsx)(l,{routerSettings:e.routerSettings,routerFieldsMetadata:a})]})],158392);var c=e.i(994388),u=e.i(653496),m=e.i(107233),p=e.i(271645),h=e.i(888259),g=e.i(592968),f=e.i(361653),f=f;let x=(0,e.i(475254).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var y=e.i(37727);function b({group:e,onChange:s,availableModels:a,maxFallbacks:r}){let l=a.filter(t=>t!==e.primaryModel),n=e.fallbackModels.length{let a=[...e.fallbackModels];a.includes(t)&&(a=a.filter(e=>e!==t)),s({...e,primaryModel:t,fallbackModels:a})},showSearch:!0,getPopupContainer:e=>e.parentElement||document.body,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:a.map(e=>({label:e,value:e}))}),!e.primaryModel&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-amber-600 text-xs bg-amber-50 p-2 rounded",children:[(0,t.jsx)(f.default,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Select a model to begin configuring fallbacks"})]})]}),(0,t.jsx)("div",{className:"flex items-center justify-center -my-4 z-10",children:(0,t.jsxs)("div",{className:"bg-indigo-50 text-indigo-500 px-4 py-1 rounded-full text-xs font-bold border border-indigo-100 flex items-center gap-2 shadow-sm",children:[(0,t.jsx)(x,{className:"w-4 h-4"}),"IF FAILS, TRY..."]})}),(0,t.jsxs)("div",{className:`transition-opacity duration-300 ${!e.primaryModel?"opacity-50 pointer-events-none":"opacity-100"}`,children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Fallback Chain ",(0,t.jsx)("span",{className:"text-red-500",children:"*"}),(0,t.jsxs)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:["(Max ",r," fallbacks at a time)"]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-200",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(i.Select,{mode:"multiple",className:"w-full",size:"large",placeholder:n?"Select fallback models to add...":`Maximum ${r} fallbacks reached`,value:e.fallbackModels,onChange:t=>{let a=t.slice(0,r);s({...e,fallbackModels:a})},disabled:!e.primaryModel,getPopupContainer:e=>e.parentElement||document.body,options:l.map(e=>({label:e,value:e})),optionRender:(s,a)=>{let r=e.fallbackModels.includes(s.value),l=r?e.fallbackModels.indexOf(s.value)+1:null;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r&&null!==l&&(0,t.jsx)("span",{className:"flex items-center justify-center w-5 h-5 rounded bg-indigo-100 text-indigo-600 text-xs font-bold",children:l}),(0,t.jsx)("span",{children:s.label})]})},maxTagCount:"responsive",maxTagPlaceholder:e=>(0,t.jsx)(g.Tooltip,{styles:{root:{pointerEvents:"none"}},title:e.map(({value:e})=>e).join(", "),children:(0,t.jsxs)("span",{children:["+",e.length," more"]})}),showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1 ml-1",children:n?`Search and select multiple models. Selected models will appear below in order. (${e.fallbackModels.length}/${r} used)`:`Maximum ${r} fallbacks reached. Remove some to add more.`})]}),(0,t.jsx)("div",{className:"space-y-2 min-h-[100px]",children:0===e.fallbackModels.length?(0,t.jsxs)("div",{className:"h-32 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)("span",{className:"text-sm",children:"No fallback models selected"}),(0,t.jsx)("span",{className:"text-xs mt-1",children:"Add models from the dropdown above"})]}):e.fallbackModels.map((a,r)=>(0,t.jsxs)("div",{className:"group flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200 hover:border-indigo-300 hover:shadow-sm transition-all",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded bg-gray-100 text-gray-400 group-hover:text-indigo-500 group-hover:bg-indigo-50",children:(0,t.jsx)("span",{className:"text-xs font-bold",children:r+1})}),(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"font-medium text-gray-800",children:a})})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t;return t=e.fallbackModels.filter((e,t)=>t!==r),void s({...e,fallbackModels:t})},className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-400 hover:text-red-500 p-1",children:(0,t.jsx)(y.X,{className:"w-4 h-4"})})]},`${a}-${r}`))})]})]})]})}function v({groups:e,onGroupsChange:s,availableModels:a,maxFallbacks:r=10,maxGroups:l=5}){let[i,n]=(0,p.useState)(e.length>0?e[0].id:"1");(0,p.useEffect)(()=>{e.length>0?e.some(e=>e.id===i)||n(e[0].id):n("1")},[e]);let o=()=>{if(e.length>=l)return;let t=Date.now().toString();s([...e,{id:t,primaryModel:null,fallbackModels:[]}]),n(t)},d=t=>{s(e.map(e=>e.id===t.id?t:e))},g=e.map((s,l)=>{let i=s.primaryModel?s.primaryModel:`Group ${l+1}`;return{key:s.id,label:i,closable:e.length>1,children:(0,t.jsx)(b,{group:s,onChange:d,availableModels:a,maxFallbacks:r})}});return 0===e.length?(0,t.jsxs)("div",{className:"text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300",children:[(0,t.jsx)("p",{className:"text-gray-500 mb-4",children:"No fallback groups configured"}),(0,t.jsx)(c.Button,{variant:"primary",onClick:o,icon:()=>(0,t.jsx)(m.Plus,{className:"w-4 h-4"}),children:"Create First Group"})]}):(0,t.jsx)(u.Tabs,{type:"editable-card",activeKey:i,onChange:n,onEdit:(t,a)=>{"add"===a?o():"remove"===a&&e.length>1&&(t=>{if(1===e.length)return h.default.warning("At least one group is required");let a=e.filter(e=>e.id!==t);s(a),i===t&&a.length>0&&n(a[a.length-1].id)})(t)},items:g,className:"fallback-tabs",tabBarStyle:{marginBottom:0},hideAdd:e.length>=l})}e.s(["FallbackSelectionForm",()=>v],419470)},409797,e=>{"use strict";var t=e.i(631171);e.s(["ChevronDownIcon",()=>t.default])},246349,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",()=>t])},500727,699857,696609,531516,e=>{"use strict";var t=e.i(266027),s=e.i(243652),a=e.i(764205),r=e.i(135214);let l=(0,s.createQueryKeys)("mcpServers");e.s(["useMCPServers",0,e=>{let{accessToken:s}=(0,r.default)();return(0,t.useQuery)({queryKey:l.list(e?{filters:{teamId:e}}:void 0),queryFn:async()=>await (0,a.fetchMCPServers)(s,e),enabled:!!s})}],500727);let i=(0,s.createQueryKeys)("mcpToolsets");e.s(["useMCPToolsets",0,()=>{let{accessToken:e}=(0,r.default)();return(0,t.useQuery)({queryKey:i.list(),queryFn:async()=>await (0,a.fetchMCPToolsets)(e),enabled:!!e})}],699857);var n=e.i(843476),o=e.i(271645),d=e.i(536916),c=e.i(599724),u=e.i(409797),m=e.i(246349),m=m;let p=/\b(delete|remove|destroy|purge|drop|erase|unlink)\b/i,h=/\b(create|add|insert|new|post|submit|register|make|generate|write|upload)\b/i,g=/\b(update|edit|modify|change|patch|put|set|rename|move|transform)\b/i,f=/\b(get|read|list|fetch|search|find|query|retrieve|show|view|check|describe|info)\b/i;function x(e,t=""){let s=e.toLowerCase();if(f.test(s))return"read";if(p.test(s))return"delete";if(g.test(s))return"update";if(h.test(s))return"create";if(t){let e=t.toLowerCase();if(f.test(e))return"read";if(p.test(e))return"delete";if(g.test(e))return"update";if(h.test(e))return"create"}return"unknown"}function y(e){let t={read:[],create:[],update:[],delete:[],unknown:[]};for(let s of e)t[x(s.name,s.description)].push(s);return t}let b={read:{label:"Read",description:"Safe operations — fetch, list, search. No side effects.",risk:"low"},create:{label:"Create",description:"Add new resources — insert, upload, register.",risk:"medium"},update:{label:"Update",description:"Modify existing resources — edit, patch, rename.",risk:"medium"},delete:{label:"Delete",description:"Destructive operations — remove, purge, destroy.",risk:"high"},unknown:{label:"Other",description:"Operations that could not be automatically classified.",risk:"unknown"}};e.s(["CRUD_GROUP_META",0,b,"classifyToolOp",()=>x,"groupToolsByCrud",()=>y],696609);let v=["read","create","update","delete","unknown"],_={low:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-red-100 text-red-800 font-semibold",unknown:"bg-gray-100 text-gray-700"},j={read:"border-green-200",create:"border-blue-200",update:"border-yellow-200",delete:"border-red-300",unknown:"border-gray-200"},w={read:"bg-green-50",create:"bg-blue-50",update:"bg-yellow-50",delete:"bg-red-50",unknown:"bg-gray-50"};e.s(["default",0,({tools:e,value:t,onChange:s,readOnly:a=!1,searchFilter:r=""})=>{let[l,i]=(0,o.useState)({read:!1,create:!1,update:!1,delete:!1,unknown:!0}),p=(0,o.useMemo)(()=>y(e),[e]),h=(0,o.useMemo)(()=>new Set(void 0===t?e.map(e=>e.name):t),[t,e]),g=e=>{if(a)return;let t=new Set(h);t.has(e)?t.delete(e):t.add(e),s(Array.from(t))};return 0===e.length?null:(0,n.jsx)("div",{className:"space-y-3",children:v.map(e=>{let t,o=p[e];if(0===o.length)return null;if(r){let e=r.toLowerCase();if(!o.some(t=>t.name.toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)))return null}let f=b[e],x=(t=p[e]).length>0&&t.every(e=>h.has(e.name)),y=(e=>{let t=p[e];if(0===t.length)return!1;let s=t.filter(e=>h.has(e.name)).length;return s>0&&s{i(t=>({...t,[e]:!t[e]}))},children:[v?(0,n.jsx)(m.default,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}):(0,n.jsx)(u.ChevronDownIcon,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}),(0,n.jsx)("span",{className:"font-semibold text-gray-900 text-sm",children:f.label}),(0,n.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full ${_[f.risk]}`,children:"high"===f.risk?"High Risk":"medium"===f.risk?"Medium Risk":"low"===f.risk?"Safe":"Unclassified"}),(0,n.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:[o.filter(e=>h.has(e.name)).length,"/",o.length," allowed"]})]}),!a&&(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,n.jsx)(c.Text,{className:"text-xs text-gray-500",children:x?"All on":y?"Partial":"All off"}),(0,n.jsx)(d.Checkbox,{checked:x,indeterminate:y,onChange:t=>((e,t)=>{if(a)return;let r=new Set(h);for(let s of p[e])t?r.add(s.name):r.delete(s.name);s(Array.from(r))})(e,t.target.checked),onClick:e=>e.stopPropagation()})]})]}),!v&&(0,n.jsx)("div",{className:"px-4 pt-2 pb-1 text-xs text-gray-500 bg-white border-b border-gray-100",children:f.description}),!v&&(0,n.jsx)("div",{className:"bg-white divide-y divide-gray-50",children:o.filter(e=>!r||e.name.toLowerCase().includes(r.toLowerCase())||(e.description??"").toLowerCase().includes(r.toLowerCase())).map(e=>{let t,s=(t=e.name,h.has(t));return(0,n.jsxs)("div",{className:`flex items-start gap-3 px-4 py-2.5 transition-colors hover:bg-gray-50 ${!a?"cursor-pointer":""} ${s?"":"opacity-60"}`,onClick:()=>g(e.name),children:[(0,n.jsx)(d.Checkbox,{checked:s,onChange:()=>g(e.name),disabled:a,onClick:e=>e.stopPropagation()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)(c.Text,{className:"font-medium text-gray-900 text-sm",children:e.name}),e.description&&(0,n.jsx)(c.Text,{className:"text-xs text-gray-500 mt-0.5 leading-snug",children:e.description})]}),(0,n.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${s?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:s?"on":"off"})]},e.name)})})]},e)})})}],531516)},91739,e=>{"use strict";var t=e.i(544195);e.s(["Radio",()=>t.default])},988297,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.s(["PlusIcon",0,s],988297)},797672,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});e.s(["PencilIcon",0,s],797672)},992619,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(779241),r=e.i(599724),l=e.i(199133),i=e.i(983561),n=e.i(689020);e.s(["default",0,({accessToken:e,value:o,placeholder:d="Select a Model",onChange:c,disabled:u=!1,style:m,className:p,showLabel:h=!0,labelText:g="Select Model"})=>{let[f,x]=(0,s.useState)(o),[y,b]=(0,s.useState)(!1),[v,_]=(0,s.useState)([]),j=(0,s.useRef)(null);return(0,s.useEffect)(()=>{x(o)},[o]),(0,s.useEffect)(()=>{e&&(async()=>{try{let t=await (0,n.fetchAvailableModels)(e);console.log("Fetched models for selector:",t),t.length>0&&_(t)}catch(e){console.error("Error fetching model info:",e)}})()},[e]),(0,t.jsxs)("div",{children:[h&&(0,t.jsxs)(r.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(i.RobotOutlined,{className:"mr-2"})," ",g]}),(0,t.jsx)(l.Select,{value:f,placeholder:d,onChange:e=>{"custom"===e?(b(!0),x(void 0)):(b(!1),x(e),c&&c(e))},options:[...Array.from(new Set(v.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...m},showSearch:!0,className:`rounded-md ${p||""}`,disabled:u}),y&&(0,t.jsx)(a.TextInput,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{x(e),c&&c(e)},500)},disabled:u})]})}])},689020,e=>{"use strict";var t=e.i(764205);let s=async e=>{try{let s=await (0,t.modelHubCall)(e);if(console.log("model_info:",s),s?.data.length>0){let e=s.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,s])},983561,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let 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"};var r=e.i(9583),l=s.forwardRef(function(e,l){return s.createElement(r.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["RobotOutlined",0,l],983561)},500330,e=>{"use strict";var t=e.i(727749);function s(e,t){let s=structuredClone(e);for(let[e,a]of Object.entries(t))e in s&&(s[e]=a);return s}let a=(e,t=0,s=!1,a=!0)=>{if(null==e||!Number.isFinite(e)||0===e&&!a)return"-";let r={minimumFractionDigits:t,maximumFractionDigits:t};if(!s)return e.toLocaleString("en-US",r);let l=e<0?"-":"",i=Math.abs(e),n=i,o="";return i>=1e6?(n=i/1e6,o="M"):i>=1e3&&(n=i/1e3,o="K"),`${l}${n.toLocaleString("en-US",r)}${o}`},r=async(e,s="Copied to clipboard")=>{if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return l(e,s);try{return await navigator.clipboard.writeText(e),t.default.success(s),!0}catch(t){return console.error("Clipboard API failed: ",t),l(e,s)}},l=(e,s)=>{try{let a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",a.setAttribute("readonly",""),document.body.appendChild(a),a.focus(),a.select();let r=document.execCommand("copy");if(document.body.removeChild(a),r)return t.default.success(s),!0;throw Error("execCommand failed")}catch(e){return t.default.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};e.s(["copyToClipboard",0,r,"formatNumberWithCommas",0,a,"getSpendString",0,(e,t=6)=>{if(null==e||!Number.isFinite(e)||0===e)return"-";let s=a(e,t,!1,!1);if(0===Number(s.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return`< $${e}`}return`$${s}`},"updateExistingKeys",()=>s])},350967,46757,e=>{"use strict";var t=e.i(290571),s=e.i(444755),a=e.i(673706),r=e.i(271645);let l={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},i={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},n={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},o={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},d={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},c={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},u={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},m={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};e.s(["colSpan",()=>d,"colSpanLg",()=>m,"colSpanMd",()=>u,"colSpanSm",()=>c,"gridCols",()=>l,"gridColsLg",()=>o,"gridColsMd",()=>n,"gridColsSm",()=>i],46757);let p=(0,a.makeClassName)("Grid"),h=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",g=r.default.forwardRef((e,a)=>{let{numItems:d=1,numItemsSm:c,numItemsMd:u,numItemsLg:m,children:g,className:f}=e,x=(0,t.__rest)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),y=h(d,l),b=h(c,i),v=h(u,n),_=h(m,o),j=(0,s.tremorTwMerge)(y,b,v,_);return r.default.createElement("div",Object.assign({ref:a,className:(0,s.tremorTwMerge)(p("root"),"grid",j,f)},x),g)});g.displayName="Grid",e.s(["Grid",()=>g],350967)},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},309426,e=>{"use strict";var t=e.i(290571),s=e.i(444755),a=e.i(673706),r=e.i(271645),l=e.i(46757);let i=(0,a.makeClassName)("Col"),n=r.default.forwardRef((e,a)=>{let n,o,d,c,{numColSpan:u=1,numColSpanSm:m,numColSpanMd:p,numColSpanLg:h,children:g,className:f}=e,x=(0,t.__rest)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),y=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return r.default.createElement("div",Object.assign({ref:a,className:(0,s.tremorTwMerge)(i("root"),(n=y(u,l.colSpan),o=y(m,l.colSpanSm),d=y(p,l.colSpanMd),c=y(h,l.colSpanLg),(0,s.tremorTwMerge)(n,o,d,c)),f)},x),g)});n.displayName="Col",e.s(["Col",()=>n],309426)},677667,674175,886148,543086,e=>{"use strict";let t,s;var a,r=e.i(290571),l=e.i(429427),i=e.i(371330),n=e.i(271645),o=e.i(394487),d=e.i(914189),c=e.i(144279),u=e.i(294316),m=e.i(83733);let p=(0,n.createContext)(()=>{});function h({value:e,children:t}){return n.default.createElement(p.Provider,{value:e},t)}e.s(["CloseProvider",()=>h],674175);var g=e.i(233137),f=e.i(233538),x=e.i(397701),y=e.i(402155),b=e.i(700020);let v=null!=(a=n.default.startTransition)?a:function(e){e()};var _=e.i(998348),j=((t=j||{})[t.Open=0]="Open",t[t.Closed=1]="Closed",t),w=((s=w||{})[s.ToggleDisclosure=0]="ToggleDisclosure",s[s.CloseDisclosure=1]="CloseDisclosure",s[s.SetButtonId=2]="SetButtonId",s[s.SetPanelId=3]="SetPanelId",s[s.SetButtonElement=4]="SetButtonElement",s[s.SetPanelElement=5]="SetPanelElement",s);let k={0:e=>({...e,disclosureState:(0,x.match)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId},4:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},5:(e,t)=>e.panelElement===t.element?e:{...e,panelElement:t.element}},S=(0,n.createContext)(null);function N(e){let t=(0,n.useContext)(S);if(null===t){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,N),t}return t}S.displayName="DisclosureContext";let C=(0,n.createContext)(null);C.displayName="DisclosureAPIContext";let T=(0,n.createContext)(null);function E(e,t){return(0,x.match)(t.type,k,e,t)}T.displayName="DisclosurePanelContext";let I=n.Fragment,O=b.RenderFeatures.RenderStrategy|b.RenderFeatures.Static,M=Object.assign((0,b.forwardRefWithAs)(function(e,t){let{defaultOpen:s=!1,...a}=e,r=(0,n.useRef)(null),l=(0,u.useSyncRefs)(t,(0,u.optionalRef)(e=>{r.current=e},void 0===e.as||e.as===n.Fragment)),i=(0,n.useReducer)(E,{disclosureState:+!s,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:o,buttonId:c},m]=i,p=(0,d.useEvent)(e=>{m({type:1});let t=(0,y.getOwnerDocument)(r);if(!t||!c)return;let s=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==s||s.focus()}),f=(0,n.useMemo)(()=>({close:p}),[p]),v=(0,n.useMemo)(()=>({open:0===o,close:p}),[o,p]),_=(0,b.useRender)();return n.default.createElement(S.Provider,{value:i},n.default.createElement(C.Provider,{value:f},n.default.createElement(h,{value:p},n.default.createElement(g.OpenClosedProvider,{value:(0,x.match)(o,{0:g.State.Open,1:g.State.Closed})},_({ourProps:{ref:l},theirProps:a,slot:v,defaultTag:I,name:"Disclosure"})))))}),{Button:(0,b.forwardRefWithAs)(function(e,t){let s=(0,n.useId)(),{id:a=`headlessui-disclosure-button-${s}`,disabled:r=!1,autoFocus:m=!1,...p}=e,[h,g]=N("Disclosure.Button"),x=(0,n.useContext)(T),y=null!==x&&x===h.panelId,v=(0,n.useRef)(null),j=(0,u.useSyncRefs)(v,t,(0,d.useEvent)(e=>{if(!y)return g({type:4,element:e})}));(0,n.useEffect)(()=>{if(!y)return g({type:2,buttonId:a}),()=>{g({type:2,buttonId:null})}},[a,g,y]);let w=(0,d.useEvent)(e=>{var t;if(y){if(1===h.disclosureState)return;switch(e.key){case _.Keys.Space:case _.Keys.Enter:e.preventDefault(),e.stopPropagation(),g({type:0}),null==(t=h.buttonElement)||t.focus()}}else switch(e.key){case _.Keys.Space:case _.Keys.Enter:e.preventDefault(),e.stopPropagation(),g({type:0})}}),k=(0,d.useEvent)(e=>{e.key===_.Keys.Space&&e.preventDefault()}),S=(0,d.useEvent)(e=>{var t;(0,f.isDisabledReactIssue7711)(e.currentTarget)||r||(y?(g({type:0}),null==(t=h.buttonElement)||t.focus()):g({type:0}))}),{isFocusVisible:C,focusProps:E}=(0,l.useFocusRing)({autoFocus:m}),{isHovered:I,hoverProps:O}=(0,i.useHover)({isDisabled:r}),{pressed:M,pressProps:A}=(0,o.useActivePress)({disabled:r}),L=(0,n.useMemo)(()=>({open:0===h.disclosureState,hover:I,active:M,disabled:r,focus:C,autofocus:m}),[h,I,M,C,r,m]),F=(0,c.useResolveButtonType)(e,h.buttonElement),P=y?(0,b.mergeProps)({ref:j,type:F,disabled:r||void 0,autoFocus:m,onKeyDown:w,onClick:S},E,O,A):(0,b.mergeProps)({ref:j,id:a,type:F,"aria-expanded":0===h.disclosureState,"aria-controls":h.panelElement?h.panelId:void 0,disabled:r||void 0,autoFocus:m,onKeyDown:w,onKeyUp:k,onClick:S},E,O,A);return(0,b.useRender)()({ourProps:P,theirProps:p,slot:L,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,b.forwardRefWithAs)(function(e,t){let s=(0,n.useId)(),{id:a=`headlessui-disclosure-panel-${s}`,transition:r=!1,...l}=e,[i,o]=N("Disclosure.Panel"),{close:c}=function e(t){let s=(0,n.useContext)(C);if(null===s){let s=Error(`<${t} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,e),s}return s}("Disclosure.Panel"),[p,h]=(0,n.useState)(null),f=(0,u.useSyncRefs)(t,(0,d.useEvent)(e=>{v(()=>o({type:5,element:e}))}),h);(0,n.useEffect)(()=>(o({type:3,panelId:a}),()=>{o({type:3,panelId:null})}),[a,o]);let x=(0,g.useOpenClosed)(),[y,_]=(0,m.useTransition)(r,p,null!==x?(x&g.State.Open)===g.State.Open:0===i.disclosureState),j=(0,n.useMemo)(()=>({open:0===i.disclosureState,close:c}),[i.disclosureState,c]),w={ref:f,id:a,...(0,m.transitionDataAttributes)(_)},k=(0,b.useRender)();return n.default.createElement(g.ResetOpenClosedProvider,null,n.default.createElement(T.Provider,{value:i.panelId},k({ourProps:w,theirProps:l,slot:j,defaultTag:"div",features:O,visible:y,name:"Disclosure.Panel"})))})});e.s(["Disclosure",()=>M],886148);let A=(0,n.createContext)(void 0);var L=e.i(444755);let F=(0,e.i(673706).makeClassName)("Accordion"),P=(0,n.createContext)({isOpen:!1}),R=n.default.forwardRef((e,t)=>{var s;let{defaultOpen:a=!1,children:l,className:i}=e,o=(0,r.__rest)(e,["defaultOpen","children","className"]),d=null!=(s=(0,n.useContext)(A))?s:(0,L.tremorTwMerge)("rounded-tremor-default border");return n.default.createElement(M,Object.assign({as:"div",ref:t,className:(0,L.tremorTwMerge)(F("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",d,i),defaultOpen:a},o),({open:e})=>n.default.createElement(P.Provider,{value:{isOpen:e}},l))});R.displayName="Accordion",e.s(["OpenContext",()=>P,"default",()=>R],543086),e.s(["Accordion",()=>R],677667)},898667,e=>{"use strict";var t=e.i(290571),s=e.i(271645),a=e.i(886148);let r=e=>{var a=(0,t.__rest)(e,[]);return s.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),s.default.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var l=e.i(543086),i=e.i(444755);let n=(0,e.i(673706).makeClassName)("AccordionHeader"),o=s.default.forwardRef((e,o)=>{let{children:d,className:c}=e,u=(0,t.__rest)(e,["children","className"]),{isOpen:m}=(0,s.useContext)(l.OpenContext);return s.default.createElement(a.Disclosure.Button,Object.assign({ref:o,className:(0,i.tremorTwMerge)(n("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",c)},u),s.default.createElement("div",{className:(0,i.tremorTwMerge)(n("children"),"flex flex-1 text-inherit mr-4")},d),s.default.createElement("div",null,s.default.createElement(r,{className:(0,i.tremorTwMerge)(n("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",m?"transition-all":"transition-all -rotate-180")})))});o.displayName="AccordionHeader",e.s(["AccordionHeader",()=>o],898667)},130643,e=>{"use strict";var t=e.i(290571),s=e.i(271645),a=e.i(886148),r=e.i(444755);let l=(0,e.i(673706).makeClassName)("AccordionBody"),i=s.default.forwardRef((e,i)=>{let{children:n,className:o}=e,d=(0,t.__rest)(e,["children","className"]);return s.default.createElement(a.Disclosure.Panel,Object.assign({ref:i,className:(0,r.tremorTwMerge)(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",o)},d),n)});i.displayName="AccordionBody",e.s(["AccordionBody",()=>i],130643)},950724,(e,t,s)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},100236,(e,t,s)=>{t.exports=e.g&&e.g.Object===Object&&e.g},139088,(e,t,s)=>{var a=e.r(100236),r="object"==typeof self&&self&&self.Object===Object&&self;t.exports=a||r||Function("return this")()},631926,(e,t,s)=>{var a=e.r(139088);t.exports=function(){return a.Date.now()}},748891,(e,t,s)=>{var a=/\s/;t.exports=function(e){for(var t=e.length;t--&&a.test(e.charAt(t)););return t}},830364,(e,t,s)=>{var a=e.r(748891),r=/^\s+/;t.exports=function(e){return e?e.slice(0,a(e)+1).replace(r,""):e}},630353,(e,t,s)=>{t.exports=e.r(139088).Symbol},243436,(e,t,s)=>{var a=e.r(630353),r=Object.prototype,l=r.hasOwnProperty,i=r.toString,n=a?a.toStringTag:void 0;t.exports=function(e){var t=l.call(e,n),s=e[n];try{e[n]=void 0;var a=!0}catch(e){}var r=i.call(e);return a&&(t?e[n]=s:delete e[n]),r}},223243,(e,t,s)=>{var a=Object.prototype.toString;t.exports=function(e){return a.call(e)}},377684,(e,t,s)=>{var a=e.r(630353),r=e.r(243436),l=e.r(223243),i=a?a.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?r(e):l(e)}},877289,(e,t,s)=>{t.exports=function(e){return null!=e&&"object"==typeof e}},361884,(e,t,s)=>{var a=e.r(377684),r=e.r(877289);t.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==a(e)}},773759,(e,t,s)=>{var a=e.r(830364),r=e.r(950724),l=e.r(361884),i=0/0,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(l(e))return i;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=a(e);var s=o.test(e);return s||d.test(e)?c(e.slice(2),s?2:8):n.test(e)?i:+e}},374009,(e,t,s)=>{var a=e.r(950724),r=e.r(631926),l=e.r(773759),i=Math.max,n=Math.min;t.exports=function(e,t,s){var o,d,c,u,m,p,h=0,g=!1,f=!1,x=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var s=o,a=d;return o=d=void 0,h=t,u=e.apply(a,s)}function b(e){var s=e-p,a=e-h;return void 0===p||s>=t||s<0||f&&a>=c}function v(){var e,s,a,l=r();if(b(l))return _(l);m=setTimeout(v,(e=l-p,s=l-h,a=t-e,f?n(a,c-s):a))}function _(e){return(m=void 0,x&&o)?y(e):(o=d=void 0,u)}function j(){var e,s=r(),a=b(s);if(o=arguments,d=this,p=s,a){if(void 0===m)return h=e=p,m=setTimeout(v,t),g?y(e):u;if(f)return clearTimeout(m),m=setTimeout(v,t),y(p)}return void 0===m&&(m=setTimeout(v,t)),u}return t=l(t)||0,a(s)&&(g=!!s.leading,c=(f="maxWait"in s)?i(l(s.maxWait)||0,t):c,x="trailing"in s?!!s.trailing:x),j.cancel=function(){void 0!==m&&clearTimeout(m),h=0,o=p=d=m=void 0},j.flush=function(){return void 0===m?u:_(r())},j}},964306,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["XCircleIcon",0,s],964306)},59935,(e,t,s)=>{var a;let r;e.e,a=function e(){var t,s="u">typeof self?self:"u">typeof window?window:void 0!==s?s:{},a=!s.document&&!!s.postMessage,r=s.IS_PAPA_WORKER||!1,l={},i=0,n={};function o(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var a=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview,r)s.postMessage({results:l,workerId:n.WORKER_ID,finished:a});else if(_(this._config.chunk)&&!t){if(this._config.chunk(l,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=l=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(l.data),this._completeResults.errors=this._completeResults.errors.concat(l.errors),this._completeResults.meta=l.meta),this._completed||!a||!_(this._config.complete)||l&&l.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||l&&l.meta.paused||this._nextChunk(),l}this._halted=!0},this._sendError=function(e){_(this._config.error)?this._config.error(e):r&&this._config.error&&s.postMessage({workerId:n.WORKER_ID,error:e,finished:!1})}}function d(e){var t;(e=e||{}).chunkSize||(e.chunkSize=n.RemoteChunkSize),o.call(this,e),this._nextChunk=a?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),a||(t.onload=v(this._chunkLoaded,this),t.onerror=v(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!a),this._config.downloadRequestHeaders){var e,s,r=this._config.downloadRequestHeaders;for(s in r)t.setRequestHeader(s,r[s])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}a&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function c(e){(e=e||{}).chunkSize||(e.chunkSize=n.LocalChunkSize),o.call(this,e);var t,s,a="u">typeof FileReader;this.stream=function(e){this._input=e,s=e.slice||e.webkitSlice||e.mozSlice,a?((t=new FileReader).onload=v(this._chunkLoaded,this),t.onerror=v(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function u(e){var t;o.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,s;if(!this._finished)return t=(e=this._config.chunkSize)?(s=t.substring(0,e),t.substring(e)):(s=t,""),this._finished=!t,this.parseChunk(s)}}function m(e){o.call(this,e=e||{});var t=[],s=!0,a=!1;this.pause=function(){o.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){o.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){a&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):s=!0},this._streamData=v(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),s&&(s=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=v(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=v(function(){this._streamCleanUp(),a=!0,this._streamData("")},this),this._streamCleanUp=v(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(e){var t,s,a,r,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,o=this,d=0,c=0,u=!1,m=!1,p=[],f={data:[],errors:[],meta:{}};function x(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(f&&a&&(j("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+n.DefaultDelimiter+"'"),a=!1),e.skipEmptyLines&&(f.data=f.data.filter(function(e){return!x(e)})),v()){if(f)if(Array.isArray(f.data[0])){for(var t,s=0;v()&&s(e.dynamicTypingFunction&&void 0===e.dynamicTyping[t]&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping))?"true"===s||"TRUE"===s||"false"!==s&&"FALSE"!==s&&((e=>{if(l.test(e)&&-0x20000000000000<(e=parseFloat(e))&&e<0x20000000000000)return 1})(s)?parseFloat(s):i.test(s)?new Date(s):""===s?null:s):s)(n=e.header?r>=p.length?"__parsed_extra":p[r]:n,o=e.transform?e.transform(o,n):o);"__parsed_extra"===n?(a[n]=a[n]||[],a[n].push(o)):a[n]=o}return e.header&&(r>p.length?j("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+r,c+s):re.preview?s.abort():(f.data=f.data[0],r(f,o))))}),this.parse=function(r,l,i){var o=e.quoteChar||'"',o=(e.newline||(e.newline=this.guessLineEndings(r,o)),a=!1,e.delimiter?_(e.delimiter)&&(e.delimiter=e.delimiter(r),f.meta.delimiter=e.delimiter):((o=((t,s,a,r,l)=>{var i,o,d,c;l=l||[","," ","|",";",n.RECORD_SEP,n.UNIT_SEP];for(var u=0;u=s.length/2?"\r\n":"\r"}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var t=(e=e||{}).delimiter,s=e.newline,a=e.comments,r=e.step,l=e.preview,i=e.fastMode,o=null,d=!1,c=null==e.quoteChar?'"':e.quoteChar,u=c;if(void 0!==e.escapeChar&&(u=e.escapeChar),("string"!=typeof t||-1=l)return $(!0);break}k.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:w.length,index:m}),M++}}else if(a&&0===S.length&&n.substring(m,m+v)===a){if(-1===I)return $();m=I+b,I=n.indexOf(s,m),E=n.indexOf(t,m)}else if(-1!==E&&(E=l)return $(!0)}return P();function L(e){w.push(e),N=m}function F(e){return -1!==e&&(e=n.substring(M+1,e))&&""===e.trim()?e.length:0}function P(e){return f||(void 0===e&&(e=n.substring(m)),S.push(e),m=x,L(S),j&&D()),$()}function R(e){m=e,L(S),S=[],I=n.indexOf(s,m)}function $(a){if(e.header&&!g&&w.length&&!d){var r=w[0],l=Object.create(null),i=new Set(r);let t=!1;for(let s=0;s{if("object"==typeof t){if("string"!=typeof t.delimiter||n.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(r=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(s=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(d=t.skipEmptyLines),"string"==typeof t.newline&&(l=t.newline),"string"==typeof t.quoteChar&&(i=t.quoteChar),"boolean"==typeof t.header&&(a=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");c=t.columns}void 0!==t.escapeChar&&(o=t.escapeChar+i),t.escapeFormulae instanceof RegExp?u=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(u=/^[=+\-@\t\r].*$/)}})(),RegExp(h(i),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,d);if("object"==typeof e[0])return p(c||Object.keys(e[0]),e,d)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||c),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),p(e.fields||[],e.data||[],d);throw Error("Unable to serialize unrecognized input");function p(e,t,s){var i="",n=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var s=0;s{"use strict";var t=e.i(597440);e.s(["DeleteOutlined",()=>t.default])},244451,e=>{"use strict";let t;e.i(247167);var s=e.i(271645),a=e.i(343794),r=e.i(242064),l=e.i(763731),i=e.i(174428);let n=80*Math.PI,o=e=>{let{dotClassName:t,style:r,hasCircleCls:l}=e;return s.createElement("circle",{className:(0,a.default)(`${t}-circle`,{[`${t}-circle-bg`]:l}),r:40,cx:50,cy:50,strokeWidth:20,style:r})},d=({percent:e,prefixCls:t})=>{let r=`${t}-dot`,l=`${r}-holder`,d=`${l}-hidden`,[c,u]=s.useState(!1);(0,i.default)(()=>{0!==e&&u(!0)},[0!==e]);let m=Math.max(Math.min(e,100),0);if(!c)return null;let p={strokeDashoffset:`${n/4}`,strokeDasharray:`${n*m/100} ${n*(100-m)/100}`};return s.createElement("span",{className:(0,a.default)(l,`${r}-progress`,m<=0&&d)},s.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m},s.createElement(o,{dotClassName:r,hasCircleCls:!0}),s.createElement(o,{dotClassName:r,style:p})))};function c(e){let{prefixCls:t,percent:r=0}=e,l=`${t}-dot`,i=`${l}-holder`,n=`${i}-hidden`;return s.createElement(s.Fragment,null,s.createElement("span",{className:(0,a.default)(i,r>0&&n)},s.createElement("span",{className:(0,a.default)(l,`${t}-dot-spin`)},[1,2,3,4].map(e=>s.createElement("i",{className:`${t}-dot-item`,key:e})))),s.createElement(d,{prefixCls:t,percent:r}))}function u(e){var t;let{prefixCls:r,indicator:i,percent:n}=e,o=`${r}-dot`;return i&&s.isValidElement(i)?(0,l.cloneElement)(i,{className:(0,a.default)(null==(t=i.props)?void 0:t.className,o),percent:n}):s.createElement(c,{prefixCls:r,percent:n})}e.i(296059);var m=e.i(694758),p=e.i(183293),h=e.i(246422),g=e.i(838378);let f=new m.Keyframes("antSpinMove",{to:{opacity:1}}),x=new m.Keyframes("antRotate",{to:{transform:"rotate(405deg)"}}),y=(0,h.genStyleHooks)("Spin",e=>(e=>{let{componentCls:t,calc:s}=e;return{[t]:Object.assign(Object.assign({},(0,p.resetComponent)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:s(s(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:s(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:s(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:s(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:s(s(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:s(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:s(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:s(s(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:s(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:s(e.dotSize).sub(s(e.marginXXS).div(2)).div(2).equal(),height:s(e.dotSize).sub(s(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:f,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:x,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:s(s(e.dotSizeSM).sub(s(e.marginXXS).div(2))).div(2).equal(),height:s(s(e.dotSizeSM).sub(s(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:s(s(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:s(s(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})((0,g.mergeToken)(e,{spinDotDefault:e.colorTextDescription})),e=>{let{controlHeightLG:t,controlHeight:s}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:s}}),b=[[30,.05],[70,.03],[96,.01]];var v=function(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(s[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,a=Object.getOwnPropertySymbols(e);rt.indexOf(a[r])&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s};let _=e=>{var l;let{prefixCls:i,spinning:n=!0,delay:o=0,className:d,rootClassName:c,size:m="default",tip:p,wrapperClassName:h,style:g,children:f,fullscreen:x=!1,indicator:_,percent:j}=e,w=v(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:k,direction:S,className:N,style:C,indicator:T}=(0,r.useComponentConfig)("spin"),E=k("spin",i),[I,O,M]=y(E),[A,L]=s.useState(()=>n&&(!n||!o||!!Number.isNaN(Number(o)))),F=function(e,t){let[a,r]=s.useState(0),l=s.useRef(null),i="auto"===t;return s.useEffect(()=>(i&&e&&(r(0),l.current=setInterval(()=>{r(e=>{let t=100-e;for(let s=0;s{l.current&&(clearInterval(l.current),l.current=null)}),[i,e]),i?a:t}(A,j);s.useEffect(()=>{if(n){let e=function(e,t,s){var a,r=s||{},l=r.noTrailing,i=void 0!==l&&l,n=r.noLeading,o=void 0!==n&&n,d=r.debounceMode,c=void 0===d?void 0:d,u=!1,m=0;function p(){a&&clearTimeout(a)}function h(){for(var s=arguments.length,r=Array(s),l=0;le?o?(m=Date.now(),i||(a=setTimeout(c?g:h,e))):h():!0!==i&&(a=setTimeout(c?g:h,void 0===c?e-d:e)))}return h.cancel=function(e){var t=(e||{}).upcomingOnly;p(),u=!(void 0!==t&&t)},h}(o,()=>{L(!0)},{debounceMode:false});return e(),()=>{var t;null==(t=null==e?void 0:e.cancel)||t.call(e)}}L(!1)},[o,n]);let P=s.useMemo(()=>void 0!==f&&!x,[f,x]),R=(0,a.default)(E,N,{[`${E}-sm`]:"small"===m,[`${E}-lg`]:"large"===m,[`${E}-spinning`]:A,[`${E}-show-text`]:!!p,[`${E}-rtl`]:"rtl"===S},d,!x&&c,O,M),$=(0,a.default)(`${E}-container`,{[`${E}-blur`]:A}),D=null!=(l=null!=_?_:T)?l:t,z=Object.assign(Object.assign({},C),g),B=s.createElement("div",Object.assign({},w,{style:z,className:R,"aria-live":"polite","aria-busy":A}),s.createElement(u,{prefixCls:E,indicator:D,percent:F}),p&&(P||x)?s.createElement("div",{className:`${E}-text`},p):null);return I(P?s.createElement("div",Object.assign({},w,{className:(0,a.default)(`${E}-nested-loading`,h,O,M)}),A&&s.createElement("div",{key:"loading"},B),s.createElement("div",{className:$,key:"container"},f)):x?s.createElement("div",{className:(0,a.default)(`${E}-fullscreen`,{[`${E}-fullscreen-show`]:A},c,O,M)},B):B)};_.setDefaultIndicator=e=>{t=e},e.s(["default",0,_],244451)},482725,e=>{"use strict";var t=e.i(244451);e.s(["Spin",()=>t.default])},597440,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let 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"};var r=e.i(9583),l=s.forwardRef(function(e,l){return s.createElement(r.default,(0,t.default)({},e,{ref:l,icon:a}))});e.s(["default",0,l],597440)},737434,e=>{"use strict";var t=e.i(184163);e.s(["DownloadOutlined",()=>t.default])},916940,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(199133),r=e.i(764205);e.s(["default",0,({onChange:e,value:l,className:i,accessToken:n,placeholder:o="Select vector stores",disabled:d=!1})=>{let[c,u]=(0,s.useState)([]),[m,p]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(n){p(!0);try{let e=await (0,r.vectorStoreListCall)(n);e.data&&u(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{p(!1)}}})()},[n]),(0,t.jsx)("div",{children:(0,t.jsx)(a.Select,{mode:"multiple",placeholder:o,onChange:e,value:l,loading:m,className:i,allowClear:!0,options:c.map(e=>({label:`${e.vector_store_name||e.vector_store_id} (${e.vector_store_id})`,value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})})}])},109034,e=>{"use strict";var t=e.i(266027),s=e.i(243652),a=e.i(764205),r=e.i(135214);let l=(0,s.createQueryKeys)("tags");e.s(["useTags",0,()=>{let{accessToken:e,userId:s,userRole:i}=(0,r.default)();return(0,t.useQuery)({queryKey:l.list({}),queryFn:async()=>await (0,a.tagListCall)(e),enabled:!!(e&&s&&i)})}])},9314,263147,e=>{"use strict";var t=e.i(843476),s=e.i(199133),a=e.i(981339),r=e.i(645526),l=e.i(599724),i=e.i(266027),n=e.i(243652),o=e.i(764205),d=e.i(708347),c=e.i(135214);let u=(0,n.createQueryKeys)("accessGroups"),m=async e=>{let t=(0,o.getProxyBaseUrl)(),s=`${t}/v1/access_group`,a=await fetch(s,{method:"GET",headers:{[(0,o.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=(0,o.deriveErrorMessage)(e);throw(0,o.handleError)(t),Error(t)}return a.json()},p=()=>{let{accessToken:e,userRole:t}=(0,c.default)();return(0,i.useQuery)({queryKey:u.list({}),queryFn:async()=>m(e),enabled:!!e&&d.all_admin_roles.includes(t||"")})};e.s(["accessGroupKeys",0,u,"useAccessGroups",0,p],263147),e.s(["default",0,({value:e,onChange:i,placeholder:n="Select access groups",disabled:o=!1,style:d,className:c,showLabel:u=!1,labelText:m="Access Group",allowClear:h=!0})=>{let{data:g,isLoading:f,isError:x}=p();if(f)return(0,t.jsxs)("div",{children:[u&&(0,t.jsxs)(l.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(r.TeamOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(a.Skeleton.Input,{active:!0,block:!0,style:{height:32,...d}})]});let y=(g??[]).map(e=>({label:(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:e.access_group_name})," ",(0,t.jsxs)("span",{className:"text-gray-400 text-xs",children:["(",e.access_group_id,")"]})]}),value:e.access_group_id,selectedLabel:e.access_group_name,searchText:`${e.access_group_name} ${e.access_group_id}`}));return(0,t.jsxs)("div",{children:[u&&(0,t.jsxs)(l.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(r.TeamOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(s.Select,{mode:"multiple",value:e,placeholder:n,onChange:i,disabled:o,allowClear:h,showSearch:!0,style:{width:"100%",...d},className:`rounded-md ${c??""}`,notFoundContent:x?(0,t.jsx)("span",{className:"text-red-500",children:"Failed to load access groups"}):"No access groups found",filterOption:(e,t)=>(y.find(e=>e.value===t?.value)?.searchText??"").toLowerCase().includes(e.toLowerCase()),optionLabelProp:"selectedLabel",options:y.map(e=>({label:e.label,value:e.value,selectedLabel:e.selectedLabel}))})]})}],9314)},552130,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(199133),r=e.i(764205);e.s(["default",0,({onChange:e,value:l,className:i,accessToken:n,placeholder:o="Select agents",disabled:d=!1})=>{let[c,u]=(0,s.useState)([]),[m,p]=(0,s.useState)([]),[h,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(n){g(!0);try{let e=await (0,r.getAgentsList)(n),t=e?.agents||[];u(t);let s=new Set;t.forEach(e=>{let t=e.agent_access_groups;t&&Array.isArray(t)&&t.forEach(e=>s.add(e))}),p(Array.from(s))}catch(e){console.error("Error fetching agents:",e)}finally{g(!1)}}})()},[n]);let f=[...m.map(e=>({label:e,value:`group:${e}`,isAccessGroup:!0,searchText:`${e} Access Group`})),...c.map(e=>({label:`${e.agent_name||e.agent_id}`,value:e.agent_id,isAccessGroup:!1,searchText:`${e.agent_name||e.agent_id} ${e.agent_id} Agent`}))],x=[...l?.agents||[],...(l?.accessGroups||[]).map(e=>`group:${e}`)];return(0,t.jsx)("div",{children:(0,t.jsx)(a.Select,{mode:"multiple",placeholder:o,onChange:t=>{e({agents:t.filter(e=>!e.startsWith("group:")),accessGroups:t.filter(e=>e.startsWith("group:")).map(e=>e.replace("group:",""))})},value:x,loading:h,className:i,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>(f.find(e=>e.value===t?.value)?.searchText||"").toLowerCase().includes(e.toLowerCase()),children:f.map(e=>(0,t.jsx)(a.Select.Option,{value:e.value,label:e.label,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#722ed1",flexShrink:0}}),(0,t.jsx)("span",{style:{flex:1},children:e.label}),(0,t.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#722ed1",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"Agent"})]})},e.value))})})}])},844565,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(199133),r=e.i(764205);e.s(["default",0,({onChange:e,value:l,className:i,accessToken:n,placeholder:o="Select pass through routes",disabled:d=!1,teamId:c})=>{let[u,m]=(0,s.useState)([]),[p,h]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(n){h(!0);try{let e=await (0,r.getPassThroughEndpointsCall)(n,c);if(e.endpoints){let t=e.endpoints.flatMap(e=>{let t=e.path,s=e.methods;return s&&s.length>0?s.map(e=>({label:`${e} ${t}`,value:t})):[{label:t,value:t}]});m(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{h(!1)}}})()},[n,c]),(0,t.jsx)(a.Select,{mode:"tags",placeholder:o,onChange:e,value:l,loading:p,className:i,allowClear:!0,options:u,optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}])},810757,477386,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});e.s(["CogIcon",0,s],810757);let a=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});e.s(["BanIcon",0,a],477386)},557662,e=>{"use strict";let t="../ui/assets/logos/",s=[{id:"arize",displayName:"Arize",logo:`${t}arize.png`,supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"password"},description:"Arize Logging Integration"},{id:"braintrust",displayName:"Braintrust",logo:`${t}braintrust.png`,supports_key_team_logging:!1,dynamic_params:{braintrust_api_key:"password",braintrust_project_name:"text"},description:"Braintrust Logging Integration"},{id:"custom_callback_api",displayName:"Custom Callback API",logo:`${t}custom.svg`,supports_key_team_logging:!0,dynamic_params:{custom_callback_api_url:"text",custom_callback_api_headers:"text"},description:"Custom Callback API Logging Integration"},{id:"datadog",displayName:"Datadog",logo:`${t}datadog.png`,supports_key_team_logging:!1,dynamic_params:{dd_api_key:"password",dd_site:"text"},description:"Datadog Logging Integration"},{id:"lago",displayName:"Lago",logo:`${t}lago.svg`,supports_key_team_logging:!1,dynamic_params:{lago_api_url:"text",lago_api_key:"password"},description:"Lago Billing Logging Integration"},{id:"langfuse",displayName:"Langfuse",logo:`${t}langfuse.png`,supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},{id:"langfuse_otel",displayName:"Langfuse OTEL",logo:`${t}langfuse.png`,supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},{id:"langsmith",displayName:"LangSmith",logo:`${t}langsmith.png`,supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},{id:"openmeter",displayName:"OpenMeter",logo:`${t}openmeter.png`,supports_key_team_logging:!1,dynamic_params:{openmeter_api_key:"password",openmeter_base_url:"text"},description:"OpenMeter Logging Integration"},{id:"otel",displayName:"Open Telemetry",logo:`${t}otel.png`,supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:`${t}aws.svg`,supports_key_team_logging:!1,dynamic_params:{s3_bucket_name:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"S3 Bucket (AWS) Logging Integration"},{id:"SQS",displayName:"SQS",logo:`${t}aws.svg`,supports_key_team_logging:!1,dynamic_params:{sqs_queue_url:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"SQS Queue (AWS) Logging Integration"}],a=s.reduce((e,t)=>(e[t.displayName]=t,e),{}),r=s.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),l=s.reduce((e,t)=>(e[t.id]=t.displayName,e),{});e.s(["callbackInfo",0,a,"callback_map",0,r,"mapDisplayToInternalNames",0,e=>e.map(e=>r[e]||e),"mapInternalToDisplayNames",0,e=>e.map(e=>l[e]||e),"reverse_callback_map",0,l])},75921,e=>{"use strict";var t=e.i(843476),s=e.i(266027),a=e.i(243652),r=e.i(764205),l=e.i(135214);let i=(0,a.createQueryKeys)("mcpAccessGroups");var n=e.i(500727),o=e.i(699857),d=e.i(199133);let c="toolset:";e.s(["default",0,({onChange:e,value:a,className:u,accessToken:m,placeholder:p="Select MCP servers",disabled:h=!1,teamId:g})=>{let{data:f=[],isLoading:x}=(0,n.useMCPServers)(g),{data:y=[],isLoading:b}=(()=>{let{accessToken:e}=(0,l.default)();return(0,s.useQuery)({queryKey:i.list({}),queryFn:async()=>await (0,r.fetchMCPAccessGroups)(e),enabled:!!e})})(),{data:v=[],isLoading:_}=(0,o.useMCPToolsets)(),j=new Set(y),w=[...y.map(e=>({label:e,value:e,type:"accessGroup",searchText:`${e} Access Group`})),...f.map(e=>({label:`${e.server_name||e.server_id} (${e.server_id})`,value:e.server_id,type:"server",searchText:`${e.server_name||e.server_id} ${e.server_id} MCP Server`})),...v.map(e=>({label:e.toolset_name,value:`${c}${e.toolset_id}`,type:"toolset",searchText:`${e.toolset_name} ${e.toolset_id} Toolset`}))],k={accessGroup:"#52c41a",server:"#1890ff",toolset:"#722ed1"},S={accessGroup:"Access Group",server:"MCP Server",toolset:"Toolset"},N=[...a?.servers||[],...a?.accessGroups||[],...(a?.toolsets||[]).map(e=>`${c}${e}`)];return(0,t.jsx)("div",{children:(0,t.jsx)(d.Select,{mode:"multiple",placeholder:p,onChange:t=>{let s=t.filter(e=>e.startsWith(c)).map(e=>e.slice(c.length)),a=t.filter(e=>!e.startsWith(c));e({servers:a.filter(e=>!j.has(e)),accessGroups:a.filter(e=>j.has(e)),toolsets:s})},value:N,loading:x||b||_,className:u,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:h,filterOption:(e,t)=>(w.find(e=>e.value===t?.value)?.searchText||"").toLowerCase().includes(e.toLowerCase()),children:w.map(e=>(0,t.jsx)(d.Select.Option,{value:e.value,label:e.label,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:k[e.type],flexShrink:0}}),(0,t.jsx)("span",{style:{flex:1},children:e.label}),(0,t.jsx)("span",{style:{color:k[e.type],fontSize:"12px",fontWeight:500,opacity:.8},children:S[e.type]})]})},e.value))})})}],75921)},390605,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(764205),r=e.i(599724),l=e.i(482725),i=e.i(91739),n=e.i(500727),o=e.i(531516),d=e.i(696609);e.s(["default",0,({accessToken:e,selectedServers:c,toolPermissions:u,onChange:m,disabled:p=!1})=>{let{data:h=[]}=(0,n.useMCPServers)(),[g,f]=(0,s.useState)({}),[x,y]=(0,s.useState)({}),[b,v]=(0,s.useState)({}),[_,j]=(0,s.useState)({}),w=(0,s.useRef)(u);(0,s.useEffect)(()=>{w.current=u},[u]);let k=(0,s.useMemo)(()=>0===c.length?[]:h.filter(e=>c.includes(e.server_id)),[h,c]),S=async(e,t)=>{y(t=>({...t,[e]:!0})),v(t=>({...t,[e]:""}));try{let s=await (0,a.listMCPTools)(t,e);if(s.error)v(t=>({...t,[e]:s.message||"Failed to fetch tools"})),f(t=>({...t,[e]:[]}));else{let t=s.tools||[];f(s=>({...s,[e]:t}));let a=w.current;if(!a[e]&&t.length>0){let s=t.filter(e=>"delete"!==(0,d.classifyToolOp)(e.name,e.description||"")).map(e=>e.name);m({...a,[e]:s})}}}catch(t){console.error(`Error fetching tools for server ${e}:`,t),v(t=>({...t,[e]:"Failed to fetch tools"})),f(t=>({...t,[e]:[]}))}finally{y(t=>({...t,[e]:!1}))}};(0,s.useEffect)(()=>{k.forEach(t=>{g[t.server_id]||x[t.server_id]||S(t.server_id,e)})},[k,e]);let N=(e,t)=>{m({...u,[e]:t})};return 0===c.length?null:(0,t.jsx)("div",{className:"space-y-4",children:k.map(e=>{let s=e.server_name||e.alias||e.server_id,a=g[e.server_id]||[],n=u[e.server_id]||[],d=x[e.server_id],c=b[e.server_id],h=_[e.server_id]??"crud";return(0,t.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:s}),e.description&&(0,t.jsx)(r.Text,{className:"text-sm text-gray-500",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[!p&&a.length>0&&(0,t.jsx)(i.Radio.Group,{value:h,onChange:t=>j(s=>({...s,[e.server_id]:t.target.value})),size:"small",optionType:"button",buttonStyle:"solid",options:[{label:"Risk Groups",value:"crud"},{label:"Flat List",value:"flat"}]}),!p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>{var t;let s;return s=g[t=e.server_id]||[],void m({...u,[t]:s.map(e=>e.name)})},disabled:d,children:"Select All"}),(0,t.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>{var t;return t=e.server_id,void m({...u,[t]:[]})},disabled:d,children:"Deselect All"})]})]})]}),(0,t.jsxs)("div",{className:"p-4",children:[d&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,t.jsx)(l.Spin,{size:"large"}),(0,t.jsx)(r.Text,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),c&&!d&&(0,t.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,t.jsx)(r.Text,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,t.jsx)(r.Text,{className:"text-sm text-red-500 mt-1",children:c})]}),!d&&!c&&a.length>0&&"crud"===h&&(0,t.jsx)(o.default,{tools:a,value:u[e.server_id]?n:void 0,onChange:t=>N(e.server_id,t),readOnly:p}),!d&&!c&&a.length>0&&"flat"===h&&(0,t.jsx)("div",{className:"space-y-2",children:a.map(s=>{let a=n.includes(s.name);return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{if(p)return;let t=a?n.filter(e=>e!==s.name):[...n,s.name];N(e.server_id,t)},disabled:p,className:"mt-0.5"}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Text,{className:"font-medium text-gray-900",children:s.name}),(0,t.jsxs)(r.Text,{className:"text-sm text-gray-500",children:["- ",s.description||"No description"]})]})})]},s.name)})}),!d&&!c&&0===a.length&&(0,t.jsx)("div",{className:"text-center py-6",children:(0,t.jsx)(r.Text,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}])},266484,e=>{"use strict";var t=e.i(843476),s=e.i(199133),a=e.i(592968),r=e.i(312361),l=e.i(827252),i=e.i(994388),n=e.i(304967),o=e.i(779241),d=e.i(988297),c=e.i(68155),u=e.i(810757),m=e.i(477386),p=e.i(557662),h=e.i(435451);let{Option:g}=s.Select;e.s(["default",0,({value:e=[],onChange:f,disabledCallbacks:x=[],onDisabledCallbacksChange:y})=>{let b=Object.entries(p.callbackInfo).filter(([e,t])=>t.supports_key_team_logging).map(([e,t])=>e),v=Object.keys(p.callbackInfo),_=e=>{f?.(e)},j=(t,s,a)=>{let r=[...e];if("callback_name"===s){let e=p.callback_map[a]||a;r[t]={...r[t],[s]:e,callback_vars:{}}}else r[t]={...r[t],[s]:a};_(r)},w=(t,s,a)=>{let r=[...e];r[t]={...r[t],callback_vars:{...r[t].callback_vars,[s]:a}},_(r)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(m.BanIcon,{className:"w-5 h-5 text-red-500"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,t.jsx)(a.Tooltip,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,t.jsx)(s.Select,{mode:"multiple",placeholder:"Select callbacks to disable",value:x,onChange:e=>{let t=(0,p.mapDisplayToInternalNames)(e);y?.(t)},style:{width:"100%"},optionLabelProp:"label",children:v.map(e=>{let s=p.callbackInfo[e]?.logo,r=p.callbackInfo[e]?.description;return(0,t.jsx)(g,{value:e,label:e,children:(0,t.jsx)(a.Tooltip,{title:r,placement:"right",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,t.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let s=t.target,a=s.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),a.replaceChild(t,s)}}}),(0,t.jsx)("span",{children:e})]})})},e)})}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,t.jsx)(r.Divider,{}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(u.CogIcon,{className:"w-5 h-5 text-blue-500"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,t.jsx)(a.Tooltip,{title:"Configure callback logging integrations for this team.",children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),(0,t.jsx)(i.Button,{variant:"secondary",onClick:()=>{_([...e,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:d.PlusIcon,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,t.jsx)("div",{className:"space-y-4",children:e.map((r,d)=>{let u=r.callback_name?Object.entries(p.callback_map).find(([e,t])=>t===r.callback_name)?.[0]:void 0,m=u?p.callbackInfo[u]?.logo:null;return(0,t.jsxs)(n.Card,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,t.jsx)("img",{src:m,alt:u,className:"w-5 h-5 object-contain"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:[u||"New Integration"," Configuration"]})]}),(0,t.jsx)(i.Button,{variant:"light",onClick:()=>{_(e.filter((e,t)=>t!==d))},icon:c.TrashIcon,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,t.jsx)(s.Select,{value:u,placeholder:"Select integration",onChange:e=>j(d,"callback_name",e),className:"w-full",optionLabelProp:"label",children:b.map(e=>{let s=p.callbackInfo[e]?.logo,r=p.callbackInfo[e]?.description;return(0,t.jsx)(g,{value:e,label:e,children:(0,t.jsx)(a.Tooltip,{title:r,placement:"right",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,t.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let s=t.target,a=s.parentElement;if(a){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),a.replaceChild(t,s)}}}),(0,t.jsx)("span",{children:e})]})})},e)})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,t.jsxs)(s.Select,{value:r.callback_type,onChange:e=>j(d,"callback_type",e),className:"w-full",children:[(0,t.jsx)(g,{value:"success",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{children:"Success Only"})]})}),(0,t.jsx)(g,{value:"failure",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,t.jsx)("span",{children:"Failure Only"})]})}),(0,t.jsx)(g,{value:"success_and_failure",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),((e,s)=>{if(!e.callback_name)return null;let r=Object.entries(p.callback_map).find(([t,s])=>s===e.callback_name)?.[0];if(!r)return null;let i=p.callbackInfo[r]?.dynamic_params||{};return 0===Object.keys(i).length?null:(0,t.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,t.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(i).map(([r,i])=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,t.jsx)("span",{children:r.replace(/_/g," ")}),(0,t.jsx)(a.Tooltip,{title:`Environment variable reference recommended: os.environ/${r.toUpperCase()}`,children:(0,t.jsx)(l.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})}),"password"===i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===i&&(0,t.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===i?(0,t.jsx)(h.default,{step:.01,width:400,placeholder:`os.environ/${r.toUpperCase()}`,value:e.callback_vars[r]||"",onChange:e=>w(s,r,e.target.value)}):(0,t.jsx)(o.TextInput,{type:"password"===i?"password":"text",placeholder:`os.environ/${r.toUpperCase()}`,value:e.callback_vars[r]||"",onChange:e=>w(s,r,e.target.value)})]},r))})]})})(r,d)]})]},d)})}),0===e.length&&(0,t.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,t.jsx)(u.CogIcon,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,t.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,t.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}])},460285,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(404206),r=e.i(723731),l=e.i(653824),i=e.i(881073),n=e.i(197647),o=e.i(764205),d=e.i(158392),c=e.i(419470),u=e.i(689020);let m=(0,s.forwardRef)(({accessToken:e,value:m,onChange:p,modelData:h},g)=>{let[f,x]=(0,s.useState)({routerSettings:{},selectedStrategy:null,enableTagFiltering:!1}),[y,b]=(0,s.useState)([]),[v,_]=(0,s.useState)([]),[j,w]=(0,s.useState)([]),[k,S]=(0,s.useState)([]),[N,C]=(0,s.useState)({}),[T,E]=(0,s.useState)({}),I=(0,s.useRef)(!1),O=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=m?.router_settings?JSON.stringify({routing_strategy:m.router_settings.routing_strategy,fallbacks:m.router_settings.fallbacks,enable_tag_filtering:m.router_settings.enable_tag_filtering}):null;if(I.current&&e===O.current){I.current=!1;return}if(I.current&&e!==O.current&&(I.current=!1),e!==O.current)if(O.current=e,m?.router_settings){let e=m.router_settings,{fallbacks:t,...s}=e;x({routerSettings:s,selectedStrategy:e.routing_strategy||null,enableTagFiltering:e.enable_tag_filtering??!1});let a=e.fallbacks||[];b(a),_(a&&0!==a.length?a.map((e,t)=>{let[s,a]=Object.entries(e)[0];return{id:(t+1).toString(),primaryModel:s||null,fallbackModels:a||[]}}):[{id:"1",primaryModel:null,fallbackModels:[]}])}else x({routerSettings:{},selectedStrategy:null,enableTagFiltering:!1}),b([]),_([{id:"1",primaryModel:null,fallbackModels:[]}])},[m]),(0,s.useEffect)(()=>{e&&(0,o.getRouterSettingsCall)(e).then(e=>{if(e.fields){let t={};e.fields.forEach(e=>{t[e.field_name]={ui_field_name:e.ui_field_name,field_description:e.field_description,options:e.options,link:e.link}}),C(t);let s=e.fields.find(e=>"routing_strategy"===e.field_name);s?.options&&S(s.options),e.routing_strategy_descriptions&&E(e.routing_strategy_descriptions)}})},[e]),(0,s.useEffect)(()=>{e&&(async()=>{try{let t=await (0,u.fetchAvailableModels)(e);w(t)}catch(e){console.error("Error fetching model info for fallbacks:",e)}})()},[e]);let M=()=>{let e=new Set(["allowed_fails","cooldown_time","num_retries","timeout","retry_after"]),t=new Set(["model_group_alias","retry_policy"]),s=Object.fromEntries(Object.entries({...f.routerSettings,enable_tag_filtering:f.enableTagFiltering,routing_strategy:f.selectedStrategy,fallbacks:y.length>0?y:null}).map(([s,a])=>{if("routing_strategy_args"!==s&&"routing_strategy"!==s&&"enable_tag_filtering"!==s&&"fallbacks"!==s){let r=document.querySelector(`input[name="${s}"]`);if(r){if(void 0!==r.value&&""!==r.value){let l=((s,a,r)=>{if(null==a)return r;let l=String(a).trim();if(""===l||"null"===l.toLowerCase())return null;if(e.has(s)){let e=Number(l);return Number.isNaN(e)?r:e}if(t.has(s)){if(""===l)return null;try{return JSON.parse(l)}catch{return r}}return"true"===l.toLowerCase()||"false"!==l.toLowerCase()&&l})(s,r.value,a);return[s,l]}return[s,null]}}else if("routing_strategy"===s)return[s,f.selectedStrategy];else if("enable_tag_filtering"===s)return[s,f.enableTagFiltering];else if("fallbacks"===s)return[s,y.length>0?y:null];else if("routing_strategy_args"===s&&"latency-based-routing"===f.selectedStrategy){let e=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]'),s={};return e?.value&&(s.lowest_latency_buffer=Number(e.value)),t?.value&&(s.ttl=Number(t.value)),["routing_strategy_args",Object.keys(s).length>0?s:null]}return[s,a]}).filter(e=>null!=e)),a=(e,t=!1)=>null==e||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length||t&&("number"!=typeof e||Number.isNaN(e))?null:e;return{routing_strategy:a(s.routing_strategy),allowed_fails:a(s.allowed_fails,!0),cooldown_time:a(s.cooldown_time,!0),num_retries:a(s.num_retries,!0),timeout:a(s.timeout,!0),retry_after:a(s.retry_after,!0),fallbacks:y.length>0?y:null,context_window_fallbacks:a(s.context_window_fallbacks),retry_policy:a(s.retry_policy),model_group_alias:a(s.model_group_alias),enable_tag_filtering:f.enableTagFiltering,routing_strategy_args:a(s.routing_strategy_args)}};(0,s.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>{I.current=!0,p({router_settings:M()})},100);return()=>clearTimeout(e)},[f,y]);let A=Array.from(new Set(j.map(e=>e.model_group))).sort();return((0,s.useImperativeHandle)(g,()=>({getValue:()=>({router_settings:M()})})),e)?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)(l.TabGroup,{className:"w-full",children:[(0,t.jsxs)(i.TabList,{variant:"line",defaultValue:"1",className:"px-8 pt-4",children:[(0,t.jsx)(n.Tab,{value:"1",children:"Loadbalancing"}),(0,t.jsx)(n.Tab,{value:"2",children:"Fallbacks"})]}),(0,t.jsxs)(r.TabPanels,{className:"px-8 py-6",children:[(0,t.jsx)(a.TabPanel,{children:(0,t.jsx)(d.default,{value:f,onChange:x,routerFieldsMetadata:N,availableRoutingStrategies:k,routingStrategyDescriptions:T})}),(0,t.jsx)(a.TabPanel,{children:(0,t.jsx)(c.FallbackSelectionForm,{groups:v,onGroupsChange:e=>{_(e),b(e.filter(e=>e.primaryModel&&e.fallbackModels.length>0).map(e=>({[e.primaryModel]:e.fallbackModels})))},availableModels:A,maxGroups:5})})]})]})}):null});m.displayName="RouterSettingsAccordion",e.s(["default",0,m])},207082,e=>{"use strict";var t=e.i(619273),s=e.i(266027),a=e.i(243652),r=e.i(764205),l=e.i(135214);let i=(0,a.createQueryKeys)("keys"),n=async(e,t,s,a={})=>{try{let l=(0,r.getProxyBaseUrl)(),i=new URLSearchParams(Object.entries({team_id:a.teamID,project_id:a.projectID,organization_id:a.organizationID,key_alias:a.selectedKeyAlias,key_hash:a.keyHash,user_id:a.userID,page:t,size:s,sort_by:a.sortBy,sort_order:a.sortOrder,expand:a.expand,status:a.status,return_full_object:"true",include_team_keys:"true",include_created_by_keys:"true"}).filter(([,e])=>null!=e).map(([e,t])=>[e,String(t)])),n=`${l?`${l}/key/list`:"/key/list"}?${i}`,o=await fetch(n,{method:"GET",headers:{[(0,r.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=(0,r.deriveErrorMessage)(e);throw(0,r.handleError)(t),Error(t)}let d=await o.json();return console.log("/key/list API Response:",d),d}catch(e){throw console.error("Failed to list keys:",e),e}},o=(0,a.createQueryKeys)("deletedKeys");e.s(["keyKeys",0,i,"useDeletedKeys",0,(e,a,r={})=>{let{accessToken:i}=(0,l.default)();return(0,s.useQuery)({queryKey:o.list({page:e,limit:a,...r}),queryFn:async()=>await n(i,e,a,{...r,status:"deleted"}),enabled:!!i,staleTime:3e4,placeholderData:t.keepPreviousData})},"useKeys",0,(e,a,r={})=>{let{accessToken:o}=(0,l.default)();return(0,s.useQuery)({queryKey:i.list({page:e,limit:a,...r}),queryFn:async()=>await n(o,e,a,r),enabled:!!o,staleTime:3e4,placeholderData:t.keepPreviousData})}])},510674,e=>{"use strict";var t=e.i(266027),s=e.i(243652),a=e.i(764205),r=e.i(135214),l=e.i(708347);let i=(0,s.createQueryKeys)("projects"),n=async e=>{let t=(0,a.getProxyBaseUrl)(),s=`${t}/project/list`,r=await fetch(s,{method:"GET",headers:{[(0,a.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=(0,a.deriveErrorMessage)(e);throw(0,a.handleError)(t),Error(t)}return r.json()};e.s(["projectKeys",0,i,"useProjects",0,()=>{let{accessToken:e,userRole:s}=(0,r.default)();return(0,t.useQuery)({queryKey:i.list({}),queryFn:async()=>n(e),enabled:!!e&&l.all_admin_roles.includes(s)})}])},392110,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(199133),r=e.i(592968),l=e.i(312361),i=e.i(790848),n=e.i(536916),o=e.i(827252),d=e.i(779241);let{Option:c}=a.Select;e.s(["default",0,({form:e,autoRotationEnabled:u,onAutoRotationChange:m,rotationInterval:p,onRotationIntervalChange:h,isCreateMode:g=!1,neverExpire:f=!1,onNeverExpireChange:x})=>{let y=p&&!["7d","30d","90d","180d","365d"].includes(p),[b,v]=(0,s.useState)(y),[_,j]=(0,s.useState)(y?p:""),[w,k]=(0,s.useState)(e?.getFieldValue?.("duration")||"");return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Key Expiry Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Expire Key"}),(0,t.jsx)(r.Tooltip,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})}),!g&&x&&(0,t.jsx)(n.Checkbox,{checked:f,onChange:t=>{let s=t.target.checked;x(s),s&&(k(""),e&&"function"==typeof e.setFieldValue?e.setFieldValue("duration",""):e&&"function"==typeof e.setFieldsValue&&e.setFieldsValue({duration:""}))},className:"ml-2 text-sm font-normal text-gray-600",children:"Never Expire"})]}),(0,t.jsx)(d.TextInput,{name:"duration",placeholder:g?"e.g., 30d or leave empty to never expire":"e.g., 30d",className:"w-full",value:w,onValueChange:t=>{k(t),e&&"function"==typeof e.setFieldValue?e.setFieldValue("duration",t):e&&"function"==typeof e.setFieldsValue&&e.setFieldsValue({duration:t})},disabled:!g&&f})]})]}),(0,t.jsx)(l.Divider,{}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Auto-Rotation Settings"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Enable Auto-Rotation"}),(0,t.jsx)(r.Tooltip,{title:"Key will automatically regenerate at the specified interval for enhanced security.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsx)(i.Switch,{checked:u,onChange:m,size:"default",className:u?"":"bg-gray-400"})]}),u&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Rotation Interval"}),(0,t.jsx)(r.Tooltip,{title:"How often the key should be automatically rotated. Choose the interval that best fits your security requirements.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(a.Select,{value:b?"custom":p,onChange:e=>{"custom"===e?v(!0):(v(!1),j(""),h(e))},className:"w-full",placeholder:"Select interval",children:[(0,t.jsx)(c,{value:"7d",children:"7 days"}),(0,t.jsx)(c,{value:"30d",children:"30 days"}),(0,t.jsx)(c,{value:"90d",children:"90 days"}),(0,t.jsx)(c,{value:"180d",children:"180 days"}),(0,t.jsx)(c,{value:"365d",children:"365 days"}),(0,t.jsx)(c,{value:"custom",children:"Custom interval"})]}),b&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.TextInput,{value:_,onChange:e=>{let t=e.target.value;j(t),h(t)},placeholder:"e.g., 1s, 5m, 2h, 14d"}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Supported formats: seconds (s), minutes (m), hours (h), days (d)"})]})]})]})]}),u&&(0,t.jsx)("div",{className:"bg-blue-50 p-3 rounded-md text-sm text-blue-700",children:"When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period."})]})]})}])},939510,e=>{"use strict";var t=e.i(843476),s=e.i(808613),a=e.i(199133),r=e.i(592968),l=e.i(827252);let{Option:i}=a.Select;e.s(["default",0,({type:e,name:n,showDetailedDescriptions:o=!0,className:d="",initialValue:c=null,form:u,onChange:m})=>{let p=e.toUpperCase(),h=e.toLowerCase(),g=`Select 'guaranteed_throughput' to prevent overallocating ${p} limit when the key belongs to a Team with specific ${p} limits.`;return(0,t.jsx)(s.Form.Item,{label:(0,t.jsxs)("span",{children:[p," Rate Limit Type"," ",(0,t.jsx)(r.Tooltip,{title:g,children:(0,t.jsx)(l.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:n,initialValue:c,className:d,children:(0,t.jsx)(a.Select,{defaultValue:o?"default":void 0,placeholder:"Select rate limit type",style:{width:"100%"},optionLabelProp:o?"label":void 0,onChange:e=>{u&&u.setFieldValue(n,e),m&&m(e)},children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{value:"best_effort_throughput",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Best effort throughput - no error if we're overallocating ",h," (Team/Key Limits checked at runtime)."]})]})}),(0,t.jsx)(i,{value:"guaranteed_throughput",label:"Guaranteed throughput",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Guaranteed throughput"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Guaranteed throughput - raise an error if we're overallocating ",h," (also checks model-specific limits)"]})]})}),(0,t.jsx)(i,{value:"dynamic",label:"Dynamic",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Dynamic"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["If the key has a set ",p," (e.g. 2 ",p,") and there are no 429 errors, it can dynamically exceed the limit when the model being called is not erroring."]})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{value:"best_effort_throughput",children:"Best effort throughput"}),(0,t.jsx)(i,{value:"guaranteed_throughput",children:"Guaranteed throughput"}),(0,t.jsx)(i,{value:"dynamic",children:"Dynamic"})]})})})}])},363256,e=>{"use strict";var t=e.i(843476),s=e.i(199133);let{Text:a}=e.i(898586).Typography;e.s(["default",0,({organizations:e,value:r,onChange:l,disabled:i,loading:n,style:o})=>(0,t.jsx)(s.Select,{showSearch:!0,placeholder:"All Organizations",value:r,onChange:l,disabled:i,loading:n,allowClear:!0,style:{minWidth:280,...o},filterOption:(t,s)=>{if(!s)return!1;let a=e?.find(e=>e.organization_id===s.key);if(!a)return!1;let r=t.toLowerCase().trim(),l=(a.organization_alias||"").toLowerCase(),i=(a.organization_id||"").toLowerCase();return l.includes(r)||i.includes(r)},children:e?.map(e=>(0,t.jsxs)(s.Select.Option,{value:e.organization_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,t.jsxs)(a,{type:"secondary",children:["(",e.organization_id,")"]})]},e.organization_id))})])},319312,e=>{"use strict";var t=e.i(843476),s=e.i(464571),a=e.i(28651),r=e.i(199133);let l=[{value:"1h",label:"Hourly",resetHint:"Resets every hour"},{value:"24h",label:"Daily",resetHint:"Resets daily at midnight UTC"},{value:"7d",label:"Weekly",resetHint:"Resets every Sunday at midnight UTC"},{value:"30d",label:"Monthly",resetHint:"Resets on the 1st of every month at midnight UTC"}];function i({value:e,onChange:i}){let n=(t,s,a)=>{i(e.map((e,r)=>r===t?{...e,[s]:a}:e))};return(0,t.jsxs)("div",{children:[e.map((o,d)=>{let c=l.find(e=>e.value===o.budget_duration)?.resetHint;return(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)(r.Select,{value:o.budget_duration,onChange:e=>n(d,"budget_duration",e),style:{width:130},options:l.map(e=>({value:e.value,label:e.label}))}),(0,t.jsx)(a.InputNumber,{step:.01,min:0,precision:2,value:o.max_budget??void 0,onChange:e=>n(d,"max_budget",e??null),placeholder:"Max spend ($)",style:{width:160},prefix:"$"}),(0,t.jsx)(s.Button,{type:"text",danger:!0,size:"small",onClick:()=>{i(e.filter((e,t)=>t!==d))},style:{padding:"0 4px"},children:"✕"})]}),c&&(0,t.jsxs)("div",{style:{fontSize:11,color:"#888",marginTop:3,marginLeft:2},children:["↻ ",c]})]},d)}),(0,t.jsx)(s.Button,{size:"small",onClick:t=>{t.preventDefault(),i([...e,{budget_duration:"24h",max_budget:null}])},children:"+ Add Budget Window"})]})}e.s(["BudgetWindowsEditor",()=>i])},533882,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(250980),r=e.i(797672),l=e.i(68155),i=e.i(304967),n=e.i(629569),o=e.i(599724),d=e.i(269200),c=e.i(427612),u=e.i(64848),m=e.i(942232),p=e.i(496020),h=e.i(977572),g=e.i(992619),f=e.i(727749);e.s(["default",0,({accessToken:e,initialModelAliases:x={},onAliasUpdate:y,showExampleConfig:b=!0})=>{let[v,_]=(0,s.useState)([]),[j,w]=(0,s.useState)({aliasName:"",targetModel:""}),[k,S]=(0,s.useState)(null);(0,s.useEffect)(()=>{_(Object.entries(x).map(([e,t],s)=>({id:`${s}-${e}`,aliasName:e,targetModel:t})))},[x]);let N=()=>{if(!k)return;if(!k.aliasName||!k.targetModel)return void f.default.fromBackend("Please provide both alias name and target model");if(v.some(e=>e.id!==k.id&&e.aliasName===k.aliasName))return void f.default.fromBackend("An alias with this name already exists");let e=v.map(e=>e.id===k.id?k:e);_(e),S(null);let t={};e.forEach(e=>{t[e.aliasName]=e.targetModel}),y&&y(t),f.default.success("Alias updated successfully")},C=()=>{S(null)},T=v.reduce((e,t)=>(e[t.aliasName]=t.targetModel,e),{});return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(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:"Alias Name"}),(0,t.jsx)("input",{type:"text",value:j.aliasName,onChange:e=>w({...j,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",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:"Target Model"}),(0,t.jsx)(g.default,{accessToken:e,value:j.targetModel,placeholder:"Select target model",onChange:e=>w({...j,targetModel:e}),showLabel:!1})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:()=>{if(!j.aliasName||!j.targetModel)return void f.default.fromBackend("Please provide both alias name and target model");if(v.some(e=>e.aliasName===j.aliasName))return void f.default.fromBackend("An alias with this name already exists");let e=[...v,{id:`${Date.now()}-${j.aliasName}`,aliasName:j.aliasName,targetModel:j.targetModel}];_(e),w({aliasName:"",targetModel:""});let t={};e.forEach(e=>{t[e.aliasName]=e.targetModel}),y&&y(t),f.default.success("Alias added successfully")},disabled:!j.aliasName||!j.targetModel,className:`flex items-center px-4 py-2 rounded-md text-sm ${!j.aliasName||!j.targetModel?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-green-600 text-white hover:bg-green-700"}`,children:[(0,t.jsx)(a.PlusCircleIcon,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(d.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(c.TableHead,{children:(0,t.jsxs)(p.TableRow,{children:[(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Alias Name"}),(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Target Model"}),(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(m.TableBody,{children:[v.map(s=>(0,t.jsx)(p.TableRow,{className:"h-8",children:k&&k.id===s.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:k.aliasName,onChange:e=>S({...k,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(h.TableCell,{className:"py-0.5",children:(0,t.jsx)(g.default,{accessToken:e,value:k.targetModel,onChange:e=>S({...k,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,t.jsx)(h.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:N,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:C,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)(h.TableCell,{className:"py-0.5 text-sm text-gray-900",children:s.aliasName}),(0,t.jsx)(h.TableCell,{className:"py-0.5 text-sm text-gray-500",children:s.targetModel}),(0,t.jsx)(h.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>{S({...s})},className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(r.PencilIcon,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>{var e;let t,a;return e=s.id,_(t=v.filter(t=>t.id!==e)),a={},void(t.forEach(e=>{a[e.aliasName]=e.targetModel}),y&&y(a),f.default.success("Alias deleted successfully"))},className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(l.TrashIcon,{className:"w-3 h-3"})})]})})]})},s.id)),0===v.length&&(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(h.TableCell,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),b&&(0,t.jsxs)(i.Card,{children:[(0,t.jsx)(n.Title,{className:"mb-4",children:"Configuration Example"}),(0,t.jsx)(o.Text,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,t.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,t.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(T).length?(0,t.jsxs)("span",{className:"text-gray-500",children:[(0,t.jsx)("br",{})," # No aliases configured yet"]}):Object.entries(T).map(([e,s])=>(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),' "',e,'": "',s,'"']},e))]})})]})]})}])},651904,e=>{"use strict";var t=e.i(843476),s=e.i(599724),a=e.i(266484);e.s(["default",0,function({value:e,onChange:r,premiumUser:l=!1,disabledCallbacks:i=[],onDisabledCallbacksChange:n}){return l?(0,t.jsx)(a.default,{value:e,onChange:r,disabledCallbacks:i,onDisabledCallbacksChange:n}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,t.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,t.jsxs)(s.Text,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,t.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}])},575260,e=>{"use strict";var t=e.i(843476),s=e.i(199133),a=e.i(482725),r=e.i(56456);e.s(["default",0,({projects:e,value:l,onChange:i,disabled:n,loading:o,teamId:d})=>{let c=d?e?.filter(e=>e.team_id===d):e;return(0,t.jsx)(s.Select,{showSearch:!0,placeholder:"Search or select a project",value:l,onChange:i,disabled:n,loading:o,allowClear:!0,notFoundContent:o?(0,t.jsx)(a.Spin,{indicator:(0,t.jsx)(r.LoadingOutlined,{spin:!0}),size:"small"}):void 0,filterOption:(e,t)=>{if(!t)return!1;let s=c?.find(e=>e.project_id===t.key);if(!s)return!1;let a=e.toLowerCase().trim(),r=(s.project_alias||"").toLowerCase(),l=(s.project_id||"").toLowerCase();return r.includes(a)||l.includes(a)},optionFilterProp:"children",children:!o&&c?.map(e=>(0,t.jsxs)(s.Select.Option,{value:e.project_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.project_alias||e.project_id})," ",(0,t.jsxs)("span",{className:"text-gray-500",children:["(",e.project_id,")"]})]},e.project_id))})}])},702597,364769,e=>{"use strict";var t=e.i(843476),s=e.i(207082),a=e.i(109799),r=e.i(510674),l=e.i(109034),i=e.i(292639),n=e.i(135214),o=e.i(500330),d=e.i(827252),c=e.i(912598),u=e.i(677667),m=e.i(130643),p=e.i(898667),h=e.i(994388),g=e.i(309426),f=e.i(350967),x=e.i(599724),y=e.i(779241),b=e.i(629569),v=e.i(464571),_=e.i(808613),j=e.i(311451),w=e.i(212931),k=e.i(91739),S=e.i(199133),N=e.i(790848),C=e.i(262218),T=e.i(592968),E=e.i(374009),I=e.i(271645),O=e.i(708347),M=e.i(552130),A=e.i(557662),L=e.i(9314),F=e.i(860585),P=e.i(82946),R=e.i(392110),$=e.i(533882),D=e.i(844565),z=e.i(651904),B=e.i(939510),q=e.i(460285),K=e.i(663435),U=e.i(363256),H=e.i(575260),V=e.i(371455),G=e.i(319312),W=e.i(355619),Q=e.i(75921),J=e.i(390605),X=e.i(727749),Y=e.i(764205),Z=e.i(237016),ee=e.i(888259);let et=({apiKey:e})=>{let[s,a]=(0,I.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-2",children:["Please save this secret key somewhere safe and accessible. For security reasons,"," ",(0,t.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-3 mb-1",children:"Virtual Key:"}),(0,t.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,t.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal",margin:0},children:e})}),(0,t.jsx)(Z.CopyToClipboard,{text:e,onCopy:()=>{a(!0),ee.default.success("Key copied to clipboard"),setTimeout(()=>a(!1),2e3)},children:(0,t.jsx)(v.Button,{type:"primary",style:{marginTop:12},children:s?"Copied!":"Copy Virtual Key"})})]})};e.s(["default",0,et],364769);var es=e.i(435451),ea=e.i(916940);let{Option:er}=S.Select,el=async(e,t,s,a)=>{try{if(null===e||null===t)return[];if(null!==s){let r=(await (0,Y.modelAvailableCall)(s,e,t,!0,a,!0)).data.map(e=>e.id);return console.log("available_model_names:",r),r}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},ei=async(e,t,s,a)=>{try{if(null===e||null===t)return;if(null!==s){let r=(await (0,Y.modelAvailableCall)(s,e,t)).data.map(e=>e.id);console.log("available_model_names:",r),a(r)}}catch(e){console.error("Error fetching user models:",e)}};e.s(["default",0,({team:e,teams:Z,data:ee,addKey:en,autoOpenCreate:eo,prefillData:ed})=>{let{accessToken:ec,userId:eu,userRole:em,premiumUser:ep}=(0,n.default)(),eh=ep||null!=em&&O.rolesWithWriteAccess.includes(em),{data:eg,isLoading:ef}=(0,a.useOrganizations)(),{data:ex,isLoading:ey}=(0,r.useProjects)(),{data:eb}=(0,i.useUISettings)(),{data:ev}=(0,l.useTags)(),e_=!!eb?.values?.enable_projects_ui,ej=!!eb?.values?.disable_custom_api_keys,ew=ev?Object.values(ev).map(e=>({value:e.name,label:e.name})):[],ek=(0,c.useQueryClient)(),[eS]=_.Form.useForm(),[eN,eC]=(0,I.useState)(!1),[eT,eE]=(0,I.useState)(null),[eI,eO]=(0,I.useState)(null),[eM,eA]=(0,I.useState)([]),[eL,eF]=(0,I.useState)([]),[eP,eR]=(0,I.useState)("you"),[e$,eD]=(0,I.useState)(!1),[ez,eB]=(0,I.useState)(null),[eq,eK]=(0,I.useState)([]),[eU,eH]=(0,I.useState)([]),[eV,eG]=(0,I.useState)([]),[eW,eQ]=(0,I.useState)([]),[eJ,eX]=(0,I.useState)(e),[eY,eZ]=(0,I.useState)(null),[e0,e1]=(0,I.useState)(null),[e2,e4]=(0,I.useState)(!1),[e3,e6]=(0,I.useState)(null),[e5,e7]=(0,I.useState)({}),[e8,e9]=(0,I.useState)([]),[te,tt]=(0,I.useState)(!1),[ts,ta]=(0,I.useState)([]),[tr,tl]=(0,I.useState)([]),[ti,tn]=(0,I.useState)("llm_api"),[to,td]=(0,I.useState)({}),[tc,tu]=(0,I.useState)(!1),[tm,tp]=(0,I.useState)("30d"),[th,tg]=(0,I.useState)(null),[tf,tx]=(0,I.useState)([]),[ty,tb]=(0,I.useState)(0),[tv,t_]=(0,I.useState)([]),[tj,tw]=(0,I.useState)(null),tk=()=>{eC(!1),eS.resetFields(),eQ([]),tl([]),tn("llm_api"),td({}),tu(!1),tp("30d"),tg(null),tb(e=>e+1),tw(null),eZ(null),e1(null),tx([])},tS=()=>{eC(!1),eE(null),eX(null),eS.resetFields(),eQ([]),tl([]),tn("llm_api"),td({}),tu(!1),tp("30d"),tg(null),tb(e=>e+1),tw(null),eZ(null),e1(null),tx([])};(0,I.useEffect)(()=>{eu&&em&&ec&&ei(eu,em,ec,eA)},[ec,eu,em]),(0,I.useEffect)(()=>{ec&&(0,Y.getAgentsList)(ec).then(e=>t_(e?.agents||[])).catch(()=>t_([]))},[ec]),(0,I.useEffect)(()=>{let e=async()=>{try{let e=(await (0,Y.getPoliciesList)(ec)).policies.map(e=>e.policy_name);eH(e)}catch(e){console.error("Failed to fetch policies:",e)}},t=async()=>{try{let e=await (0,Y.getPromptsList)(ec);eG(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}};(async()=>{try{let e=(await (0,Y.getGuardrailsList)(ec)).guardrails.map(e=>e.guardrail_name);eK(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e(),t()},[ec]),(0,I.useEffect)(()=>{(async()=>{try{if(ec){let e=sessionStorage.getItem("possibleUserRoles");if(e)e7(JSON.parse(e));else{let e=await (0,Y.getPossibleUserRoles)(ec);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),e7(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[ec]),(0,I.useEffect)(()=>{if(eo&&!e$&&Z&&em&&O.rolesWithWriteAccess.includes(em)&&(eC(!0),eD(!0),ed)){if(ed.owned_by&&("another_user"===ed.owned_by&&"Admin"!==em?eR("you"):eR(ed.owned_by)),ed.team_id){let e=Z?.find(e=>e.team_id===ed.team_id)||null;e&&(eX(e),eS.setFieldsValue({team_id:ed.team_id}))}ed.key_alias&&eS.setFieldsValue({key_alias:ed.key_alias}),ed.models&&ed.models.length>0&&eB(ed.models),ed.key_type&&(tn(ed.key_type),eS.setFieldsValue({key_type:ed.key_type}))}},[eo,ed,Z,e$,eS,em]);let tN=eL.includes("no-default-models")&&!eJ,tC=async e=>{try{let t,a=e?.key_alias??"",r=e?.team_id??null;if((ee?.filter(e=>e.team_id===r).map(e=>e.key_alias)??[]).includes(a))throw Error(`Key alias ${a} already exists for team with ID ${r}, please provide another key alias`);if(X.default.info("Making API Call"),eC(!0),"you"===eP)e.user_id=eu;else if("agent"===eP){if(!tj)return void X.default.fromBackend("Please select an agent");e.agent_id=tj}let l={};try{l=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===eP&&(l.service_account_id=e.key_alias),eW.length>0&&(l={...l,logging:eW.filter(e=>e.callback_name)}),tr.length>0){let e=(0,A.mapDisplayToInternalNames)(tr);l={...l,litellm_disabled_callbacks:e}}if(tc&&(e.auto_rotate=!0,e.rotation_interval=tm),e.duration&&""!==e.duration.trim()||(e.duration=null),e.metadata=JSON.stringify(l),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&(e.allowed_mcp_servers_and_groups.servers?.length>0||e.allowed_mcp_servers_and_groups.accessGroups?.length>0)){e.object_permission||(e.object_permission={});let{servers:t,accessGroups:s}=e.allowed_mcp_servers_and_groups;t&&t.length>0&&(e.object_permission.mcp_servers=t),s&&s.length>0&&(e.object_permission.mcp_access_groups=s),delete e.allowed_mcp_servers_and_groups}let i=e.mcp_tool_permissions||{};if(Object.keys(i).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=i),delete e.mcp_tool_permissions,e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),e.allowed_agents_and_groups&&(e.allowed_agents_and_groups.agents?.length>0||e.allowed_agents_and_groups.accessGroups?.length>0)){e.object_permission||(e.object_permission={});let{agents:t,accessGroups:s}=e.allowed_agents_and_groups;t&&t.length>0&&(e.object_permission.agents=t),s&&s.length>0&&(e.object_permission.agent_access_groups=s),delete e.allowed_agents_and_groups}Object.keys(to).length>0&&(e.aliases=JSON.stringify(to)),th?.router_settings&&Object.values(th.router_settings).some(e=>null!=e&&""!==e)&&(e.router_settings=th.router_settings);let n=tf.filter(e=>e.budget_duration&&null!==e.max_budget&&void 0!==e.max_budget);n.length>0&&(e.budget_limits=n),t="service_account"===eP?await (0,Y.keyCreateServiceAccountCall)(ec,e):await (0,Y.keyCreateCall)(ec,eu,e),console.log("key create Response:",t),en(t),ek.invalidateQueries({queryKey:s.keyKeys.lists()}),eE(t.key),eO(t.soft_budget),X.default.success("Virtual Key Created"),eS.resetFields(),tx([]),localStorage.removeItem("userData"+eu)}catch(t){console.log("error in create key:",t);let e=(e=>{let t;if(!(t=!e||"object"!=typeof e||e instanceof Error?String(e):JSON.stringify(e)).includes("/key/generate")&&!t.includes("KeyManagementRoutes.KEY_GENERATE"))return`Error creating the key: ${e}`;let s=t;try{if(!e||"object"!=typeof e||e instanceof Error){let e=t.match(/\{[\s\S]*\}/);if(e){let t=JSON.parse(e[0]),a=t?.error||t;a?.message&&(s=a.message)}}else{let t=e?.error||e;t?.message&&(s=t.message)}}catch(e){}return t.includes("team_member_permission_error")||s.includes("Team member does not have permissions")?"Team member does not have permission to generate key for this team. Ask your proxy admin to configure the team member permission settings.":`Error creating the key: ${e}`})(t);X.default.fromBackend(e)}};(0,I.useEffect)(()=>{if(e0){let e=ex?.find(e=>e.project_id===e0);eF(e?.models??[]),eS.setFieldValue("models",[]);return}eu&&em&&ec&&el(eu,em,ec,eJ?.team_id??null).then(e=>{eF(Array.from(new Set([...eJ?.models??[],...e])))}),ez||eS.setFieldValue("models",[]),eS.setFieldValue("allowed_mcp_servers_and_groups",{servers:[],accessGroups:[]})},[eJ,e0,ec,eu,em,eS]),(0,I.useEffect)(()=>{if(!ez||0===ez.length||!eL||0===eL.length)return;let e=ez.filter(e=>eL.includes(e));e.length>0&&eS.setFieldsValue({models:e}),eB(null)},[ez,eL,eS]),(0,I.useEffect)(()=>{if(!e0||!Z)return;let e=ex?.find(e=>e.project_id===e0);if(!e?.team_id||eJ?.team_id===e.team_id)return;let t=Z.find(t=>t.team_id===e.team_id)||null;t&&(eX(t),eS.setFieldValue("team_id",t.team_id))},[Z,e0,ex]);let tT=async e=>{if(!e)return void e9([]);tt(!0);try{let t=new URLSearchParams;if(t.append("user_email",e),null==ec)return;let s=(await (0,Y.userFilterUICall)(ec,t)).map(e=>({label:`${e.user_email} (${e.user_id})`,value:e.user_id,user:e}));e9(s)}catch(e){console.error("Error fetching users:",e),X.default.fromBackend("Failed to search for users")}finally{tt(!1)}},tE=(0,I.useCallback)((0,E.default)(e=>tT(e),300),[ec]);return(0,t.jsxs)("div",{children:[em&&O.rolesWithWriteAccess.includes(em)&&(0,t.jsx)(h.Button,{className:"mx-auto",onClick:()=>eC(!0),"data-testid":"create-key-button",children:"+ Create New Key"}),(0,t.jsx)(w.Modal,{open:eN,width:1e3,footer:null,onOk:tk,onCancel:tS,children:(0,t.jsxs)(_.Form,{form:eS,onFinish:tC,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(b.Title,{className:"mb-4",children:"Key Ownership"}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Owned By"," ",(0,t.jsx)(T.Tooltip,{title:"Select who will own this Virtual Key",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,t.jsxs)(k.Radio.Group,{onChange:e=>eR(e.target.value),value:eP,children:[(0,t.jsx)(k.Radio,{value:"you",children:"You"}),(0,t.jsx)(k.Radio,{value:"service_account",children:"Service Account"}),"Admin"===em&&(0,t.jsx)(k.Radio,{value:"another_user",children:"Another User"}),(0,t.jsxs)(k.Radio,{value:"agent",children:["Agent ",(0,t.jsx)(C.Tag,{color:"purple",children:"New"})]})]})}),"another_user"===eP&&(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["User ID"," ",(0,t.jsx)(T.Tooltip,{title:"The user who will own this key and be responsible for its usage",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===eP,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,t.jsx)(S.Select,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{tE(e)},onSelect:(e,t)=>{let s;return s=t.user,void eS.setFieldsValue({user_id:s.user_id})},options:e8,loading:te,allowClear:!0,style:{width:"100%"},notFoundContent:te?"Searching...":"No users found"}),(0,t.jsx)(v.Button,{onClick:()=>e4(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),"agent"===eP&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-purple-50 border border-purple-200 rounded-md",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Select Agent ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]})}),(0,t.jsx)(S.Select,{showSearch:!0,placeholder:"Select an agent",style:{width:"100%"},value:tj,onChange:e=>tw(e),filterOption:(e,t)=>t?.label?.toLowerCase().includes(e.toLowerCase()),options:tv.map(e=>({label:e.agent_name||e.agent_id,value:e.agent_id}))}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"This key will be used by the selected agent to make requests to LiteLLM"})]}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Organization"," ",(0,t.jsx)(T.Tooltip,{title:"The organization this key belongs to. Selecting an organization filters the available teams.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"organization_id",className:"mt-4",children:(0,t.jsx)(U.default,{organizations:eg,loading:ef,disabled:"Admin"!==em,onChange:e=>{eZ(e||null),eX(null),e1(null),eS.setFieldValue("team_id",void 0),eS.setFieldValue("project_id",void 0)}})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Team"," ",(0,t.jsx)(T.Tooltip,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:e?e.team_id:null,className:"mt-4",rules:[{required:"service_account"===eP,message:"Please select a team for the service account"}],help:"service_account"===eP?"required":"",children:(0,t.jsx)(K.default,{disabled:null!==e0,organizationId:eY,onTeamSelect:e=>{eX(e),e1(null),eS.setFieldValue("project_id",void 0),e?.organization_id?(eZ(e.organization_id),eS.setFieldValue("organization_id",e.organization_id)):e||(eZ(null),eS.setFieldValue("organization_id",void 0))}})}),e_&&(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Project"," ",(0,t.jsx)(T.Tooltip,{title:"Assign this key to a project. Selecting a project will lock the team to the project's team.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"project_id",className:"mt-4",children:(0,t.jsx)(H.default,{projects:ex,teamId:eJ?.team_id,loading:ey||!Z,onChange:e=>{if(!e){e1(null),eX(null),eS.setFieldValue("team_id",void 0);return}e1(e)}})})]}),tN&&(0,t.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,t.jsx)(x.Text,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your Virtual Key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!tN&&(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(b.Title,{className:"mb-4",children:"Key Details"}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["you"===eP||"another_user"===eP?"Key Name":"Service Account ID"," ",(0,t.jsx)(T.Tooltip,{title:"you"===eP||"another_user"===eP?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:`Please input a ${"you"===eP?"key name":"service account ID"}`}],help:"required",children:(0,t.jsx)(y.TextInput,{placeholder:""})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Models"," ",(0,t.jsx)(T.Tooltip,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team. Leave empty to allow access to all models.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",rules:[],help:"management"===ti||"read_only"===ti?"Models field is disabled for this key type":"optional - leave empty to allow access to all models",className:"mt-4",children:(0,t.jsxs)(S.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===ti||"read_only"===ti,onChange:e=>{e.includes("all-team-models")&&eS.setFieldsValue({models:["all-team-models"]})},children:[!e0&&(0,t.jsx)(er,{value:"all-team-models",children:"All Team Models"},"all-team-models"),eL.map(e=>(0,t.jsx)(er,{value:e,children:(0,W.getModelDisplayName)(e)},e))]})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Key Type"," ",(0,t.jsx)(T.Tooltip,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"llm_api",className:"mt-4",children:(0,t.jsxs)(S.Select,{defaultValue:"llm_api",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{tn(e),("management"===e||"read_only"===e)&&eS.setFieldsValue({models:[]})},children:[(0,t.jsx)(er,{value:"default",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call AI APIs + Management routes"})]})}),(0,t.jsx)(er,{value:"llm_api",label:"AI APIs",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"AI APIs"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only AI API routes (chat/completions, embeddings, etc.)"})]})}),(0,t.jsx)(er,{value:"management",label:"Management",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})})]}),!tN&&(0,t.jsx)("div",{className:"mb-8",children:(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)(b.Title,{className:"m-0",children:"Optional Settings"})}),(0,t.jsxs)(m.AccordionBody,{children:[(0,t.jsx)(_.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Max Budget (USD)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:`Budget cannot exceed team max budget: $${e?.max_budget!==null&&e?.max_budget!==void 0?e?.max_budget:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.max_budget&&s>e.max_budget)throw Error(`Budget cannot exceed team max budget: $${(0,o.formatNumberWithCommas)(e.max_budget,4)}`)}}],children:(0,t.jsx)(es.default,{step:.01,precision:2,width:200})}),(0,t.jsx)(_.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Reset Budget"," ",(0,t.jsx)(T.Tooltip,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:`Team Reset Budget: ${e?.budget_duration!==null&&e?.budget_duration!==void 0?e?.budget_duration:"None"}`,children:(0,t.jsx)(F.default,{onChange:e=>eS.setFieldValue("budget_duration",e)})}),(0,t.jsx)(_.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Budget Windows"," ",(0,t.jsx)(T.Tooltip,{title:"Set multiple independent budget windows (e.g., hourly $10 AND monthly $200). Each window tracks spend separately and resets on its own schedule.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,t.jsx)(G.BudgetWindowsEditor,{value:tf,onChange:tx})}),(0,t.jsx)(_.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:`TPM cannot exceed team TPM limit: ${e?.tpm_limit!==null&&e?.tpm_limit!==void 0?e?.tpm_limit:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.tpm_limit&&s>e.tpm_limit)throw Error(`TPM limit cannot exceed team TPM limit: ${e.tpm_limit}`)}}],children:(0,t.jsx)(es.default,{step:1,width:400})}),(0,t.jsx)(B.default,{type:"tpm",name:"tpm_limit_type",className:"mt-4",initialValue:null,form:eS,showDetailedDescriptions:!0}),(0,t.jsx)(_.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:`RPM cannot exceed team RPM limit: ${e?.rpm_limit!==null&&e?.rpm_limit!==void 0?e?.rpm_limit:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.rpm_limit&&s>e.rpm_limit)throw Error(`RPM limit cannot exceed team RPM limit: ${e.rpm_limit}`)}}],children:(0,t.jsx)(es.default,{step:1,width:400})}),(0,t.jsx)(B.default,{type:"rpm",name:"rpm_limit_type",className:"mt-4",initialValue:null,form:eS,showDetailedDescriptions:!0}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(T.Tooltip,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:eh?"Select existing guardrails or enter new ones":"Premium feature - Upgrade to set guardrails by key",children:(0,t.jsx)(S.Select,{mode:"tags",style:{width:"100%"},disabled:!eh,placeholder:eh?"Select or enter guardrails":"Premium feature - Upgrade to set guardrails by key",options:eq.map(e=>({value:e,label:e}))})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(T.Tooltip,{title:"When enabled, this key will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"disable_global_guardrails",className:"mt-4",valuePropName:"checked",help:eh?"Bypass global guardrails for this key":"Premium feature - Upgrade to disable global guardrails by key",children:(0,t.jsx)(N.Switch,{disabled:!eh,checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Policies"," ",(0,t.jsx)(T.Tooltip,{title:"Apply policies to this key to control guardrails and other settings",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",className:"mt-4",help:ep?"Select existing policies or enter new ones":"Premium feature - Upgrade to set policies by key",children:(0,t.jsx)(S.Select,{mode:"tags",style:{width:"100%"},disabled:!ep,placeholder:ep?"Select or enter policies":"Premium feature - Upgrade to set policies by key",options:eU.map(e=>({value:e,label:e}))})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Prompts"," ",(0,t.jsx)(T.Tooltip,{title:"Allow this key to use specific prompt templates",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/prompt_management",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"prompts",className:"mt-4",help:ep?"Select existing prompts or enter new ones":"Premium feature - Upgrade to set prompts by key",children:(0,t.jsx)(S.Select,{mode:"tags",style:{width:"100%"},disabled:!ep,placeholder:ep?"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:eV.map(e=>({value:e,label:e}))})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Access Groups"," ",(0,t.jsx)(T.Tooltip,{title:"Assign access groups to this key. Access groups control which models, MCP servers, and agents this key can use",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",className:"mt-4",help:"Select access groups to assign to this key",children:(0,t.jsx)(L.default,{placeholder:"Select access groups (optional)"})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Pass Through Routes"," ",(0,t.jsx)(T.Tooltip,{title:"Allow this key to use specific pass through routes",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"allowed_passthrough_routes",className:"mt-4",help:ep?"Select existing pass through routes or enter new ones":"Premium feature - Upgrade to set pass through routes by key",children:(0,t.jsx)(D.default,{onChange:e=>eS.setFieldValue("allowed_passthrough_routes",e),value:eS.getFieldValue("allowed_passthrough_routes"),accessToken:ec,placeholder:ep?"Select or enter pass through routes":"Premium feature - Upgrade to set pass through routes by key",disabled:!ep,teamId:eJ?eJ.team_id:null})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,t.jsx)(T.Tooltip,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,t.jsx)(ea.default,{onChange:e=>eS.setFieldValue("allowed_vector_store_ids",e),value:eS.getFieldValue("allowed_vector_store_ids"),accessToken:ec,placeholder:"Select vector stores (optional)"})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Metadata"," ",(0,t.jsx)(T.Tooltip,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,t.jsx)(j.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Tags"," ",(0,t.jsx)(T.Tooltip,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,t.jsx)(S.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",tokenSeparators:[","],options:ew})}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"MCP Settings"})}),(0,t.jsxs)(m.AccordionBody,{children:[(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,t.jsx)(T.Tooltip,{title:"Select which MCP servers or access groups this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",help:"Select MCP servers or access groups this key can access",children:(0,t.jsx)(Q.default,{onChange:e=>eS.setFieldValue("allowed_mcp_servers_and_groups",e),value:eS.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:ec,teamId:eJ?.team_id??null,placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(_.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(j.Input,{type:"hidden"})}),(0,t.jsx)(_.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.allowed_mcp_servers_and_groups!==t.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(J.default,{accessToken:ec,selectedServers:eS.getFieldValue("allowed_mcp_servers_and_groups")?.servers||[],toolPermissions:eS.getFieldValue("mcp_tool_permissions")||{},onChange:e=>eS.setFieldsValue({mcp_tool_permissions:e})})})})]})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Agent Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)(_.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Agents"," ",(0,t.jsx)(T.Tooltip,{title:"Select which agents or access groups this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_agents_and_groups",help:"Select agents or access groups this key can access",children:(0,t.jsx)(M.default,{onChange:e=>eS.setFieldValue("allowed_agents_and_groups",e),value:eS.getFieldValue("allowed_agents_and_groups"),accessToken:ec,placeholder:"Select agents or access groups (optional)"})})})]}),ep?(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(z.default,{value:eW,onChange:eQ,premiumUser:!0,disabledCallbacks:tr,onDisabledCallbacksChange:tl})})})]}):(0,t.jsx)(T.Tooltip,{title:(0,t.jsxs)("span",{children:["Key-level logging settings is an enterprise feature, get in touch -",(0,t.jsx)("a",{href:"https://www.litellm.ai/enterprise",target:"_blank",children:"https://www.litellm.ai/enterprise"})]}),placement:"top",children:(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("div",{style:{opacity:.5},children:(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(z.default,{value:eW,onChange:eQ,premiumUser:!1,disabledCallbacks:tr,onDisabledCallbacksChange:tl})})})]})}),(0,t.jsx)("div",{style:{position:"absolute",inset:0,cursor:"not-allowed"}})]})}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Router Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4 w-full",children:(0,t.jsx)(q.default,{accessToken:ec||"",value:th||void 0,onChange:tg,modelData:eM.length>0?{data:eM.map(e=>({model_name:e}))}:void 0},ty)})})]},`router-settings-accordion-${ty}`),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Model Aliases"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(x.Text,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used in API calls. This allows you to create shortcuts for specific models."}),(0,t.jsx)($.default,{accessToken:ec,initialModelAliases:to,onAliasUpdate:td,showExampleConfig:!1})]})})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Key Lifecycle"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(R.default,{form:eS,autoRotationEnabled:tc,onAutoRotationChange:tu,rotationInterval:tm,onRotationIntervalChange:tp,isCreateMode:!0})})}),(0,t.jsx)(_.Form.Item,{name:"duration",hidden:!0,initialValue:null,children:(0,t.jsx)(j.Input,{})})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("b",{children:"Advanced Settings"}),(0,t.jsx)(T.Tooltip,{title:(0,t.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,t.jsx)("a",{href:Y.proxyBaseUrl?`${Y.proxyBaseUrl}/#/key%20management/generate_key_fn_key_generate_post`:"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,t.jsx)(d.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)(P.default,{schemaComponent:"GenerateKeyRequest",form:eS,excludedFields:["key_alias","team_id","organization_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit",...ej?["key"]:[]]})})]})]})]})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(v.Button,{htmlType:"submit",disabled:tN,style:{opacity:tN?.5:1},children:"Create Key"})})]})}),e2&&(0,t.jsx)(w.Modal,{title:"Create New User",open:e2,onCancel:()=>e4(!1),footer:null,width:800,children:(0,t.jsx)(V.CreateUserButton,{userID:eu,accessToken:ec,teams:Z,possibleUIRoles:e5,onUserCreated:e=>{e6(e),eS.setFieldsValue({user_id:e}),e4(!1)},isEmbedded:!0})}),eT&&(0,t.jsx)(w.Modal,{open:eN,onOk:tk,onCancel:tS,footer:null,children:(0,t.jsxs)(f.Grid,{numItems:1,className:"gap-2 w-full",children:[(0,t.jsx)(b.Title,{children:"Save your Key"}),(0,t.jsx)(g.Col,{numColSpan:1,children:null!=eT?(0,t.jsx)(et,{apiKey:eT}):(0,t.jsx)(x.Text,{children:"Key being created, this might take 30s"})})]})})]})},"fetchTeamModels",0,el,"fetchUserModels",0,ei],702597)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/276409aa6cbc14db.js b/litellm/proxy/_experimental/out/_next/static/chunks/276409aa6cbc14db.js
new file mode 100644
index 0000000000..89d5e010e4
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/276409aa6cbc14db.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,109034,e=>{"use strict";var t=e.i(266027),s=e.i(243652),l=e.i(764205),a=e.i(135214);let r=(0,s.createQueryKeys)("tags");e.s(["useTags",0,()=>{let{accessToken:e,userId:s,userRole:i}=(0,a.default)();return(0,t.useQuery)({queryKey:r.list({}),queryFn:async()=>await (0,l.tagListCall)(e),enabled:!!(e&&s&&i)})}])},9314,263147,e=>{"use strict";var t=e.i(843476),s=e.i(199133),l=e.i(981339),a=e.i(645526),r=e.i(599724),i=e.i(266027),n=e.i(243652),o=e.i(764205),d=e.i(708347),c=e.i(135214);let u=(0,n.createQueryKeys)("accessGroups"),m=async e=>{let t=(0,o.getProxyBaseUrl)(),s=`${t}/v1/access_group`,l=await fetch(s,{method:"GET",headers:{[(0,o.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=(0,o.deriveErrorMessage)(e);throw(0,o.handleError)(t),Error(t)}return l.json()},p=()=>{let{accessToken:e,userRole:t}=(0,c.default)();return(0,i.useQuery)({queryKey:u.list({}),queryFn:async()=>m(e),enabled:!!e&&d.all_admin_roles.includes(t||"")})};e.s(["accessGroupKeys",0,u,"useAccessGroups",0,p],263147),e.s(["default",0,({value:e,onChange:i,placeholder:n="Select access groups",disabled:o=!1,style:d,className:c,showLabel:u=!1,labelText:m="Access Group",allowClear:g=!0})=>{let{data:h,isLoading:x,isError:y}=p();if(x)return(0,t.jsxs)("div",{children:[u&&(0,t.jsxs)(r.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.TeamOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(l.Skeleton.Input,{active:!0,block:!0,style:{height:32,...d}})]});let f=(h??[]).map(e=>({label:(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:e.access_group_name})," ",(0,t.jsxs)("span",{className:"text-gray-400 text-xs",children:["(",e.access_group_id,")"]})]}),value:e.access_group_id,selectedLabel:e.access_group_name,searchText:`${e.access_group_name} ${e.access_group_id}`}));return(0,t.jsxs)("div",{children:[u&&(0,t.jsxs)(r.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.TeamOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(s.Select,{mode:"multiple",value:e,placeholder:n,onChange:i,disabled:o,allowClear:g,showSearch:!0,style:{width:"100%",...d},className:`rounded-md ${c??""}`,notFoundContent:y?(0,t.jsx)("span",{className:"text-red-500",children:"Failed to load access groups"}):"No access groups found",filterOption:(e,t)=>(f.find(e=>e.value===t?.value)?.searchText??"").toLowerCase().includes(e.toLowerCase()),optionLabelProp:"selectedLabel",options:f.map(e=>({label:e.label,value:e.value,selectedLabel:e.selectedLabel}))})]})}],9314)},552130,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:r,className:i,accessToken:n,placeholder:o="Select agents",disabled:d=!1})=>{let[c,u]=(0,s.useState)([]),[m,p]=(0,s.useState)([]),[g,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(n){h(!0);try{let e=await (0,a.getAgentsList)(n),t=e?.agents||[];u(t);let s=new Set;t.forEach(e=>{let t=e.agent_access_groups;t&&Array.isArray(t)&&t.forEach(e=>s.add(e))}),p(Array.from(s))}catch(e){console.error("Error fetching agents:",e)}finally{h(!1)}}})()},[n]);let x=[...m.map(e=>({label:e,value:`group:${e}`,isAccessGroup:!0,searchText:`${e} Access Group`})),...c.map(e=>({label:`${e.agent_name||e.agent_id}`,value:e.agent_id,isAccessGroup:!1,searchText:`${e.agent_name||e.agent_id} ${e.agent_id} Agent`}))],y=[...r?.agents||[],...(r?.accessGroups||[]).map(e=>`group:${e}`)];return(0,t.jsx)("div",{children:(0,t.jsx)(l.Select,{mode:"multiple",placeholder:o,onChange:t=>{e({agents:t.filter(e=>!e.startsWith("group:")),accessGroups:t.filter(e=>e.startsWith("group:")).map(e=>e.replace("group:",""))})},value:y,loading:g,className:i,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>(x.find(e=>e.value===t?.value)?.searchText||"").toLowerCase().includes(e.toLowerCase()),children:x.map(e=>(0,t.jsx)(l.Select.Option,{value:e.value,label:e.label,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#722ed1",flexShrink:0}}),(0,t.jsx)("span",{style:{flex:1},children:e.label}),(0,t.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#722ed1",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"Agent"})]})},e.value))})})}])},844565,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:r,className:i,accessToken:n,placeholder:o="Select pass through routes",disabled:d=!1,teamId:c})=>{let[u,m]=(0,s.useState)([]),[p,g]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(n){g(!0);try{let e=await (0,a.getPassThroughEndpointsCall)(n,c);if(e.endpoints){let t=e.endpoints.flatMap(e=>{let t=e.path,s=e.methods;return s&&s.length>0?s.map(e=>({label:`${e} ${t}`,value:t})):[{label:t,value:t}]});m(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{g(!1)}}})()},[n,c]),(0,t.jsx)(l.Select,{mode:"tags",placeholder:o,onChange:e,value:r,loading:p,className:i,allowClear:!0,options:u,optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}])},810757,477386,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});e.s(["CogIcon",0,s],810757);let l=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});e.s(["BanIcon",0,l],477386)},557662,e=>{"use strict";let t="../ui/assets/logos/",s=[{id:"arize",displayName:"Arize",logo:`${t}arize.png`,supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"password"},description:"Arize Logging Integration"},{id:"braintrust",displayName:"Braintrust",logo:`${t}braintrust.png`,supports_key_team_logging:!1,dynamic_params:{braintrust_api_key:"password",braintrust_project_name:"text"},description:"Braintrust Logging Integration"},{id:"custom_callback_api",displayName:"Custom Callback API",logo:`${t}custom.svg`,supports_key_team_logging:!0,dynamic_params:{custom_callback_api_url:"text",custom_callback_api_headers:"text"},description:"Custom Callback API Logging Integration"},{id:"datadog",displayName:"Datadog",logo:`${t}datadog.png`,supports_key_team_logging:!1,dynamic_params:{dd_api_key:"password",dd_site:"text"},description:"Datadog Logging Integration"},{id:"lago",displayName:"Lago",logo:`${t}lago.svg`,supports_key_team_logging:!1,dynamic_params:{lago_api_url:"text",lago_api_key:"password"},description:"Lago Billing Logging Integration"},{id:"langfuse",displayName:"Langfuse",logo:`${t}langfuse.png`,supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},{id:"langfuse_otel",displayName:"Langfuse OTEL",logo:`${t}langfuse.png`,supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},{id:"langsmith",displayName:"LangSmith",logo:`${t}langsmith.png`,supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},{id:"openmeter",displayName:"OpenMeter",logo:`${t}openmeter.png`,supports_key_team_logging:!1,dynamic_params:{openmeter_api_key:"password",openmeter_base_url:"text"},description:"OpenMeter Logging Integration"},{id:"otel",displayName:"Open Telemetry",logo:`${t}otel.png`,supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:`${t}aws.svg`,supports_key_team_logging:!1,dynamic_params:{s3_bucket_name:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"S3 Bucket (AWS) Logging Integration"},{id:"SQS",displayName:"SQS",logo:`${t}aws.svg`,supports_key_team_logging:!1,dynamic_params:{sqs_queue_url:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"SQS Queue (AWS) Logging Integration"}],l=s.reduce((e,t)=>(e[t.displayName]=t,e),{}),a=s.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),r=s.reduce((e,t)=>(e[t.id]=t.displayName,e),{});e.s(["callbackInfo",0,l,"callback_map",0,a,"mapDisplayToInternalNames",0,e=>e.map(e=>a[e]||e),"mapInternalToDisplayNames",0,e=>e.map(e=>r[e]||e),"reverse_callback_map",0,r])},75921,e=>{"use strict";var t=e.i(843476),s=e.i(266027),l=e.i(243652),a=e.i(764205),r=e.i(135214);let i=(0,l.createQueryKeys)("mcpAccessGroups");var n=e.i(500727),o=e.i(699857),d=e.i(199133);let c="toolset:";e.s(["default",0,({onChange:e,value:l,className:u,accessToken:m,placeholder:p="Select MCP servers",disabled:g=!1,teamId:h})=>{let{data:x=[],isLoading:y}=(0,n.useMCPServers)(h),{data:f=[],isLoading:_}=(()=>{let{accessToken:e}=(0,r.default)();return(0,s.useQuery)({queryKey:i.list({}),queryFn:async()=>await (0,a.fetchMCPAccessGroups)(e),enabled:!!e})})(),{data:b=[],isLoading:j}=(0,o.useMCPToolsets)(),v=new Set(f),w=[...f.map(e=>({label:e,value:e,type:"accessGroup",searchText:`${e} Access Group`})),...x.map(e=>({label:`${e.server_name||e.server_id} (${e.server_id})`,value:e.server_id,type:"server",searchText:`${e.server_name||e.server_id} ${e.server_id} MCP Server`})),...b.map(e=>({label:e.toolset_name,value:`${c}${e.toolset_id}`,type:"toolset",searchText:`${e.toolset_name} ${e.toolset_id} Toolset`}))],N={accessGroup:"#52c41a",server:"#1890ff",toolset:"#722ed1"},k={accessGroup:"Access Group",server:"MCP Server",toolset:"Toolset"},S=[...l?.servers||[],...l?.accessGroups||[],...(l?.toolsets||[]).map(e=>`${c}${e}`)];return(0,t.jsx)("div",{children:(0,t.jsx)(d.Select,{mode:"multiple",placeholder:p,onChange:t=>{let s=t.filter(e=>e.startsWith(c)).map(e=>e.slice(c.length)),l=t.filter(e=>!e.startsWith(c));e({servers:l.filter(e=>!v.has(e)),accessGroups:l.filter(e=>v.has(e)),toolsets:s})},value:S,loading:y||_||j,className:u,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:g,filterOption:(e,t)=>(w.find(e=>e.value===t?.value)?.searchText||"").toLowerCase().includes(e.toLowerCase()),children:w.map(e=>(0,t.jsx)(d.Select.Option,{value:e.value,label:e.label,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:N[e.type],flexShrink:0}}),(0,t.jsx)("span",{style:{flex:1},children:e.label}),(0,t.jsx)("span",{style:{color:N[e.type],fontSize:"12px",fontWeight:500,opacity:.8},children:k[e.type]})]})},e.value))})})}],75921)},390605,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(764205),a=e.i(599724),r=e.i(482725),i=e.i(91739),n=e.i(500727),o=e.i(531516),d=e.i(696609);e.s(["default",0,({accessToken:e,selectedServers:c,toolPermissions:u,onChange:m,disabled:p=!1})=>{let{data:g=[]}=(0,n.useMCPServers)(),[h,x]=(0,s.useState)({}),[y,f]=(0,s.useState)({}),[_,b]=(0,s.useState)({}),[j,v]=(0,s.useState)({}),w=(0,s.useRef)(u);(0,s.useEffect)(()=>{w.current=u},[u]);let N=(0,s.useMemo)(()=>0===c.length?[]:g.filter(e=>c.includes(e.server_id)),[g,c]),k=async(e,t)=>{f(t=>({...t,[e]:!0})),b(t=>({...t,[e]:""}));try{let s=await (0,l.listMCPTools)(t,e);if(s.error)b(t=>({...t,[e]:s.message||"Failed to fetch tools"})),x(t=>({...t,[e]:[]}));else{let t=s.tools||[];x(s=>({...s,[e]:t}));let l=w.current;if(!l[e]&&t.length>0){let s=t.filter(e=>"delete"!==(0,d.classifyToolOp)(e.name,e.description||"")).map(e=>e.name);m({...l,[e]:s})}}}catch(t){console.error(`Error fetching tools for server ${e}:`,t),b(t=>({...t,[e]:"Failed to fetch tools"})),x(t=>({...t,[e]:[]}))}finally{f(t=>({...t,[e]:!1}))}};(0,s.useEffect)(()=>{N.forEach(t=>{h[t.server_id]||y[t.server_id]||k(t.server_id,e)})},[N,e]);let S=(e,t)=>{m({...u,[e]:t})};return 0===c.length?null:(0,t.jsx)("div",{className:"space-y-4",children:N.map(e=>{let s=e.server_name||e.alias||e.server_id,l=h[e.server_id]||[],n=u[e.server_id]||[],d=y[e.server_id],c=_[e.server_id],g=j[e.server_id]??"crud";return(0,t.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.Text,{className:"font-semibold text-gray-900",children:s}),e.description&&(0,t.jsx)(a.Text,{className:"text-sm text-gray-500",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[!p&&l.length>0&&(0,t.jsx)(i.Radio.Group,{value:g,onChange:t=>v(s=>({...s,[e.server_id]:t.target.value})),size:"small",optionType:"button",buttonStyle:"solid",options:[{label:"Risk Groups",value:"crud"},{label:"Flat List",value:"flat"}]}),!p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>{var t;let s;return s=h[t=e.server_id]||[],void m({...u,[t]:s.map(e=>e.name)})},disabled:d,children:"Select All"}),(0,t.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>{var t;return t=e.server_id,void m({...u,[t]:[]})},disabled:d,children:"Deselect All"})]})]})]}),(0,t.jsxs)("div",{className:"p-4",children:[d&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,t.jsx)(r.Spin,{size:"large"}),(0,t.jsx)(a.Text,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),c&&!d&&(0,t.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,t.jsx)(a.Text,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,t.jsx)(a.Text,{className:"text-sm text-red-500 mt-1",children:c})]}),!d&&!c&&l.length>0&&"crud"===g&&(0,t.jsx)(o.default,{tools:l,value:u[e.server_id]?n:void 0,onChange:t=>S(e.server_id,t),readOnly:p}),!d&&!c&&l.length>0&&"flat"===g&&(0,t.jsx)("div",{className:"space-y-2",children:l.map(s=>{let l=n.includes(s.name);return(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:()=>{if(p)return;let t=l?n.filter(e=>e!==s.name):[...n,s.name];S(e.server_id,t)},disabled:p,className:"mt-0.5"}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Text,{className:"font-medium text-gray-900",children:s.name}),(0,t.jsxs)(a.Text,{className:"text-sm text-gray-500",children:["- ",s.description||"No description"]})]})})]},s.name)})}),!d&&!c&&0===l.length&&(0,t.jsx)("div",{className:"text-center py-6",children:(0,t.jsx)(a.Text,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}])},266484,e=>{"use strict";var t=e.i(843476),s=e.i(199133),l=e.i(592968),a=e.i(312361),r=e.i(827252),i=e.i(994388),n=e.i(304967),o=e.i(779241),d=e.i(988297),c=e.i(68155),u=e.i(810757),m=e.i(477386),p=e.i(557662),g=e.i(435451);let{Option:h}=s.Select;e.s(["default",0,({value:e=[],onChange:x,disabledCallbacks:y=[],onDisabledCallbacksChange:f})=>{let _=Object.entries(p.callbackInfo).filter(([e,t])=>t.supports_key_team_logging).map(([e,t])=>e),b=Object.keys(p.callbackInfo),j=e=>{x?.(e)},v=(t,s,l)=>{let a=[...e];if("callback_name"===s){let e=p.callback_map[l]||l;a[t]={...a[t],[s]:e,callback_vars:{}}}else a[t]={...a[t],[s]:l};j(a)},w=(t,s,l)=>{let a=[...e];a[t]={...a[t],callback_vars:{...a[t].callback_vars,[s]:l}},j(a)};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(m.BanIcon,{className:"w-5 h-5 text-red-500"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,t.jsx)(l.Tooltip,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,t.jsx)(r.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,t.jsx)(s.Select,{mode:"multiple",placeholder:"Select callbacks to disable",value:y,onChange:e=>{let t=(0,p.mapDisplayToInternalNames)(e);f?.(t)},style:{width:"100%"},optionLabelProp:"label",children:b.map(e=>{let s=p.callbackInfo[e]?.logo,a=p.callbackInfo[e]?.description;return(0,t.jsx)(h,{value:e,label:e,children:(0,t.jsx)(l.Tooltip,{title:a,placement:"right",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,t.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let s=t.target,l=s.parentElement;if(l){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),l.replaceChild(t,s)}}}),(0,t.jsx)("span",{children:e})]})})},e)})}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,t.jsx)(a.Divider,{}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(u.CogIcon,{className:"w-5 h-5 text-blue-500"}),(0,t.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,t.jsx)(l.Tooltip,{title:"Configure callback logging integrations for this team.",children:(0,t.jsx)(r.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),(0,t.jsx)(i.Button,{variant:"secondary",onClick:()=>{j([...e,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:d.PlusIcon,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,t.jsx)("div",{className:"space-y-4",children:e.map((a,d)=>{let u=a.callback_name?Object.entries(p.callback_map).find(([e,t])=>t===a.callback_name)?.[0]:void 0,m=u?p.callbackInfo[u]?.logo:null;return(0,t.jsxs)(n.Card,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,t.jsx)("img",{src:m,alt:u,className:"w-5 h-5 object-contain"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:[u||"New Integration"," Configuration"]})]}),(0,t.jsx)(i.Button,{variant:"light",onClick:()=>{j(e.filter((e,t)=>t!==d))},icon:c.TrashIcon,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,t.jsx)(s.Select,{value:u,placeholder:"Select integration",onChange:e=>v(d,"callback_name",e),className:"w-full",optionLabelProp:"label",children:_.map(e=>{let s=p.callbackInfo[e]?.logo,a=p.callbackInfo[e]?.description;return(0,t.jsx)(h,{value:e,label:e,children:(0,t.jsx)(l.Tooltip,{title:a,placement:"right",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,t.jsx)("img",{src:s,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let s=t.target,l=s.parentElement;if(l){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),l.replaceChild(t,s)}}}),(0,t.jsx)("span",{children:e})]})})},e)})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,t.jsxs)(s.Select,{value:a.callback_type,onChange:e=>v(d,"callback_type",e),className:"w-full",children:[(0,t.jsx)(h,{value:"success",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{children:"Success Only"})]})}),(0,t.jsx)(h,{value:"failure",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,t.jsx)("span",{children:"Failure Only"})]})}),(0,t.jsx)(h,{value:"success_and_failure",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),((e,s)=>{if(!e.callback_name)return null;let a=Object.entries(p.callback_map).find(([t,s])=>s===e.callback_name)?.[0];if(!a)return null;let i=p.callbackInfo[a]?.dynamic_params||{};return 0===Object.keys(i).length?null:(0,t.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,t.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(i).map(([a,i])=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,t.jsx)("span",{children:a.replace(/_/g," ")}),(0,t.jsx)(l.Tooltip,{title:`Environment variable reference recommended: os.environ/${a.toUpperCase()}`,children:(0,t.jsx)(r.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})}),"password"===i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===i&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===i&&(0,t.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===i?(0,t.jsx)(g.default,{step:.01,width:400,placeholder:`os.environ/${a.toUpperCase()}`,value:e.callback_vars[a]||"",onChange:e=>w(s,a,e.target.value)}):(0,t.jsx)(o.TextInput,{type:"password"===i?"password":"text",placeholder:`os.environ/${a.toUpperCase()}`,value:e.callback_vars[a]||"",onChange:e=>w(s,a,e.target.value)})]},a))})]})})(a,d)]})]},d)})}),0===e.length&&(0,t.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,t.jsx)(u.CogIcon,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,t.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,t.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}])},460285,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(404206),a=e.i(723731),r=e.i(653824),i=e.i(881073),n=e.i(197647),o=e.i(764205),d=e.i(158392),c=e.i(419470),u=e.i(689020);let m=(0,s.forwardRef)(({accessToken:e,value:m,onChange:p,modelData:g},h)=>{let[x,y]=(0,s.useState)({routerSettings:{},selectedStrategy:null,enableTagFiltering:!1}),[f,_]=(0,s.useState)([]),[b,j]=(0,s.useState)([]),[v,w]=(0,s.useState)([]),[N,k]=(0,s.useState)([]),[S,C]=(0,s.useState)({}),[T,I]=(0,s.useState)({}),A=(0,s.useRef)(!1),L=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=m?.router_settings?JSON.stringify({routing_strategy:m.router_settings.routing_strategy,fallbacks:m.router_settings.fallbacks,enable_tag_filtering:m.router_settings.enable_tag_filtering}):null;if(A.current&&e===L.current){A.current=!1;return}if(A.current&&e!==L.current&&(A.current=!1),e!==L.current)if(L.current=e,m?.router_settings){let e=m.router_settings,{fallbacks:t,...s}=e;y({routerSettings:s,selectedStrategy:e.routing_strategy||null,enableTagFiltering:e.enable_tag_filtering??!1});let l=e.fallbacks||[];_(l),j(l&&0!==l.length?l.map((e,t)=>{let[s,l]=Object.entries(e)[0];return{id:(t+1).toString(),primaryModel:s||null,fallbackModels:l||[]}}):[{id:"1",primaryModel:null,fallbackModels:[]}])}else y({routerSettings:{},selectedStrategy:null,enableTagFiltering:!1}),_([]),j([{id:"1",primaryModel:null,fallbackModels:[]}])},[m]),(0,s.useEffect)(()=>{e&&(0,o.getRouterSettingsCall)(e).then(e=>{if(e.fields){let t={};e.fields.forEach(e=>{t[e.field_name]={ui_field_name:e.ui_field_name,field_description:e.field_description,options:e.options,link:e.link}}),C(t);let s=e.fields.find(e=>"routing_strategy"===e.field_name);s?.options&&k(s.options),e.routing_strategy_descriptions&&I(e.routing_strategy_descriptions)}})},[e]),(0,s.useEffect)(()=>{e&&(async()=>{try{let t=await (0,u.fetchAvailableModels)(e);w(t)}catch(e){console.error("Error fetching model info for fallbacks:",e)}})()},[e]);let F=()=>{let e=new Set(["allowed_fails","cooldown_time","num_retries","timeout","retry_after"]),t=new Set(["model_group_alias","retry_policy"]),s=Object.fromEntries(Object.entries({...x.routerSettings,enable_tag_filtering:x.enableTagFiltering,routing_strategy:x.selectedStrategy,fallbacks:f.length>0?f:null}).map(([s,l])=>{if("routing_strategy_args"!==s&&"routing_strategy"!==s&&"enable_tag_filtering"!==s&&"fallbacks"!==s){let a=document.querySelector(`input[name="${s}"]`);if(a){if(void 0!==a.value&&""!==a.value){let r=((s,l,a)=>{if(null==l)return a;let r=String(l).trim();if(""===r||"null"===r.toLowerCase())return null;if(e.has(s)){let e=Number(r);return Number.isNaN(e)?a:e}if(t.has(s)){if(""===r)return null;try{return JSON.parse(r)}catch{return a}}return"true"===r.toLowerCase()||"false"!==r.toLowerCase()&&r})(s,a.value,l);return[s,r]}return[s,null]}}else if("routing_strategy"===s)return[s,x.selectedStrategy];else if("enable_tag_filtering"===s)return[s,x.enableTagFiltering];else if("fallbacks"===s)return[s,f.length>0?f:null];else if("routing_strategy_args"===s&&"latency-based-routing"===x.selectedStrategy){let e=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]'),s={};return e?.value&&(s.lowest_latency_buffer=Number(e.value)),t?.value&&(s.ttl=Number(t.value)),["routing_strategy_args",Object.keys(s).length>0?s:null]}return[s,l]}).filter(e=>null!=e)),l=(e,t=!1)=>null==e||"object"==typeof e&&!Array.isArray(e)&&0===Object.keys(e).length||t&&("number"!=typeof e||Number.isNaN(e))?null:e;return{routing_strategy:l(s.routing_strategy),allowed_fails:l(s.allowed_fails,!0),cooldown_time:l(s.cooldown_time,!0),num_retries:l(s.num_retries,!0),timeout:l(s.timeout,!0),retry_after:l(s.retry_after,!0),fallbacks:f.length>0?f:null,context_window_fallbacks:l(s.context_window_fallbacks),retry_policy:l(s.retry_policy),model_group_alias:l(s.model_group_alias),enable_tag_filtering:x.enableTagFiltering,routing_strategy_args:l(s.routing_strategy_args)}};(0,s.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>{A.current=!0,p({router_settings:F()})},100);return()=>clearTimeout(e)},[x,f]);let O=Array.from(new Set(v.map(e=>e.model_group))).sort();return((0,s.useImperativeHandle)(h,()=>({getValue:()=>({router_settings:F()})})),e)?(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)(r.TabGroup,{className:"w-full",children:[(0,t.jsxs)(i.TabList,{variant:"line",defaultValue:"1",className:"px-8 pt-4",children:[(0,t.jsx)(n.Tab,{value:"1",children:"Loadbalancing"}),(0,t.jsx)(n.Tab,{value:"2",children:"Fallbacks"})]}),(0,t.jsxs)(a.TabPanels,{className:"px-8 py-6",children:[(0,t.jsx)(l.TabPanel,{children:(0,t.jsx)(d.default,{value:x,onChange:y,routerFieldsMetadata:S,availableRoutingStrategies:N,routingStrategyDescriptions:T})}),(0,t.jsx)(l.TabPanel,{children:(0,t.jsx)(c.FallbackSelectionForm,{groups:b,onGroupsChange:e=>{j(e),_(e.filter(e=>e.primaryModel&&e.fallbackModels.length>0).map(e=>({[e.primaryModel]:e.fallbackModels})))},availableModels:O,maxGroups:5})})]})]})}):null});m.displayName="RouterSettingsAccordion",e.s(["default",0,m])},207082,e=>{"use strict";var t=e.i(619273),s=e.i(266027),l=e.i(243652),a=e.i(764205),r=e.i(135214);let i=(0,l.createQueryKeys)("keys"),n=async(e,t,s,l={})=>{try{let r=(0,a.getProxyBaseUrl)(),i=new URLSearchParams(Object.entries({team_id:l.teamID,project_id:l.projectID,organization_id:l.organizationID,key_alias:l.selectedKeyAlias,key_hash:l.keyHash,user_id:l.userID,page:t,size:s,sort_by:l.sortBy,sort_order:l.sortOrder,expand:l.expand,status:l.status,return_full_object:"true",include_team_keys:"true",include_created_by_keys:"true"}).filter(([,e])=>null!=e).map(([e,t])=>[e,String(t)])),n=`${r?`${r}/key/list`:"/key/list"}?${i}`,o=await fetch(n,{method:"GET",headers:{[(0,a.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=(0,a.deriveErrorMessage)(e);throw(0,a.handleError)(t),Error(t)}let d=await o.json();return console.log("/key/list API Response:",d),d}catch(e){throw console.error("Failed to list keys:",e),e}},o=(0,l.createQueryKeys)("deletedKeys");e.s(["keyKeys",0,i,"useDeletedKeys",0,(e,l,a={})=>{let{accessToken:i}=(0,r.default)();return(0,s.useQuery)({queryKey:o.list({page:e,limit:l,...a}),queryFn:async()=>await n(i,e,l,{...a,status:"deleted"}),enabled:!!i,staleTime:3e4,placeholderData:t.keepPreviousData})},"useKeys",0,(e,l,a={})=>{let{accessToken:o}=(0,r.default)();return(0,s.useQuery)({queryKey:i.list({page:e,limit:l,...a}),queryFn:async()=>await n(o,e,l,a),enabled:!!o,staleTime:3e4,placeholderData:t.keepPreviousData})}])},510674,e=>{"use strict";var t=e.i(266027),s=e.i(243652),l=e.i(764205),a=e.i(135214),r=e.i(708347);let i=(0,s.createQueryKeys)("projects"),n=async e=>{let t=(0,l.getProxyBaseUrl)(),s=`${t}/project/list`,a=await fetch(s,{method:"GET",headers:{[(0,l.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=(0,l.deriveErrorMessage)(e);throw(0,l.handleError)(t),Error(t)}return a.json()};e.s(["projectKeys",0,i,"useProjects",0,()=>{let{accessToken:e,userRole:s}=(0,a.default)();return(0,t.useQuery)({queryKey:i.list({}),queryFn:async()=>n(e),enabled:!!e&&r.all_admin_roles.includes(s)})}])},392110,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(199133),a=e.i(592968),r=e.i(312361),i=e.i(790848),n=e.i(536916),o=e.i(827252),d=e.i(779241);let{Option:c}=l.Select;e.s(["default",0,({form:e,autoRotationEnabled:u,onAutoRotationChange:m,rotationInterval:p,onRotationIntervalChange:g,isCreateMode:h=!1,neverExpire:x=!1,onNeverExpireChange:y})=>{let f=p&&!["7d","30d","90d","180d","365d"].includes(p),[_,b]=(0,s.useState)(f),[j,v]=(0,s.useState)(f?p:""),[w,N]=(0,s.useState)(e?.getFieldValue?.("duration")||"");return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Key Expiry Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Expire Key"}),(0,t.jsx)(a.Tooltip,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})}),!h&&y&&(0,t.jsx)(n.Checkbox,{checked:x,onChange:t=>{let s=t.target.checked;y(s),s&&(N(""),e&&"function"==typeof e.setFieldValue?e.setFieldValue("duration",""):e&&"function"==typeof e.setFieldsValue&&e.setFieldsValue({duration:""}))},className:"ml-2 text-sm font-normal text-gray-600",children:"Never Expire"})]}),(0,t.jsx)(d.TextInput,{name:"duration",placeholder:h?"e.g., 30d or leave empty to never expire":"e.g., 30d",className:"w-full",value:w,onValueChange:t=>{N(t),e&&"function"==typeof e.setFieldValue?e.setFieldValue("duration",t):e&&"function"==typeof e.setFieldsValue&&e.setFieldsValue({duration:t})},disabled:!h&&x})]})]}),(0,t.jsx)(r.Divider,{}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Auto-Rotation Settings"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Enable Auto-Rotation"}),(0,t.jsx)(a.Tooltip,{title:"Key will automatically regenerate at the specified interval for enhanced security.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsx)(i.Switch,{checked:u,onChange:m,size:"default",className:u?"":"bg-gray-400"})]}),u&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm font-medium text-gray-700 flex items-center space-x-1",children:[(0,t.jsx)("span",{children:"Rotation Interval"}),(0,t.jsx)(a.Tooltip,{title:"How often the key should be automatically rotated. Choose the interval that best fits your security requirements.",children:(0,t.jsx)(o.InfoCircleOutlined,{className:"text-gray-400 cursor-help text-xs"})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(l.Select,{value:_?"custom":p,onChange:e=>{"custom"===e?b(!0):(b(!1),v(""),g(e))},className:"w-full",placeholder:"Select interval",children:[(0,t.jsx)(c,{value:"7d",children:"7 days"}),(0,t.jsx)(c,{value:"30d",children:"30 days"}),(0,t.jsx)(c,{value:"90d",children:"90 days"}),(0,t.jsx)(c,{value:"180d",children:"180 days"}),(0,t.jsx)(c,{value:"365d",children:"365 days"}),(0,t.jsx)(c,{value:"custom",children:"Custom interval"})]}),_&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(d.TextInput,{value:j,onChange:e=>{let t=e.target.value;v(t),g(t)},placeholder:"e.g., 1s, 5m, 2h, 14d"}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Supported formats: seconds (s), minutes (m), hours (h), days (d)"})]})]})]})]}),u&&(0,t.jsx)("div",{className:"bg-blue-50 p-3 rounded-md text-sm text-blue-700",children:"When rotation occurs, you'll receive a notification with the new key. The old key will be deactivated after a brief grace period."})]})]})}])},939510,e=>{"use strict";var t=e.i(843476),s=e.i(808613),l=e.i(199133),a=e.i(592968),r=e.i(827252);let{Option:i}=l.Select;e.s(["default",0,({type:e,name:n,showDetailedDescriptions:o=!0,className:d="",initialValue:c=null,form:u,onChange:m})=>{let p=e.toUpperCase(),g=e.toLowerCase(),h=`Select 'guaranteed_throughput' to prevent overallocating ${p} limit when the key belongs to a Team with specific ${p} limits.`;return(0,t.jsx)(s.Form.Item,{label:(0,t.jsxs)("span",{children:[p," Rate Limit Type"," ",(0,t.jsx)(a.Tooltip,{title:h,children:(0,t.jsx)(r.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:n,initialValue:c,className:d,children:(0,t.jsx)(l.Select,{defaultValue:o?"default":void 0,placeholder:"Select rate limit type",style:{width:"100%"},optionLabelProp:o?"label":void 0,onChange:e=>{u&&u.setFieldValue(n,e),m&&m(e)},children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{value:"best_effort_throughput",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Best effort throughput - no error if we're overallocating ",g," (Team/Key Limits checked at runtime)."]})]})}),(0,t.jsx)(i,{value:"guaranteed_throughput",label:"Guaranteed throughput",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Guaranteed throughput"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["Guaranteed throughput - raise an error if we're overallocating ",g," (also checks model-specific limits)"]})]})}),(0,t.jsx)(i,{value:"dynamic",label:"Dynamic",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Dynamic"}),(0,t.jsxs)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:["If the key has a set ",p," (e.g. 2 ",p,") and there are no 429 errors, it can dynamically exceed the limit when the model being called is not erroring."]})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{value:"best_effort_throughput",children:"Best effort throughput"}),(0,t.jsx)(i,{value:"guaranteed_throughput",children:"Guaranteed throughput"}),(0,t.jsx)(i,{value:"dynamic",children:"Dynamic"})]})})})}])},363256,e=>{"use strict";var t=e.i(843476),s=e.i(199133);let{Text:l}=e.i(898586).Typography;e.s(["default",0,({organizations:e,value:a,onChange:r,disabled:i,loading:n,style:o})=>(0,t.jsx)(s.Select,{showSearch:!0,placeholder:"All Organizations",value:a,onChange:r,disabled:i,loading:n,allowClear:!0,style:{minWidth:280,...o},filterOption:(t,s)=>{if(!s)return!1;let l=e?.find(e=>e.organization_id===s.key);if(!l)return!1;let a=t.toLowerCase().trim(),r=(l.organization_alias||"").toLowerCase(),i=(l.organization_id||"").toLowerCase();return r.includes(a)||i.includes(a)},children:e?.map(e=>(0,t.jsxs)(s.Select.Option,{value:e.organization_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,t.jsxs)(l,{type:"secondary",children:["(",e.organization_id,")"]})]},e.organization_id))})])},319312,e=>{"use strict";var t=e.i(843476),s=e.i(464571),l=e.i(28651),a=e.i(199133);let r=[{value:"1h",label:"Hourly",resetHint:"Resets every hour"},{value:"24h",label:"Daily",resetHint:"Resets daily at midnight UTC"},{value:"7d",label:"Weekly",resetHint:"Resets every Sunday at midnight UTC"},{value:"30d",label:"Monthly",resetHint:"Resets on the 1st of every month at midnight UTC"}];function i({value:e,onChange:i}){let n=(t,s,l)=>{i(e.map((e,a)=>a===t?{...e,[s]:l}:e))};return(0,t.jsxs)("div",{children:[e.map((o,d)=>{let c=r.find(e=>e.value===o.budget_duration)?.resetHint;return(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)(a.Select,{value:o.budget_duration,onChange:e=>n(d,"budget_duration",e),style:{width:130},options:r.map(e=>({value:e.value,label:e.label}))}),(0,t.jsx)(l.InputNumber,{step:.01,min:0,precision:2,value:o.max_budget??void 0,onChange:e=>n(d,"max_budget",e??null),placeholder:"Max spend ($)",style:{width:160},prefix:"$"}),(0,t.jsx)(s.Button,{type:"text",danger:!0,size:"small",onClick:()=>{i(e.filter((e,t)=>t!==d))},style:{padding:"0 4px"},children:"✕"})]}),c&&(0,t.jsxs)("div",{style:{fontSize:11,color:"#888",marginTop:3,marginLeft:2},children:["↻ ",c]})]},d)}),(0,t.jsx)(s.Button,{size:"small",onClick:t=>{t.preventDefault(),i([...e,{budget_duration:"24h",max_budget:null}])},children:"+ Add Budget Window"})]})}e.s(["BudgetWindowsEditor",()=>i])},533882,e=>{"use strict";var t=e.i(843476),s=e.i(271645),l=e.i(250980),a=e.i(797672),r=e.i(68155),i=e.i(304967),n=e.i(629569),o=e.i(599724),d=e.i(269200),c=e.i(427612),u=e.i(64848),m=e.i(942232),p=e.i(496020),g=e.i(977572),h=e.i(992619),x=e.i(727749);e.s(["default",0,({accessToken:e,initialModelAliases:y={},onAliasUpdate:f,showExampleConfig:_=!0})=>{let[b,j]=(0,s.useState)([]),[v,w]=(0,s.useState)({aliasName:"",targetModel:""}),[N,k]=(0,s.useState)(null);(0,s.useEffect)(()=>{j(Object.entries(y).map(([e,t],s)=>({id:`${s}-${e}`,aliasName:e,targetModel:t})))},[y]);let S=()=>{if(!N)return;if(!N.aliasName||!N.targetModel)return void x.default.fromBackend("Please provide both alias name and target model");if(b.some(e=>e.id!==N.id&&e.aliasName===N.aliasName))return void x.default.fromBackend("An alias with this name already exists");let e=b.map(e=>e.id===N.id?N:e);j(e),k(null);let t={};e.forEach(e=>{t[e.aliasName]=e.targetModel}),f&&f(t),x.default.success("Alias updated successfully")},C=()=>{k(null)},T=b.reduce((e,t)=>(e[t.aliasName]=t.targetModel,e),{});return(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(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:"Alias Name"}),(0,t.jsx)("input",{type:"text",value:v.aliasName,onChange:e=>w({...v,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",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:"Target Model"}),(0,t.jsx)(h.default,{accessToken:e,value:v.targetModel,placeholder:"Select target model",onChange:e=>w({...v,targetModel:e}),showLabel:!1})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:()=>{if(!v.aliasName||!v.targetModel)return void x.default.fromBackend("Please provide both alias name and target model");if(b.some(e=>e.aliasName===v.aliasName))return void x.default.fromBackend("An alias with this name already exists");let e=[...b,{id:`${Date.now()}-${v.aliasName}`,aliasName:v.aliasName,targetModel:v.targetModel}];j(e),w({aliasName:"",targetModel:""});let t={};e.forEach(e=>{t[e.aliasName]=e.targetModel}),f&&f(t),x.default.success("Alias added successfully")},disabled:!v.aliasName||!v.targetModel,className:`flex items-center px-4 py-2 rounded-md text-sm ${!v.aliasName||!v.targetModel?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-green-600 text-white hover:bg-green-700"}`,children:[(0,t.jsx)(l.PlusCircleIcon,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,t.jsx)(o.Text,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(d.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(c.TableHead,{children:(0,t.jsxs)(p.TableRow,{children:[(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Alias Name"}),(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Target Model"}),(0,t.jsx)(u.TableHeaderCell,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(m.TableBody,{children:[b.map(s=>(0,t.jsx)(p.TableRow,{className:"h-8",children:N&&N.id===s.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.TableCell,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:N.aliasName,onChange:e=>k({...N,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(g.TableCell,{className:"py-0.5",children:(0,t.jsx)(h.default,{accessToken:e,value:N.targetModel,onChange:e=>k({...N,targetModel:e}),showLabel:!1,style:{height:"32px"}})}),(0,t.jsx)(g.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:S,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:C,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)(g.TableCell,{className:"py-0.5 text-sm text-gray-900",children:s.aliasName}),(0,t.jsx)(g.TableCell,{className:"py-0.5 text-sm text-gray-500",children:s.targetModel}),(0,t.jsx)(g.TableCell,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>{k({...s})},className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,t.jsx)(a.PencilIcon,{className:"w-3 h-3"})}),(0,t.jsx)("button",{onClick:()=>{var e;let t,l;return e=s.id,j(t=b.filter(t=>t.id!==e)),l={},void(t.forEach(e=>{l[e.aliasName]=e.targetModel}),f&&f(l),x.default.success("Alias deleted successfully"))},className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,t.jsx)(r.TrashIcon,{className:"w-3 h-3"})})]})})]})},s.id)),0===b.length&&(0,t.jsx)(p.TableRow,{children:(0,t.jsx)(g.TableCell,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),_&&(0,t.jsxs)(i.Card,{children:[(0,t.jsx)(n.Title,{className:"mb-4",children:"Configuration Example"}),(0,t.jsx)(o.Text,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config:"}),(0,t.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,t.jsxs)("div",{className:"text-gray-700",children:["model_aliases:",0===Object.keys(T).length?(0,t.jsxs)("span",{className:"text-gray-500",children:[(0,t.jsx)("br",{})," # No aliases configured yet"]}):Object.entries(T).map(([e,s])=>(0,t.jsxs)("span",{children:[(0,t.jsx)("br",{}),' "',e,'": "',s,'"']},e))]})})]})]})}])},651904,e=>{"use strict";var t=e.i(843476),s=e.i(599724),l=e.i(266484);e.s(["default",0,function({value:e,onChange:a,premiumUser:r=!1,disabledCallbacks:i=[],onDisabledCallbacksChange:n}){return r?(0,t.jsx)(l.default,{value:e,onChange:a,disabledCallbacks:i,onDisabledCallbacksChange:n}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,t.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,t.jsxs)(s.Text,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key"," ",(0,t.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})}])},575260,e=>{"use strict";var t=e.i(843476),s=e.i(199133),l=e.i(482725),a=e.i(56456);e.s(["default",0,({projects:e,value:r,onChange:i,disabled:n,loading:o,teamId:d})=>{let c=d?e?.filter(e=>e.team_id===d):e;return(0,t.jsx)(s.Select,{showSearch:!0,placeholder:"Search or select a project",value:r,onChange:i,disabled:n,loading:o,allowClear:!0,notFoundContent:o?(0,t.jsx)(l.Spin,{indicator:(0,t.jsx)(a.LoadingOutlined,{spin:!0}),size:"small"}):void 0,filterOption:(e,t)=>{if(!t)return!1;let s=c?.find(e=>e.project_id===t.key);if(!s)return!1;let l=e.toLowerCase().trim(),a=(s.project_alias||"").toLowerCase(),r=(s.project_id||"").toLowerCase();return a.includes(l)||r.includes(l)},optionFilterProp:"children",children:!o&&c?.map(e=>(0,t.jsxs)(s.Select.Option,{value:e.project_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.project_alias||e.project_id})," ",(0,t.jsxs)("span",{className:"text-gray-500",children:["(",e.project_id,")"]})]},e.project_id))})}])},702597,364769,e=>{"use strict";var t=e.i(843476),s=e.i(207082),l=e.i(109799),a=e.i(510674),r=e.i(109034),i=e.i(292639),n=e.i(135214),o=e.i(500330),d=e.i(827252),c=e.i(912598),u=e.i(677667),m=e.i(130643),p=e.i(898667),g=e.i(994388),h=e.i(309426),x=e.i(350967),y=e.i(599724),f=e.i(779241),_=e.i(629569),b=e.i(464571),j=e.i(808613),v=e.i(311451),w=e.i(212931),N=e.i(91739),k=e.i(199133),S=e.i(790848),C=e.i(262218),T=e.i(592968),I=e.i(374009),A=e.i(271645),L=e.i(708347),F=e.i(552130),O=e.i(557662),M=e.i(9314),P=e.i(860585),E=e.i(82946),$=e.i(392110),B=e.i(533882),V=e.i(844565),R=e.i(651904),D=e.i(939510),G=e.i(460285),z=e.i(663435),K=e.i(363256),U=e.i(575260),q=e.i(371455),W=e.i(319312),H=e.i(355619),Q=e.i(75921),J=e.i(390605),Y=e.i(727749),X=e.i(764205),Z=e.i(237016),ee=e.i(888259);let et=({apiKey:e})=>{let[s,l]=(0,A.useState)(!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"mb-2",children:["Please save this secret key somewhere safe and accessible. For security reasons,"," ",(0,t.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-3 mb-1",children:"Virtual Key:"}),(0,t.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,t.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal",margin:0},children:e})}),(0,t.jsx)(Z.CopyToClipboard,{text:e,onCopy:()=>{l(!0),ee.default.success("Key copied to clipboard"),setTimeout(()=>l(!1),2e3)},children:(0,t.jsx)(b.Button,{type:"primary",style:{marginTop:12},children:s?"Copied!":"Copy Virtual Key"})})]})};e.s(["default",0,et],364769);var es=e.i(435451),el=e.i(916940);let{Option:ea}=k.Select,er=async(e,t,s,l)=>{try{if(null===e||null===t)return[];if(null!==s){let a=(await (0,X.modelAvailableCall)(s,e,t,!0,l,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},ei=async(e,t,s,l)=>{try{if(null===e||null===t)return;if(null!==s){let a=(await (0,X.modelAvailableCall)(s,e,t)).data.map(e=>e.id);console.log("available_model_names:",a),l(a)}}catch(e){console.error("Error fetching user models:",e)}};e.s(["default",0,({team:e,teams:Z,data:ee,addKey:en,autoOpenCreate:eo,prefillData:ed})=>{let{accessToken:ec,userId:eu,userRole:em,premiumUser:ep}=(0,n.default)(),eg=ep||null!=em&&L.rolesWithWriteAccess.includes(em),{data:eh,isLoading:ex}=(0,l.useOrganizations)(),{data:ey,isLoading:ef}=(0,a.useProjects)(),{data:e_}=(0,i.useUISettings)(),{data:eb}=(0,r.useTags)(),ej=!!e_?.values?.enable_projects_ui,ev=!!e_?.values?.disable_custom_api_keys,ew=eb?Object.values(eb).map(e=>({value:e.name,label:e.name})):[],eN=(0,c.useQueryClient)(),[ek]=j.Form.useForm(),[eS,eC]=(0,A.useState)(!1),[eT,eI]=(0,A.useState)(null),[eA,eL]=(0,A.useState)(null),[eF,eO]=(0,A.useState)([]),[eM,eP]=(0,A.useState)([]),[eE,e$]=(0,A.useState)("you"),[eB,eV]=(0,A.useState)(!1),[eR,eD]=(0,A.useState)(null),[eG,ez]=(0,A.useState)([]),[eK,eU]=(0,A.useState)([]),[eq,eW]=(0,A.useState)([]),[eH,eQ]=(0,A.useState)([]),[eJ,eY]=(0,A.useState)(e),[eX,eZ]=(0,A.useState)(null),[e0,e1]=(0,A.useState)(null),[e2,e4]=(0,A.useState)(!1),[e5,e3]=(0,A.useState)(null),[e6,e7]=(0,A.useState)({}),[e9,e8]=(0,A.useState)([]),[te,tt]=(0,A.useState)(!1),[ts,tl]=(0,A.useState)([]),[ta,tr]=(0,A.useState)([]),[ti,tn]=(0,A.useState)("llm_api"),[to,td]=(0,A.useState)({}),[tc,tu]=(0,A.useState)(!1),[tm,tp]=(0,A.useState)("30d"),[tg,th]=(0,A.useState)(null),[tx,ty]=(0,A.useState)([]),[tf,t_]=(0,A.useState)(0),[tb,tj]=(0,A.useState)([]),[tv,tw]=(0,A.useState)(null),tN=()=>{eC(!1),ek.resetFields(),eQ([]),tr([]),tn("llm_api"),td({}),tu(!1),tp("30d"),th(null),t_(e=>e+1),tw(null),eZ(null),e1(null),ty([])},tk=()=>{eC(!1),eI(null),eY(null),ek.resetFields(),eQ([]),tr([]),tn("llm_api"),td({}),tu(!1),tp("30d"),th(null),t_(e=>e+1),tw(null),eZ(null),e1(null),ty([])};(0,A.useEffect)(()=>{eu&&em&&ec&&ei(eu,em,ec,eO)},[ec,eu,em]),(0,A.useEffect)(()=>{ec&&(0,X.getAgentsList)(ec).then(e=>tj(e?.agents||[])).catch(()=>tj([]))},[ec]),(0,A.useEffect)(()=>{let e=async()=>{try{let e=(await (0,X.getPoliciesList)(ec)).policies.map(e=>e.policy_name);eU(e)}catch(e){console.error("Failed to fetch policies:",e)}},t=async()=>{try{let e=await (0,X.getPromptsList)(ec);eW(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}};(async()=>{try{let e=(await (0,X.getGuardrailsList)(ec)).guardrails.map(e=>e.guardrail_name);ez(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})(),e(),t()},[ec]),(0,A.useEffect)(()=>{(async()=>{try{if(ec){let e=sessionStorage.getItem("possibleUserRoles");if(e)e7(JSON.parse(e));else{let e=await (0,X.getPossibleUserRoles)(ec);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),e7(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[ec]),(0,A.useEffect)(()=>{if(eo&&!eB&&Z&&em&&L.rolesWithWriteAccess.includes(em)&&(eC(!0),eV(!0),ed)){if(ed.owned_by&&("another_user"===ed.owned_by&&"Admin"!==em?e$("you"):e$(ed.owned_by)),ed.team_id){let e=Z?.find(e=>e.team_id===ed.team_id)||null;e&&(eY(e),ek.setFieldsValue({team_id:ed.team_id}))}ed.key_alias&&ek.setFieldsValue({key_alias:ed.key_alias}),ed.models&&ed.models.length>0&&eD(ed.models),ed.key_type&&(tn(ed.key_type),ek.setFieldsValue({key_type:ed.key_type}))}},[eo,ed,Z,eB,ek,em]);let tS=eM.includes("no-default-models")&&!eJ,tC=async e=>{try{let t,l=e?.key_alias??"",a=e?.team_id??null;if((ee?.filter(e=>e.team_id===a).map(e=>e.key_alias)??[]).includes(l))throw Error(`Key alias ${l} already exists for team with ID ${a}, please provide another key alias`);if(Y.default.info("Making API Call"),eC(!0),"you"===eE)e.user_id=eu;else if("agent"===eE){if(!tv)return void Y.default.fromBackend("Please select an agent");e.agent_id=tv}let r={};try{r=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===eE&&(r.service_account_id=e.key_alias),eH.length>0&&(r={...r,logging:eH.filter(e=>e.callback_name)}),ta.length>0){let e=(0,O.mapDisplayToInternalNames)(ta);r={...r,litellm_disabled_callbacks:e}}if(tc&&(e.auto_rotate=!0,e.rotation_interval=tm),e.duration&&""!==e.duration.trim()||(e.duration=null),e.metadata=JSON.stringify(r),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&(e.allowed_mcp_servers_and_groups.servers?.length>0||e.allowed_mcp_servers_and_groups.accessGroups?.length>0)){e.object_permission||(e.object_permission={});let{servers:t,accessGroups:s}=e.allowed_mcp_servers_and_groups;t&&t.length>0&&(e.object_permission.mcp_servers=t),s&&s.length>0&&(e.object_permission.mcp_access_groups=s),delete e.allowed_mcp_servers_and_groups}let i=e.mcp_tool_permissions||{};if(Object.keys(i).length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_tool_permissions=i),delete e.mcp_tool_permissions,e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),e.allowed_agents_and_groups&&(e.allowed_agents_and_groups.agents?.length>0||e.allowed_agents_and_groups.accessGroups?.length>0)){e.object_permission||(e.object_permission={});let{agents:t,accessGroups:s}=e.allowed_agents_and_groups;t&&t.length>0&&(e.object_permission.agents=t),s&&s.length>0&&(e.object_permission.agent_access_groups=s),delete e.allowed_agents_and_groups}Object.keys(to).length>0&&(e.aliases=JSON.stringify(to)),tg?.router_settings&&Object.values(tg.router_settings).some(e=>null!=e&&""!==e)&&(e.router_settings=tg.router_settings);let n=tx.filter(e=>e.budget_duration&&null!==e.max_budget&&void 0!==e.max_budget);n.length>0&&(e.budget_limits=n),t="service_account"===eE?await (0,X.keyCreateServiceAccountCall)(ec,e):await (0,X.keyCreateCall)(ec,eu,e),console.log("key create Response:",t),en(t),eN.invalidateQueries({queryKey:s.keyKeys.lists()}),eI(t.key),eL(t.soft_budget),Y.default.success("Virtual Key Created"),ek.resetFields(),ty([]),localStorage.removeItem("userData"+eu)}catch(t){console.log("error in create key:",t);let e=(e=>{let t;if(!(t=!e||"object"!=typeof e||e instanceof Error?String(e):JSON.stringify(e)).includes("/key/generate")&&!t.includes("KeyManagementRoutes.KEY_GENERATE"))return`Error creating the key: ${e}`;let s=t;try{if(!e||"object"!=typeof e||e instanceof Error){let e=t.match(/\{[\s\S]*\}/);if(e){let t=JSON.parse(e[0]),l=t?.error||t;l?.message&&(s=l.message)}}else{let t=e?.error||e;t?.message&&(s=t.message)}}catch(e){}return t.includes("team_member_permission_error")||s.includes("Team member does not have permissions")?"Team member does not have permission to generate key for this team. Ask your proxy admin to configure the team member permission settings.":`Error creating the key: ${e}`})(t);Y.default.fromBackend(e)}};(0,A.useEffect)(()=>{if(e0){let e=ey?.find(e=>e.project_id===e0);eP(e?.models??[]),ek.setFieldValue("models",[]);return}eu&&em&&ec&&er(eu,em,ec,eJ?.team_id??null).then(e=>{eP(Array.from(new Set([...eJ?.models??[],...e])))}),eR||ek.setFieldValue("models",[]),ek.setFieldValue("allowed_mcp_servers_and_groups",{servers:[],accessGroups:[]})},[eJ,e0,ec,eu,em,ek]),(0,A.useEffect)(()=>{if(!eR||0===eR.length||!eM||0===eM.length)return;let e=eR.filter(e=>eM.includes(e));e.length>0&&ek.setFieldsValue({models:e}),eD(null)},[eR,eM,ek]),(0,A.useEffect)(()=>{if(!e0||!Z)return;let e=ey?.find(e=>e.project_id===e0);if(!e?.team_id||eJ?.team_id===e.team_id)return;let t=Z.find(t=>t.team_id===e.team_id)||null;t&&(eY(t),ek.setFieldValue("team_id",t.team_id))},[Z,e0,ey]);let tT=async e=>{if(!e)return void e8([]);tt(!0);try{let t=new URLSearchParams;if(t.append("user_email",e),null==ec)return;let s=(await (0,X.userFilterUICall)(ec,t)).map(e=>({label:`${e.user_email} (${e.user_id})`,value:e.user_id,user:e}));e8(s)}catch(e){console.error("Error fetching users:",e),Y.default.fromBackend("Failed to search for users")}finally{tt(!1)}},tI=(0,A.useCallback)((0,I.default)(e=>tT(e),300),[ec]);return(0,t.jsxs)("div",{children:[em&&L.rolesWithWriteAccess.includes(em)&&(0,t.jsx)(g.Button,{className:"mx-auto",onClick:()=>eC(!0),"data-testid":"create-key-button",children:"+ Create New Key"}),(0,t.jsx)(w.Modal,{open:eS,width:1e3,footer:null,onOk:tN,onCancel:tk,children:(0,t.jsxs)(j.Form,{form:ek,onFinish:tC,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(_.Title,{className:"mb-4",children:"Key Ownership"}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Owned By"," ",(0,t.jsx)(T.Tooltip,{title:"Select who will own this Virtual Key",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,t.jsxs)(N.Radio.Group,{onChange:e=>e$(e.target.value),value:eE,children:[(0,t.jsx)(N.Radio,{value:"you",children:"You"}),(0,t.jsx)(N.Radio,{value:"service_account",children:"Service Account"}),"Admin"===em&&(0,t.jsx)(N.Radio,{value:"another_user",children:"Another User"}),(0,t.jsxs)(N.Radio,{value:"agent",children:["Agent ",(0,t.jsx)(C.Tag,{color:"purple",children:"New"})]})]})}),"another_user"===eE&&(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["User ID"," ",(0,t.jsx)(T.Tooltip,{title:"The user who will own this key and be responsible for its usage",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===eE,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,t.jsx)(k.Select,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{tI(e)},onSelect:(e,t)=>{let s;return s=t.user,void ek.setFieldsValue({user_id:s.user_id})},options:e9,loading:te,allowClear:!0,style:{width:"100%"},notFoundContent:te?"Searching...":"No users found"}),(0,t.jsx)(b.Button,{onClick:()=>e4(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),"agent"===eE&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-purple-50 border border-purple-200 rounded-md",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Select Agent ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]})}),(0,t.jsx)(k.Select,{showSearch:!0,placeholder:"Select an agent",style:{width:"100%"},value:tv,onChange:e=>tw(e),filterOption:(e,t)=>t?.label?.toLowerCase().includes(e.toLowerCase()),options:tb.map(e=>({label:e.agent_name||e.agent_id,value:e.agent_id}))}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"This key will be used by the selected agent to make requests to LiteLLM"})]}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Organization"," ",(0,t.jsx)(T.Tooltip,{title:"The organization this key belongs to. Selecting an organization filters the available teams.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"organization_id",className:"mt-4",children:(0,t.jsx)(K.default,{organizations:eh,loading:ex,disabled:"Admin"!==em,onChange:e=>{eZ(e||null),eY(null),e1(null),ek.setFieldValue("team_id",void 0),ek.setFieldValue("project_id",void 0)}})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Team"," ",(0,t.jsx)(T.Tooltip,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:e?e.team_id:null,className:"mt-4",rules:[{required:"service_account"===eE,message:"Please select a team for the service account"}],help:"service_account"===eE?"required":"",children:(0,t.jsx)(z.default,{disabled:null!==e0,organizationId:eX,onTeamSelect:e=>{eY(e),e1(null),ek.setFieldValue("project_id",void 0),e?.organization_id?(eZ(e.organization_id),ek.setFieldValue("organization_id",e.organization_id)):e||(eZ(null),ek.setFieldValue("organization_id",void 0))}})}),ej&&(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Project"," ",(0,t.jsx)(T.Tooltip,{title:"Assign this key to a project. Selecting a project will lock the team to the project's team.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"project_id",className:"mt-4",children:(0,t.jsx)(U.default,{projects:ey,teamId:eJ?.team_id,loading:ef||!Z,onChange:e=>{if(!e){e1(null),eY(null),ek.setFieldValue("team_id",void 0);return}e1(e)}})})]}),tS&&(0,t.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,t.jsx)(y.Text,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your Virtual Key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!tS&&(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(_.Title,{className:"mb-4",children:"Key Details"}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["you"===eE||"another_user"===eE?"Key Name":"Service Account ID"," ",(0,t.jsx)(T.Tooltip,{title:"you"===eE||"another_user"===eE?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:`Please input a ${"you"===eE?"key name":"service account ID"}`}],help:"required",children:(0,t.jsx)(f.TextInput,{placeholder:""})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Models"," ",(0,t.jsx)(T.Tooltip,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team. Leave empty to allow access to all models.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"models",rules:[],help:"management"===ti||"read_only"===ti?"Models field is disabled for this key type":"optional - leave empty to allow access to all models",className:"mt-4",children:(0,t.jsxs)(k.Select,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===ti||"read_only"===ti,onChange:e=>{e.includes("all-team-models")&&ek.setFieldsValue({models:["all-team-models"]})},children:[!e0&&(0,t.jsx)(ea,{value:"all-team-models",children:"All Team Models"},"all-team-models"),eM.map(e=>(0,t.jsx)(ea,{value:e,children:(0,H.getModelDisplayName)(e)},e))]})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Key Type"," ",(0,t.jsx)(T.Tooltip,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"llm_api",className:"mt-4",children:(0,t.jsxs)(k.Select,{defaultValue:"llm_api",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{tn(e),("management"===e||"read_only"===e)&&ek.setFieldsValue({models:[]})},children:[(0,t.jsx)(ea,{value:"default",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call AI APIs + Management routes"})]})}),(0,t.jsx)(ea,{value:"llm_api",label:"AI APIs",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"AI APIs"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only AI API routes (chat/completions, embeddings, etc.)"})]})}),(0,t.jsx)(ea,{value:"management",label:"Management",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})})]}),!tS&&(0,t.jsx)("div",{className:"mb-8",children:(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)(_.Title,{className:"m-0",children:"Optional Settings"})}),(0,t.jsxs)(m.AccordionBody,{children:[(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Max Budget (USD)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:`Budget cannot exceed team max budget: $${e?.max_budget!==null&&e?.max_budget!==void 0?e?.max_budget:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.max_budget&&s>e.max_budget)throw Error(`Budget cannot exceed team max budget: $${(0,o.formatNumberWithCommas)(e.max_budget,4)}`)}}],children:(0,t.jsx)(es.default,{step:.01,precision:2,width:200})}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Reset Budget"," ",(0,t.jsx)(T.Tooltip,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:`Team Reset Budget: ${e?.budget_duration!==null&&e?.budget_duration!==void 0?e?.budget_duration:"None"}`,children:(0,t.jsx)(P.default,{onChange:e=>ek.setFieldValue("budget_duration",e)})}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Budget Windows"," ",(0,t.jsx)(T.Tooltip,{title:"Set multiple independent budget windows (e.g., hourly $10 AND monthly $200). Each window tracks spend separately and resets on its own schedule.",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),children:(0,t.jsx)(W.BudgetWindowsEditor,{value:tx,onChange:ty})}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:`TPM cannot exceed team TPM limit: ${e?.tpm_limit!==null&&e?.tpm_limit!==void 0?e?.tpm_limit:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.tpm_limit&&s>e.tpm_limit)throw Error(`TPM limit cannot exceed team TPM limit: ${e.tpm_limit}`)}}],children:(0,t.jsx)(es.default,{step:1,width:400})}),(0,t.jsx)(D.default,{type:"tpm",name:"tpm_limit_type",className:"mt-4",initialValue:null,form:ek,showDetailedDescriptions:!0}),(0,t.jsx)(j.Form.Item,{className:"mt-4",label:(0,t.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,t.jsx)(T.Tooltip,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:`RPM cannot exceed team RPM limit: ${e?.rpm_limit!==null&&e?.rpm_limit!==void 0?e?.rpm_limit:"unlimited"}`,rules:[{validator:async(t,s)=>{if(s&&e&&null!==e.rpm_limit&&s>e.rpm_limit)throw Error(`RPM limit cannot exceed team RPM limit: ${e.rpm_limit}`)}}],children:(0,t.jsx)(es.default,{step:1,width:400})}),(0,t.jsx)(D.default,{type:"rpm",name:"rpm_limit_type",className:"mt-4",initialValue:null,form:ek,showDetailedDescriptions:!0}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(T.Tooltip,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:eg?"Select existing guardrails or enter new ones":"Premium feature - Upgrade to set guardrails by key",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},disabled:!eg,placeholder:eg?"Select or enter guardrails":"Premium feature - Upgrade to set guardrails by key",options:eG.map(e=>({value:e,label:e}))})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(T.Tooltip,{title:"When enabled, this key will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"disable_global_guardrails",className:"mt-4",valuePropName:"checked",help:eg?"Bypass global guardrails for this key":"Premium feature - Upgrade to disable global guardrails by key",children:(0,t.jsx)(S.Switch,{disabled:!eg,checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Policies"," ",(0,t.jsx)(T.Tooltip,{title:"Apply policies to this key to control guardrails and other settings",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/guardrail_policies",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"policies",className:"mt-4",help:ep?"Select existing policies or enter new ones":"Premium feature - Upgrade to set policies by key",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},disabled:!ep,placeholder:ep?"Select or enter policies":"Premium feature - Upgrade to set policies by key",options:eK.map(e=>({value:e,label:e}))})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Prompts"," ",(0,t.jsx)(T.Tooltip,{title:"Allow this key to use specific prompt templates",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/prompt_management",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"prompts",className:"mt-4",help:ep?"Select existing prompts or enter new ones":"Premium feature - Upgrade to set prompts by key",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},disabled:!ep,placeholder:ep?"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:eq.map(e=>({value:e,label:e}))})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Access Groups"," ",(0,t.jsx)(T.Tooltip,{title:"Assign access groups to this key. Access groups control which models, MCP servers, and agents this key can use",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"access_group_ids",className:"mt-4",help:"Select access groups to assign to this key",children:(0,t.jsx)(M.default,{placeholder:"Select access groups (optional)"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Pass Through Routes"," ",(0,t.jsx)(T.Tooltip,{title:"Allow this key to use specific pass through routes",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})})]}),name:"allowed_passthrough_routes",className:"mt-4",help:ep?"Select existing pass through routes or enter new ones":"Premium feature - Upgrade to set pass through routes by key",children:(0,t.jsx)(V.default,{onChange:e=>ek.setFieldValue("allowed_passthrough_routes",e),value:ek.getFieldValue("allowed_passthrough_routes"),accessToken:ec,placeholder:ep?"Select or enter pass through routes":"Premium feature - Upgrade to set pass through routes by key",disabled:!ep,teamId:eJ?eJ.team_id:null})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,t.jsx)(T.Tooltip,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,t.jsx)(el.default,{onChange:e=>ek.setFieldValue("allowed_vector_store_ids",e),value:ek.getFieldValue("allowed_vector_store_ids"),accessToken:ec,placeholder:"Select vector stores (optional)"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Metadata"," ",(0,t.jsx)(T.Tooltip,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,t.jsx)(v.Input.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Tags"," ",(0,t.jsx)(T.Tooltip,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,t.jsx)(k.Select,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",tokenSeparators:[","],options:ew})}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"MCP Settings"})}),(0,t.jsxs)(m.AccordionBody,{children:[(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,t.jsx)(T.Tooltip,{title:"Select which MCP servers or access groups this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",help:"Select MCP servers or access groups this key can access",children:(0,t.jsx)(Q.default,{onChange:e=>ek.setFieldValue("allowed_mcp_servers_and_groups",e),value:ek.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:ec,teamId:eJ?.team_id??null,placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(j.Form.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(v.Input,{type:"hidden"})}),(0,t.jsx)(j.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.allowed_mcp_servers_and_groups!==t.allowed_mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(J.default,{accessToken:ec,selectedServers:ek.getFieldValue("allowed_mcp_servers_and_groups")?.servers||[],toolPermissions:ek.getFieldValue("mcp_tool_permissions")||{},onChange:e=>ek.setFieldsValue({mcp_tool_permissions:e})})})})]})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Agent Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)(j.Form.Item,{label:(0,t.jsxs)("span",{children:["Allowed Agents"," ",(0,t.jsx)(T.Tooltip,{title:"Select which agents or access groups this key can access",children:(0,t.jsx)(d.InfoCircleOutlined,{style:{marginLeft:"4px"}})})]}),name:"allowed_agents_and_groups",help:"Select agents or access groups this key can access",children:(0,t.jsx)(F.default,{onChange:e=>ek.setFieldValue("allowed_agents_and_groups",e),value:ek.getFieldValue("allowed_agents_and_groups"),accessToken:ec,placeholder:"Select agents or access groups (optional)"})})})]}),ep?(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(R.default,{value:eH,onChange:eQ,premiumUser:!0,disabledCallbacks:ta,onDisabledCallbacksChange:tr})})})]}):(0,t.jsx)(T.Tooltip,{title:(0,t.jsxs)("span",{children:["Key-level logging settings is an enterprise feature, get in touch -",(0,t.jsx)("a",{href:"https://www.litellm.ai/enterprise",target:"_blank",children:"https://www.litellm.ai/enterprise"})]}),placement:"top",children:(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsx)("div",{style:{opacity:.5},children:(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Logging Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(R.default,{value:eH,onChange:eQ,premiumUser:!1,disabledCallbacks:ta,onDisabledCallbacksChange:tr})})})]})}),(0,t.jsx)("div",{style:{position:"absolute",inset:0,cursor:"not-allowed"}})]})}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Router Settings"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4 w-full",children:(0,t.jsx)(G.default,{accessToken:ec||"",value:tg||void 0,onChange:th,modelData:eF.length>0?{data:eF.map(e=>({model_name:e}))}:void 0},tf)})})]},`router-settings-accordion-${tf}`),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Model Aliases"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(y.Text,{className:"text-sm text-gray-600 mb-4",children:"Create custom aliases for models that can be used in API calls. This allows you to create shortcuts for specific models."}),(0,t.jsx)(B.default,{accessToken:ec,initialModelAliases:to,onAliasUpdate:td,showExampleConfig:!1})]})})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsx)("b",{children:"Key Lifecycle"})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)($.default,{form:ek,autoRotationEnabled:tc,onAutoRotationChange:tu,rotationInterval:tm,onRotationIntervalChange:tp,isCreateMode:!0})})}),(0,t.jsx)(j.Form.Item,{name:"duration",hidden:!0,initialValue:null,children:(0,t.jsx)(v.Input,{})})]}),(0,t.jsxs)(u.Accordion,{className:"mt-4 mb-4",children:[(0,t.jsx)(p.AccordionHeader,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("b",{children:"Advanced Settings"}),(0,t.jsx)(T.Tooltip,{title:(0,t.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,t.jsx)("a",{href:X.proxyBaseUrl?`${X.proxyBaseUrl}/#/key%20management/generate_key_fn_key_generate_post`:"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,t.jsx)(d.InfoCircleOutlined,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,t.jsx)(m.AccordionBody,{children:(0,t.jsx)(E.default,{schemaComponent:"GenerateKeyRequest",form:ek,excludedFields:["key_alias","team_id","organization_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit",...ev?["key"]:[]]})})]})]})]})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(b.Button,{htmlType:"submit",disabled:tS,style:{opacity:tS?.5:1},children:"Create Key"})})]})}),e2&&(0,t.jsx)(w.Modal,{title:"Create New User",open:e2,onCancel:()=>e4(!1),footer:null,width:800,children:(0,t.jsx)(q.CreateUserButton,{userID:eu,accessToken:ec,teams:Z,possibleUIRoles:e6,onUserCreated:e=>{e3(e),ek.setFieldsValue({user_id:e}),e4(!1)},isEmbedded:!0})}),eT&&(0,t.jsx)(w.Modal,{open:eS,onOk:tN,onCancel:tk,footer:null,children:(0,t.jsxs)(x.Grid,{numItems:1,className:"gap-2 w-full",children:[(0,t.jsx)(_.Title,{children:"Save your Key"}),(0,t.jsx)(h.Col,{numColSpan:1,children:null!=eT?(0,t.jsx)(et,{apiKey:eT}):(0,t.jsx)(y.Text,{children:"Key being created, this might take 30s"})})]})})]})},"fetchTeamModels",0,er,"fetchUserModels",0,ei],702597)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/277cc236a763c2bc.js b/litellm/proxy/_experimental/out/_next/static/chunks/277cc236a763c2bc.js
deleted file mode 100644
index 7b990db084..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/277cc236a763c2bc.js
+++ /dev/null
@@ -1,3 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,517442,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(592968);let l=e=>e>=.8?"text-green-600":"text-yellow-600",r=({entities:e})=>{let[a,r]=(0,s.useState)(!0),[i,n]=(0,s.useState)({});return e&&0!==e.length?(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>r(!a),children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${a?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",e.length,")"]})]}),a&&(0,t.jsx)("div",{className:"space-y-2",children:e.map((e,s)=>{let a=i[s]||!1;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>{n(e=>({...e,[s]:!e[s]}))},children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${a?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,t.jsxs)("span",{className:`font-mono ${l(e.score)}`,children:["Score: ",e.score.toFixed(2)]})]}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),a&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,t.jsx)("span",{children:e.entity_type})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,t.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,t.jsx)("span",{className:l(e.score),children:e.score.toFixed(2)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,t.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,t.jsxs)("div",{className:"flex overflow-hidden",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,t.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,t.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]}):null},i=(e,s="slate")=>(0,t.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block ${{green:"bg-green-100 text-green-800",red:"bg-red-100 text-red-800",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-100 text-slate-800",amber:"bg-amber-100 text-amber-800"}[s]}`,children:e}),n=e=>e?i("detected","red"):i("not detected","slate"),o=({title:e,count:a,defaultOpen:l=!0,right:r,children:i})=>{let[n,o]=(0,s.useState)(l);return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>o(e=>!e),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${n?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h5",{className:"font-medium",children:[e," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]}),(0,t.jsx)("div",{children:r})]}),n&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:i})]})},d=({label:e,children:s,mono:a})=>(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:e}),(0,t.jsx)("span",{className:a?"font-mono text-sm break-all":"",children:s})]}),c=()=>(0,t.jsx)("div",{className:"my-3 border-t"}),m=({response:e})=>{if(!e)return null;let s=e.outputs??e.output??[],a="GUARDRAIL_INTERVENED"===e.action?"red":"green",l=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.guardrailCoverage?.textCharacters&&i(`text guarded ${e.guardrailCoverage.textCharacters.guarded??0}/${e.guardrailCoverage.textCharacters.total??0}`,"blue"),e.guardrailCoverage?.images&&i(`images guarded ${e.guardrailCoverage.images.guarded??0}/${e.guardrailCoverage.images.total??0}`,"blue")]}),r=e.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(e.usage).map(([e,s])=>"number"==typeof s?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[e,": ",s]},e):null)});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d,{label:"Action:",children:i(e.action??"N/A",a)}),e.actionReason&&(0,t.jsx)(d,{label:"Action Reason:",children:e.actionReason}),e.blockedResponse&&(0,t.jsx)(d,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:e.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d,{label:"Coverage:",children:l}),(0,t.jsx)(d,{label:"Usage:",children:r})]})]}),s.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap",children:e.text??(0,t.jsx)("em",{children:"(non-text output)"})})},s))})]})]}),e.assessments?.length?(0,t.jsx)("div",{className:"space-y-3",children:e.assessments.map((e,s)=>{let a=(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.wordPolicy&&i("word","slate"),e.contentPolicy&&i("content","slate"),e.topicPolicy&&i("topic","slate"),e.sensitiveInformationPolicy&&i("sensitive-info","slate"),e.contextualGroundingPolicy&&i("contextual-grounding","slate"),e.automatedReasoningPolicy&&i("automated-reasoning","slate")]});return(0,t.jsxs)(o,{title:`Assessment #${s+1}`,defaultOpen:!0,right:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e.invocationMetrics?.guardrailProcessingLatency!=null&&i(`${e.invocationMetrics.guardrailProcessingLatency} ms`,"amber"),a]}),children:[e.wordPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Word Policy"}),(e.wordPolicy.customWords?.length??0)>0&&(0,t.jsx)(o,{title:"Custom Words",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.customWords.map((e,s)=>(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match})]}),n(e.detected)]},s))})}),(e.wordPolicy.managedWordLists?.length??0)>0&&(0,t.jsx)(o,{title:"Managed Word Lists",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.managedWordLists.map((e,s)=>(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match}),e.type&&i(e.type,"slate")]}),n(e.detected)]},s))})})]}),e.contentPolicy?.filters?.length?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Content Policy"}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"min-w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-gray-600",children:[(0,t.jsx)("th",{className:"py-1 pr-4",children:"Type"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Action"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Detected"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Strength"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Confidence"})]})}),(0,t.jsx)("tbody",{children:e.contentPolicy.filters.map((e,s)=>(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.type??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:i(e.action??"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:n(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.filterStrength??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.confidence??"—"})]},s))})]})})]}):null,e.contextualGroundingPolicy?.filters?.length?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Contextual Grounding"}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"min-w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-gray-600",children:[(0,t.jsx)("th",{className:"py-1 pr-4",children:"Type"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Action"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Detected"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Score"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Threshold"})]})}),(0,t.jsx)("tbody",{children:e.contextualGroundingPolicy.filters.map((e,s)=>(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:e.type??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:i(e.action??"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:n(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.score??"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:e.threshold??"—"})]},s))})]})})]}):null,e.sensitiveInformationPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Sensitive Information"}),(e.sensitiveInformationPolicy.piiEntities?.length??0)>0&&(0,t.jsx)(o,{title:"PII Entities",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.piiEntities.map((e,s)=>(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),e.type&&i(e.type,"slate"),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]}),n(e.detected)]},s))})}),(e.sensitiveInformationPolicy.regexes?.length??0)>0&&(0,t.jsx)(o,{title:"Custom Regexes",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.regexes.map((e,s)=>(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-2 bg-gray-50 rounded gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:e.name??"regex"}),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.regex})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[n(e.detected),e.match&&(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]})]},s))})})]}),e.topicPolicy?.topics?.length?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Topic Policy"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.topicPolicy.topics.map((e,s)=>(0,t.jsx)("div",{className:"px-3 py-1.5 bg-gray-50 rounded-md text-xs",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i(e.action??"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:e.name??"topic"}),e.type&&i(e.type,"slate"),n(e.detected)]})},s))})]}):null,e.invocationMetrics&&(0,t.jsx)(o,{title:"Invocation Metrics",defaultOpen:!1,children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(d,{label:"Latency (ms)",children:e.invocationMetrics.guardrailProcessingLatency??"—"}),(0,t.jsx)(d,{label:"Coverage:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.invocationMetrics.guardrailCoverage?.textCharacters&&i(`text ${e.invocationMetrics.guardrailCoverage.textCharacters.guarded??0}/${e.invocationMetrics.guardrailCoverage.textCharacters.total??0}`,"blue"),e.invocationMetrics.guardrailCoverage?.images&&i(`images ${e.invocationMetrics.guardrailCoverage.images.guarded??0}/${e.invocationMetrics.guardrailCoverage.images.total??0}`,"blue")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(d,{label:"Usage:",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.invocationMetrics.usage&&Object.entries(e.invocationMetrics.usage).map(([e,s])=>"number"==typeof s?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[e,": ",s]},e):null)})})})]})}),e.automatedReasoningPolicy?.findings?.length?(0,t.jsx)(o,{title:"Automated Reasoning Findings",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.automatedReasoningPolicy.findings.map((e,s)=>(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-2 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)},s))})}):null]},s)})}):null,(0,t.jsx)(o,{title:"Raw Bedrock Guardrail Response",defaultOpen:!1,children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)})})]})},x=(e,s="slate")=>(0,t.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block ${{green:"bg-green-100 text-green-800",red:"bg-red-100 text-red-800",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-100 text-slate-800",amber:"bg-amber-100 text-amber-800"}[s]}`,children:e}),u=({title:e,count:a,defaultOpen:l=!0,children:r})=>{let[i,n]=(0,s.useState)(l);return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>n(e=>!e),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${i?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h5",{className:"font-medium",children:[e," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]})}),i&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:r})]})},p=({label:e,children:s,mono:a})=>(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:e}),(0,t.jsx)("span",{className:a?"font-mono text-sm break-all":"",children:s})]}),h=({response:e})=>{if(!e||"string"==typeof e)return"string"==typeof e&&e?(0,t.jsx)("div",{className:"bg-white rounded-lg border border-red-200 p-4",children:(0,t.jsxs)("div",{className:"text-red-800",children:[(0,t.jsx)("h5",{className:"font-medium mb-2",children:"Error"}),(0,t.jsx)("p",{className:"text-sm",children:e})]})}):null;let s=Array.isArray(e)?e:[];if(0===s.length)return(0,t.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:(0,t.jsx)("div",{className:"text-gray-600 text-sm",children:"No detections found"})});let a=s.filter(e=>"pattern"===e.type),l=s.filter(e=>"blocked_word"===e.type),r=s.filter(e=>"category_keyword"===e.type),i=s.filter(e=>"BLOCK"===e.action).length,n=s.filter(e=>"MASK"===e.action).length,o=s.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(p,{label:"Total Detections:",children:(0,t.jsx)("span",{className:"font-semibold",children:o})}),(0,t.jsx)(p,{label:"Actions:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[i>0&&x(`${i} blocked`,"red"),n>0&&x(`${n} masked`,"blue"),0===i&&0===n&&x("passed","green")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(p,{label:"By Type:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[a.length>0&&x(`${a.length} patterns`,"slate"),l.length>0&&x(`${l.length} keywords`,"slate"),r.length>0&&x(`${r.length} categories`,"slate")]})})})]})}),a.length>0&&(0,t.jsx)(u,{title:"Patterns Matched",count:a.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:a.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Pattern:",children:e.pattern_name||"unknown"})}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Action:",children:x(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),l.length>0&&(0,t.jsx)(u,{title:"Blocked Words Detected",count:l.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:l.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(p,{label:"Keyword:",mono:!0,children:e.keyword||"unknown"}),e.description&&(0,t.jsx)(p,{label:"Description:",children:e.description})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Action:",children:x(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),r.length>0&&(0,t.jsx)(u,{title:"Category Keywords Detected",count:r.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:r.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(p,{label:"Category:",children:e.category||"unknown"}),(0,t.jsx)(p,{label:"Keyword:",mono:!0,children:e.keyword||"unknown"}),e.severity&&(0,t.jsx)(p,{label:"Severity:",children:x(e.severity,"high"===e.severity?"red":"medium"===e.severity?"amber":"slate")})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(p,{label:"Action:",children:x(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),(0,t.jsx)(u,{title:"Raw Detection Data",defaultOpen:!1,children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(s,null,2)})})]})};var g=e.i(764205);let f=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"7",stroke:"#16A34A",strokeWidth:"1.5",fill:"#F0FDF4"}),(0,t.jsx)("path",{d:"M5 8l2 2 4-4",stroke:"#16A34A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"7",stroke:"#DC2626",strokeWidth:"1.5",fill:"#FEF2F2"}),(0,t.jsx)("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"#DC2626",strokeWidth:"1.5",strokeLinecap:"round"})]}),j=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"animate-spin",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"#D1D5DB",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M8 2a6 6 0 0 1 6 6",stroke:"#6366F1",strokeWidth:"2",strokeLinecap:"round"})]}),b=({title:e,data:l,loading:r,error:i})=>{let[n,o]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg bg-white",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>o(!n),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r?(0,t.jsx)(j,{}):i?(0,t.jsx)(a.Tooltip,{title:i,children:(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"--"})}):l?.compliant?(0,t.jsx)(f,{}):(0,t.jsx)(y,{}),(0,t.jsx)("span",{className:"font-medium text-sm text-gray-900",children:e})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!r&&!i&&l&&(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold uppercase ${l.compliant?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,children:l.compliant?"COMPLIANT":"NON-COMPLIANT"}),i&&(0,t.jsx)("span",{className:"px-2 py-0.5 rounded text-[11px] font-medium bg-gray-100 text-gray-500 border border-gray-200",children:"UNAVAILABLE"}),(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:`transition-transform ${n?"rotate-180":""}`,children:(0,t.jsx)("path",{d:"M6 8l4 4 4-4",stroke:"#6B7280",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-gray-100 px-4 py-3",children:[r&&(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Checking compliance..."}),i&&(0,t.jsx)("p",{className:"text-sm text-red-600",children:i}),l&&(0,t.jsx)("div",{className:"space-y-2",children:l.checks.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:e.passed?(0,t.jsx)(f,{}):(0,t.jsx)(y,{})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:e.check_name}),(0,t.jsx)("span",{className:"text-[10px] font-mono text-gray-400",children:e.article})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:e.detail})]})]},s))})]})]})},v=({accessToken:e,logEntry:a})=>{let[l,r]=(0,s.useState)(null),[i,n]=(0,s.useState)(null),[o,d]=(0,s.useState)(!1),[c,m]=(0,s.useState)(!1),[x,u]=(0,s.useState)(null),[p,h]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(!e||!a.request_id)return;let t={request_id:a.request_id,user_id:a.user,model:a.model,timestamp:a.startTime,guardrail_information:a.metadata?.guardrail_information};d(!0),u(null),(0,g.checkEuAiActCompliance)(e,t).then(r).catch(e=>u(e.message||"Failed to check EU AI Act compliance")).finally(()=>d(!1)),m(!0),h(null),(0,g.checkGdprCompliance)(e,t).then(n).catch(e=>h(e.message||"Failed to check GDPR compliance")).finally(()=>m(!1))},[e,a]),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4",children:"Regulatory Compliance"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(b,{title:"EU AI Act",data:l,loading:o,error:x}),(0,t.jsx)(b,{title:"GDPR",data:i,loading:c,error:p})]})]})},_=new Set(["presidio","bedrock","litellm_content_filter"]),N=(e,t)=>{if(null==e)return!1;if("string"==typeof e)return e===t;if(Array.isArray(e))return e.includes(t);if("object"==typeof e&&"default"in e){let s=e.default;if("string"==typeof s)return s===t;if(Array.isArray(s))return s.some(e=>"string"==typeof e&&e===t)}return!1},w=e=>Object.values(e.masked_entity_count||{}).reduce((e,t)=>e+("number"==typeof t?t:0),0),S=e=>"success"===(e.guardrail_status??"").toLowerCase(),k=e=>e.policy_template||e.guardrail_name,C=()=>(0,t.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[(0,t.jsx)("circle",{cx:"20",cy:"20",r:"20",fill:"#EEF2FF"}),(0,t.jsx)("path",{d:"M20 10l8 4v6c0 5.25-3.4 10.15-8 11.5C15.4 30.15 12 25.25 12 20v-6l8-4z",stroke:"#6366F1",strokeWidth:"1.5",fill:"none"}),(0,t.jsx)("path",{d:"M16 20l3 3 5-6",stroke:"#6366F1",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}),T=({className:e})=>(0,t.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",className:e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"10",stroke:"#16A34A",strokeWidth:"1.5",fill:"#F0FDF4"}),(0,t.jsx)("path",{d:"M7 11l3 3 5-6",stroke:"#16A34A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),L=({className:e})=>(0,t.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",className:e,children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"10",stroke:"#DC2626",strokeWidth:"1.5",fill:"#FEF2F2"}),(0,t.jsx)("path",{d:"M8 8l6 6M14 8l-6 6",stroke:"#DC2626",strokeWidth:"1.5",strokeLinecap:"round"})]}),M=()=>(0,t.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"10",stroke:"#3B82F6",strokeWidth:"1.5",fill:"#EFF6FF"}),(0,t.jsx)("path",{d:"M9 7.5l6 3.5-6 3.5V7.5z",fill:"#3B82F6"})]}),A=()=>(0,t.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:(0,t.jsx)("circle",{cx:"11",cy:"11",r:"5",fill:"#9CA3AF"})}),E=({expanded:e})=>(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:`transition-transform ${e?"rotate-180":""}`,children:(0,t.jsx)("path",{d:"M6 8l4 4 4-4",stroke:"#6B7280",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),D=()=>(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,t.jsx)("path",{d:"M8 2v8m0 0l-3-3m3 3l3-3M3 12h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),I=({matchDetails:e})=>e&&0!==e.length?(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsxs)("h5",{className:"text-sm font-medium mb-2 text-gray-700",children:["Match Details (",e.length,")"]}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b text-left text-gray-500",children:[(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Type"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Method"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Action"}),(0,t.jsx)("th",{className:"pb-2 font-medium",children:"Detail"})]})}),(0,t.jsx)("tbody",{children:e.map((e,s)=>(0,t.jsxs)("tr",{className:"border-b border-gray-100",children:[(0,t.jsx)("td",{className:"py-2 pr-4",children:e.type}),(0,t.jsx)("td",{className:"py-2 pr-4",children:(0,t.jsx)("span",{className:"px-2 py-0.5 bg-slate-100 text-slate-700 rounded text-xs",children:e.detection_method??"-"})}),(0,t.jsx)("td",{className:"py-2 pr-4",children:(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${"BLOCK"===e.action_taken?"bg-red-100 text-red-800":"bg-blue-50 text-blue-700"}`,children:e.action_taken??"-"})}),(0,t.jsxs)("td",{className:"py-2 font-mono text-xs text-gray-600 break-all",children:[e.category?`[${e.category}] `:"",e.snippet??"-"]})]},s))})]})})]}):null,z=({response:e})=>{let[a,l]=(0,s.useState)(!1);return(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>l(!a),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(E,{expanded:a}),(0,t.jsx)("h5",{className:"font-medium text-sm ml-1",children:"Raw Guardrail Response"})]})}),a&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)})})]})})},O=({entries:e})=>{let a=(0,s.useMemo)(()=>[...e].sort((e,t)=>(e.start_time??0)-(t.start_time??0)),[e]),l=(0,s.useMemo)(()=>{if(0===a.length)return[];let e=a[0].start_time,t=[];t.push({type:"request",label:"Request received",offsetMs:0});let s=a.filter(e=>N(e.guardrail_mode,"pre_call")),l=a.filter(e=>N(e.guardrail_mode,"post_call")||N(e.guardrail_mode,"logging_only")),r=a.filter(e=>N(e.guardrail_mode,"during_call"));for(let a of s){let s=Math.round((a.end_time-e)*1e3);t.push({type:"guardrail",label:`Pre-call guardrail: ${k(a)}`,offsetMs:s,status:S(a)?"PASSED":"FAILED",isSuccess:S(a)})}let i=s.length>0?Math.max(...s.map(e=>e.end_time)):e,n=Math.round((((l.length>0?Math.min(...l.map(e=>e.start_time)):void 0)??i+1)-e)*1e3);for(let s of(t.push({type:"llm",label:"LLM call",offsetMs:n}),r)){let a=Math.round((s.end_time-e)*1e3);t.push({type:"guardrail",label:`During-call guardrail: ${k(s)}`,offsetMs:a,status:S(s)?"PASSED":"FAILED",isSuccess:S(s)})}for(let s of l){let a=Math.round((s.end_time-e)*1e3);t.push({type:"guardrail",label:`Post-call guardrail: ${k(s)}`,offsetMs:a,status:S(s)?"PASSED":"FAILED",isSuccess:S(s)})}let o=Math.round((Math.max(...a.map(e=>e.end_time))-e)*1e3)+1;return t.push({type:"response",label:"Response returned",offsetMs:o}),t},[a]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4",children:"Request Lifecycle"}),(0,t.jsx)("div",{className:"relative",children:l.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-start gap-3 relative",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:"request"===e.type||"response"===e.type?(0,t.jsx)(A,{}):"llm"===e.type?(0,t.jsx)(M,{}):e.isSuccess?(0,t.jsx)(T,{}):(0,t.jsx)(L,{})}),s{let l,i,[n,o]=(0,s.useState)(!1),d=S(e),c=w(e),x=k(e),u=(l=Math.round(1e3*e.duration),`${l}ms`),p=null==(i=(e=>{if(null==e)return null;if("string"==typeof e)return e;if(Array.isArray(e)){let t=e[0];return"string"==typeof t?t:null}if("object"==typeof e&&"default"in e){let t=e.default;if("string"==typeof t)return t;if(Array.isArray(t)){let e=t[0];return"string"==typeof e?e:null}}return null})(e.guardrail_mode))||""===i?"—":i.replace(/_/g,"-").toUpperCase(),g=(e=>{if(!S(e))return null;if(null!=e.risk_score)return e.risk_score;let t=w(e),s=e.patterns_checked??0,a=e.confidence_score??0;if(0===s&&0===a)return 0;let l=7*(s>0?t/s:0)+3*a;return t>0&&l<2&&(l=2),Math.min(10,Math.round(10*l)/10)})(e),f=e.guardrail_provider??"presidio",y=e.guardrail_response,j=Array.isArray(y)?y:[],b="bedrock"!==f||null===y||"object"!=typeof y||Array.isArray(y)?void 0:y,v=null!=e.patterns_checked?`${c}/${e.patterns_checked} matched`:c>0?`${c} matched`:null;return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg bg-white",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>o(!n),children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:d?(0,t.jsx)(T,{}):(0,t.jsx)(L,{})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"font-semibold text-gray-900 text-sm truncate",children:x}),(0,t.jsx)("span",{className:"px-2 py-0.5 border border-blue-200 bg-blue-50 text-blue-700 rounded text-[11px] font-semibold uppercase flex-shrink-0",children:p}),(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-[11px] font-semibold uppercase flex-shrink-0 ${d?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,children:d?"PASSED":"FAILED"}),v&&(0,t.jsx)("span",{className:`px-2 py-0.5 rounded text-[11px] font-medium flex-shrink-0 ${0===c?"bg-green-50 text-green-700 border border-green-200":"bg-amber-50 text-amber-700 border border-amber-200"}`,children:v}),null!=e.confidence_score&&(0,t.jsxs)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 border border-gray-200 rounded text-[11px] font-medium flex-shrink-0",children:[(100*e.confidence_score).toFixed(0),"% conf"]}),null!=g&&d&&(0,t.jsx)(a.Tooltip,{title:`Risk score: ${g}/10`,children:(0,t.jsxs)("span",{className:`px-2 py-0.5 border rounded text-[11px] font-semibold flex-shrink-0 ${g<=3?"text-green-600 bg-green-50 border-green-200":g<=6?"text-amber-600 bg-amber-50 border-amber-200":"text-red-600 bg-red-50 border-red-200"}`,children:["Risk ",g,"/10"]})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,t.jsx)("span",{className:"text-sm text-gray-500 font-mono",children:u}),e.detection_method&&(0,t.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 border border-gray-200 rounded text-[11px] font-medium",children:e.detection_method.split(",")[0].trim()}),(0,t.jsx)(E,{expanded:n})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-gray-100 px-4 py-3",children:[e.classification&&(0,t.jsxs)("div",{className:"mb-3 bg-gray-50 rounded-lg p-3 space-y-1",children:[(0,t.jsx)("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:"Classification"}),e.classification.category&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Category:"}),(0,t.jsx)("span",{children:e.classification.category})]}),e.classification.article_reference&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Reference:"}),(0,t.jsx)("span",{className:"font-mono",children:e.classification.article_reference})]}),null!=e.classification.confidence&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Confidence:"}),(0,t.jsxs)("span",{children:[(100*e.classification.confidence).toFixed(0),"%"]})]}),e.classification.reason&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"font-medium w-1/3 text-gray-500",children:"Reason:"}),(0,t.jsx)("span",{children:e.classification.reason})]})]}),e.match_details&&e.match_details.length>0&&(0,t.jsx)(I,{matchDetails:e.match_details}),c>0&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:"Masked Entities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(e.masked_entity_count||{}).map(([e,s])=>(0,t.jsxs)("span",{className:"px-2 py-1 bg-blue-50 text-blue-700 rounded text-xs font-medium",children:[e,": ",s]},e))})]}),"presidio"===f&&j.length>0&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(r,{entities:j})}),"bedrock"===f&&b&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(m,{response:b})}),"litellm_content_filter"===f&&y&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(h,{response:y})}),f&&!_.has(f)&&y&&(0,t.jsx)(z,{response:y})]})]})};e.s(["default",0,({data:e,accessToken:a,logEntry:l})=>{let r=(0,s.useMemo)(()=>Array.isArray(e)?e.filter(e=>!!e):e?[e]:[],[e]),i=r.filter(S).length,n=i===r.length,o=(0,s.useMemo)(()=>Math.round(1e3*r.reduce((e,t)=>e+(t.duration??0),0)),[r]);return((0,s.useMemo)(()=>Array.from(new Set(r.map(e=>e.policy_template).filter(Boolean))),[r]),0===r.length)?null:(0,t.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm w-full max-w-full overflow-hidden mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(C,{}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Guardrails & Policy Compliance"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-500",children:[r.length," guardrail",1!==r.length?"s":""," evaluated"]}),(0,t.jsx)("span",{className:"text-gray-300",children:"|"}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold ${n?"bg-green-50 text-green-700 border border-green-200":"bg-red-50 text-red-700 border border-red-200"}`,children:[n?(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,t.jsx)("path",{d:"M3 6l2.5 2.5L9 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null,i," Passed"]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-6",children:[(0,t.jsx)("div",{className:"text-right",children:(0,t.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:["Total: ",o,"ms overhead"]})}),(0,t.jsxs)("button",{onClick:()=>{let e=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download=`guardrail-compliance-log-${new Date().toISOString().slice(0,10)}.json`,s.click(),URL.revokeObjectURL(t)},className:"inline-flex items-center gap-2 px-4 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(D,{}),"Export Compliance Log"]})]})]}),a&&l&&(0,t.jsx)("div",{className:"px-6 py-4 border-b border-gray-100",children:(0,t.jsx)(v,{accessToken:a,logEntry:l})}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-6 py-5",children:(0,t.jsx)(O,{entries:r})}),(0,t.jsxs)("div",{className:"px-6 py-5",children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-4",children:"Evaluation Details"}),(0,t.jsx)("div",{className:"space-y-3",children:r.map((e,s)=>(0,t.jsx)(R,{entry:e},`${e.guardrail_name??"guardrail"}-${s}`))})]})]})]})}],517442)},93648,245767,313793,291950,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(560445),l=e.i(207082),r=e.i(135214),i=e.i(500330),n=e.i(871943),o=e.i(360820),d=e.i(94629),c=e.i(152990),m=e.i(682830),x=e.i(269200),u=e.i(942232),p=e.i(977572),h=e.i(427612),g=e.i(64848),f=e.i(496020),y=e.i(592968);function j({keys:e,totalCount:a,isLoading:l,isFetching:r,pageIndex:j,pageSize:b,onPageChange:v}){let[_,N]=(0,s.useState)([{id:"deleted_at",desc:!0}]),[w,S]=(0,s.useState)({pageIndex:j,pageSize:b});s.default.useEffect(()=>{S({pageIndex:j,pageSize:b})},[j,b]);let k=[{id:"token",accessorKey:"token",header:"Key ID",size:150,maxSize:250,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:s||"-"})})}},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block max-w-[200px]",children:s??"-"})})}},{id:"team_alias",accessorKey:"team_alias",header:"Team Alias",size:120,maxSize:180,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>(0,t.jsx)("span",{className:"block max-w-[140px]",children:(0,i.formatNumberWithCommas)(e.getValue(),4)})},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[150px]",children:null===s?"Unlimited":`$${(0,i.formatNumberWithCommas)(s)}`})}},{id:"user_email",accessorKey:"user_email",header:"User Email",size:160,maxSize:250,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-xs truncate block max-w-[250px]",children:s??"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:120,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[200px]",children:s||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,maxSize:140,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:120,maxSize:180,cell:e=>{let s=e.row.original.created_by;return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let s=e.row.original.deleted_at;return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let s=e.row.original.deleted_by;return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})})}}],C=(0,c.useReactTable)({data:e,columns:k,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:_,pagination:w},onSortingChange:N,onPaginationChange:e=>{let t="function"==typeof e?e(w):e;S(t),v(t.pageIndex)},getCoreRowModel:(0,m.getCoreRowModel)(),getSortedRowModel:(0,m.getSortedRowModel)(),getPaginationRowModel:(0,m.getPaginationRowModel)(),enableSorting:!0,manualSorting:!1,manualPagination:!0,pageCount:Math.ceil(a/b)}),{pageIndex:T}=C.getState().pagination,L=T*b+1,M=Math.min((T+1)*b,a),A=`${L} - ${M}`;return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[l||r?(0,t.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,t.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",A," of ",a," results"]}),(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[l||r?(0,t.jsx)("span",{className:"text-sm text-gray-700",children:"Loading..."}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",T+1," of ",C.getPageCount()]}),(0,t.jsx)("button",{onClick:()=>C.previousPage(),disabled:l||r||!C.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,t.jsx)("button",{onClick:()=>C.nextPage(),disabled:l||r||!C.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(x.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:C.getCenterTotalSize()},children:[(0,t.jsx)(h.TableHead,{children:C.getHeaderGroups().map(e=>(0,t.jsx)(f.TableRow,{children:e.headers.map(e=>(0,t.jsx)(g.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,c.flexRender)(e.column.columnDef.header,e.getContext())}),(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(o.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(n.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(d.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${C.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(u.TableBody,{children:l||r?(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:k.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading keys..."})})})}):e.length>0?C.getRowModel().rows.map(e=>(0,t.jsx)(f.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(p.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,c.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:k.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No deleted keys found"})})})})})]})})})})]})})}function b(){let{premiumUser:e}=(0,r.default)(),[i,n]=(0,s.useState)(0),[o]=(0,s.useState)(50),{data:d,isPending:c,isFetching:m}=(0,l.useDeletedKeys)(i+1,o);return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,t.jsx)(a.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted key auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,t.jsx)(j,{keys:d?.keys||[],totalCount:d?.total_count||0,isLoading:c,isFetching:m,pageIndex:i,pageSize:o,onPageChange:n})]})}e.s(["default",()=>b],93648);var v=e.i(785242),_=e.i(389083),N=e.i(599724),w=e.i(355619);function S({teams:e,isLoading:a,isFetching:l}){let[r,j]=(0,s.useState)([{id:"deleted_at",desc:!0}]),b=[{id:"team_alias",accessorKey:"team_alias",header:"Team Name",size:150,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[200px]",children:s||"-"})})}},{id:"team_id",accessorKey:"team_id",header:"Team ID",size:150,maxSize:250,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono text-blue-500 text-xs truncate block max-w-[250px]",children:s||"-"})})}},{id:"created_at",accessorKey:"created_at",header:"Created",size:120,maxSize:140,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,maxSize:140,cell:e=>{let s=e.row.original.spend;return(0,t.jsx)("span",{className:"block max-w-[140px]",children:void 0!==s?(0,i.formatNumberWithCommas)(s,4):"-"})}},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,maxSize:150,cell:e=>{let s=e.getValue();return(0,t.jsx)("span",{className:"block max-w-[150px]",children:null==s?"No limit":`$${(0,i.formatNumberWithCommas)(s)}`})}},{id:"models",accessorKey:"models",header:"Models",size:200,maxSize:300,cell:e=>{let s=e.getValue();return Array.isArray(s)&&0!==s.length?(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[300px]",children:[s.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,t.jsx)(_.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})},s):(0,t.jsx)(_.Badge,{size:"xs",color:"blue",children:(0,t.jsx)(N.Text,{children:e.length>30?`${(0,w.getModelDisplayName)(e).slice(0,30)}...`:(0,w.getModelDisplayName)(e)})},s)),s.length>3&&(0,t.jsx)(_.Badge,{size:"xs",color:"gray",children:(0,t.jsxs)(N.Text,{children:["+",s.length-3," ",s.length-3==1?"more model":"more models"]})})]}):(0,t.jsx)(_.Badge,{size:"xs",color:"red",children:(0,t.jsx)(N.Text,{children:"All Proxy Models"})})}},{id:"organization_id",accessorKey:"organization_id",header:"Organization",size:150,maxSize:200,cell:e=>{let s=e.getValue();return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[200px]",children:s||"-"})})}},{id:"deleted_at",accessorKey:"deleted_at",header:"Deleted At",size:120,maxSize:140,cell:e=>{let s=e.row.original.deleted_at;return(0,t.jsx)("span",{className:"block max-w-[140px]",children:s?new Date(s).toLocaleDateString():"-"})}},{id:"deleted_by",accessorKey:"deleted_by",header:"Deleted By",size:120,maxSize:180,cell:e=>{let s=e.row.original.deleted_by;return(0,t.jsx)(y.Tooltip,{title:s||void 0,children:(0,t.jsx)("span",{className:"truncate block max-w-[180px]",children:s||"-"})})}}],v=(0,c.useReactTable)({data:e,columns:b,columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:r},onSortingChange:j,getCoreRowModel:(0,m.getCoreRowModel)(),getSortedRowModel:(0,m.getSortedRowModel)(),enableSorting:!0,manualSorting:!1});return(0,t.jsx)("div",{className:"w-full h-full overflow-hidden",children:(0,t.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between w-full mb-4",children:a||l?(0,t.jsx)("span",{className:"inline-flex text-sm text-gray-700",children:"Loading..."}):(0,t.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",e.length," ",1===e.length?"team":"teams"]})}),(0,t.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(x.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:v.getCenterTotalSize()},children:[(0,t.jsx)(h.TableHead,{children:v.getHeaderGroups().map(e=>(0,t.jsx)(f.TableRow,{children:e.headers.map(e=>(0,t.jsx)(g.TableHeaderCell,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50",style:{width:e.getSize(),maxWidth:e.column.columnDef.maxSize,position:"relative"},onMouseEnter:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector(`[data-header-id="${e.id}"] .resizer`);t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,c.flexRender)(e.column.columnDef.header,e.getContext())}),(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(o.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(n.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(d.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})}),(0,t.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:`resizer ${v.options.columnResizeDirection} ${e.column.getIsResizing()?"isResizing":""}`,style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:+!!e.column.getIsResizing()}})]})},e.id))},e.id))}),(0,t.jsx)(u.TableBody,{children:a||l?(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:b.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading teams..."})})})}):e.length>0?v.getRowModel().rows.map(e=>(0,t.jsx)(f.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(p.TableCell,{style:{width:e.column.getSize(),maxWidth:e.column.columnDef.maxSize,whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,c.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(f.TableRow,{children:(0,t.jsx)(p.TableCell,{colSpan:b.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No deleted teams found"})})})})})]})})})})]})})}function k(){let{premiumUser:e}=(0,r.default)(),{data:s,isPending:l,isFetching:i}=(0,v.useDeletedTeams)(1,100);return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[!e&&(0,t.jsx)(a.Alert,{type:"info",banner:!0,showIcon:!0,message:"Coming soon to Enterprise",description:"Deleted team auditing is graduating from beta into our Enterprise audit & compliance suite."}),(0,t.jsx)(S,{teams:s||[],isLoading:l,isFetching:i})]})}e.s(["default",()=>k],245767);var C=e.i(663435);e.s(["default",0,({value:e,onChange:s})=>(0,t.jsx)(C.default,{value:e,onChange:s})],313793);var T=e.i(625901),L=e.i(56456),M=e.i(152473),A=e.i(199133),E=e.i(770914);let{Text:D}=e.i(898586).Typography;e.s(["PaginatedModelSelect",0,({value:e,onChange:a,placeholder:l="Select a model",style:r,pageSize:i=50,allowClear:n=!0,disabled:o=!1})=>{let[d,c]=(0,s.useState)(""),[m,x]=(0,M.useDebouncedState)("",{wait:300}),{data:u,fetchNextPage:p,hasNextPage:h,isFetchingNextPage:g,isLoading:f}=(0,T.useInfiniteModelInfo)(i,m||void 0),y=(0,s.useMemo)(()=>{if(!u?.pages)return[];let e=new Set,t=[];for(let s of u.pages)for(let a of s.data){let s=a.model_info?.id??"",l=a.model_name??"";!s||e.has(s)||(e.add(s),t.push({label:l?`${l} (${s})`:s,value:s,modelName:l,modelId:s}))}return t},[u]);return(0,t.jsx)(A.Select,{value:e||void 0,onChange:e=>{let t="string"==typeof e?e:Array.isArray(e)?e[0]??"":"";a?.(t)},placeholder:l,style:{width:"100%",...r},allowClear:n,disabled:o,showSearch:!0,filterOption:!1,onSearch:e=>{c(e),x(e)},searchValue:d,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&h&&!g&&p()},loading:f,notFoundContent:f?(0,t.jsx)(L.LoadingOutlined,{spin:!0}):"No models found",options:y,optionRender:e=>{let{modelName:s,modelId:a}=e.data;return(0,t.jsx)(t.Fragment,{children:s?(0,t.jsxs)(E.Space,{direction:"vertical",children:[(0,t.jsxs)(E.Space,{direction:"horizontal",children:[(0,t.jsx)(D,{strong:!0,children:"Model name:"}),(0,t.jsx)(D,{ellipsis:!0,children:s})]}),(0,t.jsxs)(D,{ellipsis:!0,type:"secondary",children:["Model ID: ",a]})]}):(0,t.jsxs)(D,{ellipsis:!0,type:"secondary",children:["Model ID: ",a]})})},popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,g&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(L.LoadingOutlined,{spin:!0})})]})})}],291950)},95684,e=>{"use strict";var t=e.i(165370);e.s(["Pagination",()=>t.default])},942161,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(266027),l=e.i(619273),r=e.i(291542),i=e.i(262218),n=e.i(311451),o=e.i(199133),d=e.i(464571),c=e.i(95684),m=e.i(482725),x=e.i(91979),u=e.i(56456),p=e.i(166540),h=e.i(764205),g=e.i(608856),f=e.i(898586),y=e.i(149192),j=e.i(166406),b=e.i(492030),v=e.i(304911);let{Text:_}=f.Typography,N={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},w={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function S({label:e,value:a}){let[l,r]=(0,s.useState)(!1),i=(0,s.useCallback)(async()=>{try{let e=JSON.stringify(a,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t)}r(!0),setTimeout(()=>r(!1),2e3)}catch(e){console.error("Copy failed:",e)}},[a]);return(0,t.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b bg-gray-50",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e}),(0,t.jsx)("button",{onClick:i,className:"p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors",title:"Copy JSON",children:l?(0,t.jsx)(b.CheckOutlined,{className:"text-green-600"}):(0,t.jsx)(j.CopyOutlined,{})})]}),(0,t.jsx)("pre",{className:"p-3 bg-white text-xs font-mono overflow-auto max-h-96 whitespace-pre-wrap break-all m-0",children:JSON.stringify(a,null,2)})]})}function k({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex items-start gap-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 w-36 shrink-0",children:e}),(0,t.jsx)("span",{className:"text-xs text-gray-900 break-all",children:s})]})}function C({log:e}){let{action:s,table_name:a,before_value:l,updated_values:r}=e,i="LiteLLM_VerificationToken"===a,n="updated"===s||"rotated"===s,o=l,d=r;if(n&&l&&r){let e={},t={};new Set([...Object.keys(l),...Object.keys(r)]).forEach(s=>{JSON.stringify(l[s])!==JSON.stringify(r[s])&&(s in l&&(e[s]=l[s]),s in r&&(t[s]=r[s]))}),Object.keys(l).forEach(s=>{s in r||s in e||(e[s]=l[s],t[s]=void 0)}),Object.keys(r).forEach(s=>{s in l||s in t||(t[s]=r[s],e[s]=void 0)}),o=Object.keys(e).length>0?e:{note:"No differing fields detected"},d=Object.keys(t).length>0?t:{note:"No differing fields detected"}}let c=(e,s)=>{if(!s||0===Object.keys(s).length)return(0,t.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 italic m-0",children:"N/A"})]});if(i&&n){let a=["token","spend","max_budget"];if(Object.keys(s).every(e=>a.includes(e))&&!("note"in s))return(0,t.jsxs)("div",{className:"bg-white rounded border overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center px-3 py-2 border-b bg-gray-50",children:(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-600",children:e})}),(0,t.jsxs)("div",{className:"px-3 py-3 space-y-1 text-xs",children:[void 0!==s.token&&(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Token:"})," ",s.token??"N/A"]}),void 0!==s.spend&&(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Spend:"})," $",Number(s.spend).toFixed(6)]}),void 0!==s.max_budget&&(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Max Budget:"})," $",Number(s.max_budget).toFixed(6)]})]})]})}return(0,t.jsx)(S,{label:e,value:s})};return(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[c("Before",o),c("After",d)]})}function T({open:e,onClose:s,log:a}){if(!a)return null;let l=N[a.table_name]??a.table_name,r=w[a.action]??"default";return(0,t.jsxs)(g.Drawer,{placement:"right",width:"60%",open:e,onClose:s,closable:!1,mask:!0,maskClosable:!0,styles:{body:{padding:0,display:"flex",flexDirection:"column"},header:{display:"none"}},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b bg-white shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(i.Tag,{color:r,className:"capitalize m-0",children:a.action}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:p.default.utc(a.updated_at).local().format("MMM D, YYYY HH:mm:ss")})]}),(0,t.jsx)("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded hover:bg-gray-100 text-gray-500","aria-label":"Close",children:(0,t.jsx)(y.CloseOutlined,{})})]}),(0,t.jsxs)("div",{className:"px-6 py-5",children:[(0,t.jsxs)("div",{className:"bg-gray-50 border rounded-lg p-4 mb-5",children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-gray-700 mb-2 uppercase tracking-wide",children:"Details"}),(0,t.jsx)(k,{label:"Table",value:l}),(0,t.jsx)(k,{label:"Object ID",value:(0,t.jsx)(_,{copyable:!0,className:"font-mono text-xs",children:a.object_id})}),(0,t.jsx)(k,{label:"Changed By",value:(0,t.jsx)(v.default,{userId:a.changed_by})}),(0,t.jsx)(k,{label:"API Key (Hash)",value:a.changed_by_api_key?(0,t.jsx)(_,{copyable:!0,className:"font-mono text-xs break-all",children:a.changed_by_api_key}):"—"})]}),(0,t.jsx)(C,{log:a})]})]})}let{Search:L}=n.Input,M={LiteLLM_VerificationToken:"Keys",LiteLLM_TeamTable:"Teams",LiteLLM_UserTable:"Users",LiteLLM_OrganizationTable:"Organizations",LiteLLM_ProxyModelTable:"Models"},A={created:"green",updated:"blue",deleted:"red",rotated:"orange"};function E({userID:e,userRole:n,token:g,accessToken:f,isActive:y,premiumUser:j}){let[b,_]=(0,s.useState)(1),[N,w]=(0,s.useState)(""),[S,k]=(0,s.useState)(""),[C,E]=(0,s.useState)(""),[D,I]=(0,s.useState)(""),[z,O]=(0,s.useState)(void 0),[R,P]=(0,s.useState)(void 0),[B,F]=(0,s.useState)(null),[q,H]=(0,s.useState)(!1),$=(0,a.useQuery)({queryKey:["audit_logs",b,50,N,S,C,D,z,R],queryFn:async()=>f&&g&&n&&e?(0,h.uiAuditLogsCall)({accessToken:f,page:b,page_size:50,params:{object_id:N||void 0,changed_by:S||void 0,object_key_hash:C||void 0,object_team_id:D||void 0,action:z||void 0,table_name:R||void 0,sort_by:"updated_at",sort_order:"desc"}}):{audit_logs:[],total:0,page:1,page_size:50,total_pages:0},enabled:!!f&&!!g&&!!n&&!!e&&y,placeholderData:l.keepPreviousData}),Y=[{title:"Timestamp",dataIndex:"updated_at",key:"updated_at",width:200,render:e=>(0,t.jsx)("span",{className:"font-mono text-xs whitespace-nowrap",children:p.default.utc(e).local().format("MMM D, YYYY HH:mm:ss")})},{title:"Action",dataIndex:"action",key:"action",width:100,render:e=>(0,t.jsx)(i.Tag,{color:A[e]??"default",className:"capitalize",children:e})},{title:"Table",dataIndex:"table_name",key:"table_name",width:130,render:e=>M[e]??e},{title:"Object ID",dataIndex:"object_id",key:"object_id",render:e=>(0,t.jsx)("span",{className:"font-mono text-xs",children:e})},{title:"Changed By",dataIndex:"changed_by",key:"changed_by",width:200,render:e=>(0,t.jsx)(v.default,{userId:e})},{title:"API Key (Hash)",dataIndex:"changed_by_api_key",key:"changed_by_api_key",width:140,render:e=>e?(0,t.jsxs)("span",{className:"font-mono text-xs",children:[e.slice(0,12),"…"]}):"—"}];if(!j)return(0,t.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,t.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,t.jsx)("p",{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)("p",{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:"../ui/assets/audit-logs-preview.png",alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{e.target.style.display="none"}})]});let K=$.data?.audit_logs??[],V=$.data?.total??0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Audit Logs"})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(L,{placeholder:"Object ID",allowClear:!0,style:{width:200},onSearch:e=>{w(e),_(1)},onChange:e=>{e.target.value||(w(""),_(1))}}),(0,t.jsx)(L,{placeholder:"Changed By",allowClear:!0,style:{width:180},onSearch:e=>{k(e),_(1)},onChange:e=>{e.target.value||(k(""),_(1))}}),(0,t.jsx)(L,{placeholder:"Team ID",allowClear:!0,style:{width:180},onSearch:e=>{I(e),_(1)},onChange:e=>{e.target.value||(I(""),_(1))}}),(0,t.jsx)(L,{placeholder:"Key Hash",allowClear:!0,style:{width:180},onSearch:e=>{E(e),_(1)},onChange:e=>{e.target.value||(E(""),_(1))}}),(0,t.jsx)(o.Select,{placeholder:"All Actions",allowClear:!0,style:{width:140},options:[{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}],onChange:e=>{O(e),_(1)}}),(0,t.jsx)(o.Select,{placeholder:"All Tables",allowClear:!0,style:{width:150},options:[{label:"Keys",value:"LiteLLM_VerificationToken"},{label:"Teams",value:"LiteLLM_TeamTable"},{label:"Users",value:"LiteLLM_UserTable"},{label:"Organizations",value:"LiteLLM_OrganizationTable"},{label:"Models",value:"LiteLLM_ProxyModelTable"}],onChange:e=>{P(e),_(1)}}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsx)(d.Button,{icon:(0,t.jsx)(x.ReloadOutlined,{spin:$.isFetching}),onClick:()=>$.refetch(),disabled:$.isFetching}),(0,t.jsx)(c.Pagination,{current:b,pageSize:50,total:V,showTotal:e=>`${e} total`,showSizeChanger:!1,size:"small",onChange:e=>_(e)})]})]})]}),(0,t.jsx)(r.Table,{columns:Y,dataSource:K,rowKey:"id",loading:{spinning:$.isLoading,indicator:(0,t.jsx)(m.Spin,{indicator:(0,t.jsx)(u.LoadingOutlined,{spin:!0}),size:"small"})},size:"small",pagination:!1,onRow:e=>({onClick:()=>{F(e),H(!0)},style:{cursor:"pointer"}})})]}),(0,t.jsx)(T,{open:q,onClose:()=>H(!1),log:B})]})}e.s(["default",()=>E],942161)},307582,e=>{"use strict";var t=e.i(843476);e.s(["TimeCell",0,({utcTime:e})=>(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:(e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}})(e)})])},97859,e=>{"use strict";e.s(["AGENT_CALL_TYPES",0,["asend_message"],"ERROR_CODE_OPTIONS",0,[{label:"400 - Bad Request",value:"400"},{label:"401 - Invalid Authentication",value:"401"},{label:"403 - Permission Denied",value:"403"},{label:"404 - Not Found",value:"404"},{label:"408 - Request Timeout",value:"408"},{label:"422 - Unprocessable Entity",value:"422"},{label:"429 - Rate Limited",value:"429"},{label:"500 - Internal Server Error",value:"500"},{label:"502 - Bad Gateway",value:"502"},{label:"503 - Service Unavailable",value:"503"},{label:"529 - Overloaded",value:"529"}],"MCP_CALL_TYPES",0,["call_mcp_tool","list_mcp_tools"],"QUICK_SELECT_OPTIONS",0,[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}]])},245099,e=>{"use strict";var t=e.i(843476),s=e.i(500330),a=(e.i(389083),e.i(994388)),l=e.i(592968);e.i(271645);var r=e.i(916925),i=e.i(446891),n=e.i(307582),o=e.i(97859);let d=({size:e=12})=>(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0 text-gray-400",children:(0,t.jsx)("path",{d:"M12 3l1.912 5.813a2 2 0 0 0 1.275 1.275L21 12l-5.813 1.912a2 2 0 0 0-1.275 1.275L12 21l-1.912-5.813a2 2 0 0 0-1.275-1.275L3 12l5.813-1.912a2 2 0 0 0 1.275-1.275L12 3z"})}),c=({size:e=10})=>(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:(0,t.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),m=({size:e=12})=>(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[(0,t.jsx)("path",{d:"M12 8V4H8"}),(0,t.jsx)("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),(0,t.jsx)("path",{d:"M2 14h2"}),(0,t.jsx)("path",{d:"M20 14h2"}),(0,t.jsx)("path",{d:"M15 13v2"}),(0,t.jsx)("path",{d:"M9 13v2"})]}),x=({count:e})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(d,{}),null!=e?e:"LLM"]}),u=({count:e})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-amber-50 text-amber-700 border border-amber-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(c,{}),null!=e?e:"MCP"]}),p=({count:e})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-violet-50 text-violet-700 border border-violet-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(m,{}),null!=e?e:"Agent"]}),h=({label:e,field:s,sortBy:a,sortOrder:l,onSortChange:r})=>(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)(i.TableHeaderSortDropdown,{sortState:a===s&&l,onSortChange:e=>{!1===e?r("startTime","desc"):r(s,e)}})]}),g=e=>[{header:e?()=>(0,t.jsx)(h,{label:"Time",field:"startTime",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Time",accessorKey:"startTime",cell:e=>(0,t.jsx)(n.TimeCell,{utcTime:e.getValue()})},{header:"Type",id:"type",cell:e=>{let s=e.row.original,a=s.session_total_count||1,r=o.MCP_CALL_TYPES.includes(s.call_type),i=o.AGENT_CALL_TYPES.includes(s.call_type),n=s.session_llm_count??(r||i?0:a),h=s.session_agent_count??(i?a:0),g=s.session_mcp_count??(r?a:0);if(r)return(0,t.jsx)(u,{});if(i&&a<=1)return(0,t.jsx)(p,{});if(a<=1)return(0,t.jsx)(x,{});let f=(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-blue-50 text-blue-700 border border-blue-200 rounded-full text-[11px] font-medium whitespace-nowrap",children:[(0,t.jsx)(d,{}),(0,t.jsx)("span",{children:a}),h>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-blue-300",children:"·"}),(0,t.jsx)(m,{size:10})]}),g>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-blue-300",children:"·"}),(0,t.jsx)(c,{})]})]}),y=[n>0&&`${n} LLM`,h>0&&`${h} Agent`,g>0&&`${g} MCP`].filter(Boolean);return(0,t.jsx)(l.Tooltip,{title:y.join(" • "),children:f})}},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,t.jsx)("span",{className:`px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ${s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),r=e.row.original.onSessionClick;return(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||""),children:(0,t.jsx)(a.Button,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>r?.(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||""),children:(0,t.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:e?()=>(0,t.jsx)(h,{label:"Cost",field:"spend",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Cost",accessorKey:"spend",cell:e=>{let a=e.row.original,r=a.mcp_tool_call_count||0,i=a.mcp_tool_call_spend||0;return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(l.Tooltip,{title:`$${String(e.getValue()||0)}`,children:(0,t.jsx)("span",{children:(0,s.getSpendString)(e.getValue()||0)})}),r>0&&i>0&&(0,t.jsxs)("span",{className:"text-[10px] text-amber-600",children:["incl. ",(0,s.getSpendString)(i)," from ",r," MCP"]})]})}},{header:e?()=>(0,t.jsx)(h,{label:"Duration (s)",field:"request_duration_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Duration (s)",accessorKey:"request_duration_ms",cell:e=>{let s=e.getValue();if(null==s)return(0,t.jsx)("span",{children:"-"});let a=(s/1e3).toFixed(2);return(0,t.jsx)(l.Tooltip,{title:`${s}ms`,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:a})})}},{header:e?()=>(0,t.jsx)(h,{label:"TTFT (s)",field:"ttft_ms",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"TTFT (s)",accessorKey:"completionStartTime",cell:e=>{let s=e.row.original,a=e.getValue();if(!a||a===s.endTime)return(0,t.jsx)("span",{children:"-"});let r=new Date(a).getTime()-new Date(s.startTime).getTime();if(r<=0)return(0,t.jsx)("span",{children:"-"});let i=(r/1e3).toFixed(2);return(0,t.jsx)(l.Tooltip,{title:`${r}ms`,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:i})})}},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),a=e.row.original.onKeyHashClick;return(0,t.jsx)(l.Tooltip,{title:s,children:(0,t.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>a?.(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:e?()=>(0,t.jsx)(h,{label:"Model",field:"model",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Model",accessorKey:"model",cell:e=>{let s=e.row.original,a=s.custom_llm_provider,i=String(e.getValue()||"");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:s.metadata?.mcp_tool_call_metadata?.mcp_server_logo_url?s.metadata.mcp_tool_call_metadata.mcp_server_logo_url:a?(0,r.getProviderLogoAndName)(a).logo:"",alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(l.Tooltip,{title:i,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:i})})]})}},{header:e?()=>(0,t.jsx)(h,{label:"Tokens",field:"total_tokens",sortBy:e.sortBy,sortOrder:e.sortOrder,onSortChange:e.onSortChange}):"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,t.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,t.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,t.jsx)(l.Tooltip,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let a=Object.entries(s),r=a[0],i=a.slice(1);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,t.jsx)(l.Tooltip,{title:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:a.map(([e,s])=>(0,t.jsxs)("span",{children:[e,": ",String(s)]},e))}),children:(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[r[0],": ",String(r[1]),i.length>0&&` +${i.length}`]})})})}}];g(),e.s(["createColumns",0,g],245099)},70969,e=>{"use strict";var t=e.i(843476);e.s(["ConfigInfoMessage",0,({show:e,onOpenSettings:s})=>e?(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,t.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,t.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file",s&&(0,t.jsxs)(t.Fragment,{children:[" or"," ",(0,t.jsx)("button",{onClick:s,className:"text-blue-600 hover:text-blue-800 underline font-medium",children:"open the settings"})," ","to configure this directly."]})]}),(0,t.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:`general_settings:
- store_model_in_db: true
- store_prompts_in_spend_logs: true`}),(0,t.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null])},70635,e=>{"use strict";var t=e.i(843476),s=e.i(362024),a=e.i(500330);let l=e=>null==e?"-":`$${(0,a.formatNumberWithCommas)(e,8)}`,r=e=>null==e?"-":`${(100*e).toFixed(2)}%`;e.s(["CostBreakdownViewer",0,({costBreakdown:e,totalSpend:a,promptTokens:i,completionTokens:n,cacheHit:o,rawInputTokens:d,cacheReadTokens:c,cacheCreationTokens:m})=>{let x=o?.toLowerCase()==="true",u=void 0!==i||void 0!==n,p=e?.input_cost!==void 0||e?.output_cost!==void 0,h=e?.additional_costs&&Object.entries(e.additional_costs).some(([,e])=>null!=e&&0!==e);if(!(p||u||h||e&&(void 0!==e.discount_percent&&0!==e.discount_percent||void 0!==e.discount_amount&&0!==e.discount_amount||void 0!==e.margin_percent&&0!==e.margin_percent||void 0!==e.margin_fixed_amount&&0!==e.margin_fixed_amount||void 0!==e.margin_total_amount&&0!==e.margin_total_amount)))return null;let g=e&&(void 0!==e.discount_percent&&0!==e.discount_percent||void 0!==e.discount_amount&&0!==e.discount_amount),f=e&&(void 0!==e.margin_percent&&0!==e.margin_percent||void 0!==e.margin_fixed_amount&&0!==e.margin_fixed_amount||void 0!==e.margin_total_amount&&0!==e.margin_total_amount),y=x?0:e?.input_cost,j=x?0:e?.output_cost,b=x?0:e?.original_cost,v=x?0:e?.total_cost??a;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(s.Collapse,{expandIconPosition:"start",items:[{key:"1",label:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Cost Breakdown"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mr-4",children:[(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Total:"}),(0,t.jsxs)("span",{className:"text-sm font-semibold text-gray-900",children:[l(a),x&&" (Cached)"]})]})]}),children:(0,t.jsxs)("div",{className:"p-6 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2 max-w-2xl",children:[(()=>{if(e?.cache_read_cost!==void 0||e?.cache_creation_cost!==void 0){let s=x?0:(y??0)-(e?.cache_read_cost??0)-(e?.cache_creation_cost??0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Input Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(s),null!=d&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",d.toLocaleString()," tokens)"]})]})]}),(e?.cache_read_cost??0)>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Cache Read Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(x?0:e?.cache_read_cost),(c??0)>0&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",(c??0).toLocaleString()," tokens)"]})]})]}),(e?.cache_creation_cost??0)>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Cache Write Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(x?0:e?.cache_creation_cost),(m??0)>0&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",(m??0).toLocaleString()," tokens)"]})]})]})]})}return(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Input Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(y),void 0!==i&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",i.toLocaleString()," prompt tokens)"]})]})]})})(),(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Output Cost:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:[l(j),void 0!==n&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal ml-1",children:["(",n.toLocaleString()," completion tokens)"]})]})]}),e?.tool_usage_cost!==void 0&&e.tool_usage_cost>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Tool Usage Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:l(e.tool_usage_cost)})]}),e?.additional_costs&&Object.entries(e.additional_costs).filter(([,e])=>null!=e&&0!==e).map(([e,s])=>(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsxs)("span",{className:"text-gray-600 font-medium w-1/3",children:[e,":"]}),(0,t.jsx)("span",{className:"text-gray-900",children:l(s)})]},e))]}),!x&&(0,t.jsx)("div",{className:"pt-2 border-t border-gray-100 max-w-2xl",children:(0,t.jsxs)("div",{className:"flex text-sm font-semibold",children:[(0,t.jsx)("span",{className:"text-gray-900 w-1/3",children:"Original LLM Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:l(b)})]})}),(g||f)&&(0,t.jsxs)("div",{className:"pt-2 space-y-2 max-w-2xl",children:[g&&(0,t.jsxs)("div",{className:"space-y-2",children:[void 0!==e.discount_percent&&0!==e.discount_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsxs)("span",{className:"font-medium w-1/3",children:["Discount (",r(e.discount_percent),"):"]}),(0,t.jsxs)("span",{className:"text-gray-900",children:["-",l(e.discount_amount)]})]}),void 0!==e.discount_amount&&void 0===e.discount_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Discount Amount:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:["-",l(e.discount_amount)]})]})]}),f&&(0,t.jsxs)("div",{className:"space-y-2",children:[void 0!==e.margin_percent&&0!==e.margin_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsxs)("span",{className:"font-medium w-1/3",children:["Margin (",r(e.margin_percent),"):"]}),(0,t.jsxs)("span",{className:"text-gray-900",children:["+",l((e.margin_total_amount||0)-(e.margin_fixed_amount||0))]})]}),void 0!==e.margin_fixed_amount&&0!==e.margin_fixed_amount&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Margin:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:["+",l(e.margin_fixed_amount)]})]})]})]}),(0,t.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-200 max-w-2xl",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"font-bold text-sm text-gray-900 w-1/3",children:"Final Calculated Cost:"}),(0,t.jsxs)("span",{className:"text-sm font-bold text-gray-900",children:[l(v),x&&" (Cached)"]})]})})]})}]})})}])},339086,504809,e=>{"use strict";e.i(843476);var t=e.i(271645);e.s([],339086);var s=e.i(166540),a=e.i(764205),l=e.i(266027),r=e.i(633627),i=e.i(374009),n=e.i(700514);let o="Team ID",d="Key Hash",c="Request ID",m="Model",x="User ID",u="End User",p="Status",h="Key Alias",g="Error Code",f="Error Message";function y({logs:e,accessToken:y,startTime:j,endTime:b,pageSize:v=n.defaultPageSize,isCustomDate:_,setCurrentPage:N,userID:w,userRole:S,sortBy:k="startTime",sortOrder:C="desc",currentPage:T=1}){let L=(0,t.useMemo)(()=>({[o]:"",[d]:"",[c]:"",[m]:"",[x]:"",[u]:"",[p]:"",[h]:"",[g]:"",[f]:""}),[]),[M,A]=(0,t.useState)(L),[E,D]=(0,t.useState)(null),I=(0,t.useRef)(0),z=(0,t.useRef)(M),O=(0,t.useRef)(!1),R=(0,t.useCallback)(async(e,t=1)=>{if(!y)return;console.log("Filters being sent to API:",e);let l=Date.now();I.current=l;let r=(0,s.default)(j).utc().format("YYYY-MM-DD HH:mm:ss"),i=_?(0,s.default)(b).utc().format("YYYY-MM-DD HH:mm:ss"):(0,s.default)().utc().format("YYYY-MM-DD HH:mm:ss");try{let s=await (0,a.uiSpendLogsCall)({accessToken:y,start_date:r,end_date:i,page:t,page_size:v,params:{api_key:e[d]||void 0,team_id:e[o]||void 0,request_id:e[c]||void 0,user_id:e[x]||void 0,end_user:e[u]||void 0,status_filter:e[p]||void 0,model_id:e[m]||void 0,key_alias:e[h]||void 0,error_code:e[g]||void 0,error_message:e[f]||void 0,sort_by:k,sort_order:C}});l===I.current&&D({...s,data:s.data??[]})}catch(e){console.error("Error searching users:",e),D({data:[],total:0,page:1,page_size:v,total_pages:0})}},[y,j,b,_,v,k,C]),P=(0,t.useMemo)(()=>(0,i.default)((e,t)=>R(e,t),300),[R]);(0,t.useEffect)(()=>()=>P.cancel(),[P]);let B=(0,t.useMemo)(()=>!!(M[h]||M[d]||M[c]||M[x]||M[u]||M[g]||M[f]||M[m]),[M]);(0,t.useEffect)(()=>{z.current=M,O.current=B},[M,B]),(0,t.useEffect)(()=>{O.current&&y&&(P.cancel(),R(z.current,T))},[k,C,T,j,b,_]);let F=(0,t.useMemo)(()=>{if(!e||!e.data)return{data:[],total:0,page:1,page_size:v,total_pages:0};if(B)return e;let t=[...e.data];return M[o]&&(t=t.filter(e=>e.team_id===M[o])),M[p]&&(t=t.filter(e=>"success"===M[p]?!e.status||"success"===e.status:e.status===M[p])),M[m]&&(t=t.filter(e=>e.model_id===M[m])),M[d]&&(t=t.filter(e=>e.api_key===M[d])),M[u]&&(t=t.filter(e=>e.end_user===M[u])),M[g]&&(t=t.filter(e=>{let t=(e.metadata||{}).error_information;return t&&t.error_code===M[g]})),{data:t,total:e.total,page:e.page,page_size:e.page_size,total_pages:e.total_pages}},[e,M,B]),q=(0,t.useMemo)(()=>B?null!==E?E:{data:[],total:0,page:1,page_size:v,total_pages:0}:F,[B,E,F]),{data:H}=(0,l.useQuery)({queryKey:["allTeamsForLogFilters",y],queryFn:async()=>y&&await (0,r.fetchAllTeams)(y)||[],enabled:!!y}),$=(0,t.useCallback)((e=T)=>{B&&y&&(P.cancel(),R(M,e))},[B,y,M,T,R,P]);return{filters:M,filteredLogs:q,hasBackendFilters:B,allTeams:H,handleFilterChange:e=>{A(t=>{let s={...t,...e};for(let e of Object.keys(L))e in s||(s[e]=L[e]);return JSON.stringify(s)!==JSON.stringify(t)&&(N(1),D(null),P(s,1)),s})},handleFilterReset:()=>{A(L),D(null),P.cancel(),N(1)},refetchWithFilters:$}}e.s(["useLogFilterLogic",()=>y],504809)},894660,283086,195116,e=>{"use strict";var t=e.i(801312);e.s(["LeftOutlined",()=>t.default],894660);var s=e.i(475254);let a=(0,s.default)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);e.s(["Sparkles",()=>a],283086);let l=(0,s.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);e.s(["Wrench",()=>l],195116)},257486,624001,207066,337767,237062,e=>{"use strict";var t=e.i(97859);function s(e,s){let a=(s||"").trim();if(t.MCP_CALL_TYPES.includes(e))return a.replace(/^mcp:\s*/i,"").split("/").pop()||a||"mcp_tool";let l=(a.split("/").pop()||a).replace(/-20\d{6}.*$/i,"").replace(/:.*$/,""),r=l.match(/claude-[a-z0-9-]+/i);return r?r[0]:l||"llm_call"}e.s(["getEventDisplayName",()=>s],257486);var a=e.i(843476),l=e.i(464571),r=e.i(770914),i=e.i(262218),n=e.i(592968),o=e.i(898586),d=e.i(149192),c=e.i(536591);e.s(["UpOutlined",()=>c.default],624001);var c=c,m=e.i(755151),x=e.i(166540),u=e.i(916925);let p="16px 24px",h="Escape",g="monospace",f="#f0f0f0",y="#fff";e.s(["API_BASE_MAX_WIDTH",0,200,"COLOR_BACKGROUND",0,y,"COLOR_BG_LIGHT",0,"#fafafa","COLOR_BORDER",0,f,"DEFAULT_MAX_WIDTH",0,180,"DRAWER_CONTENT_PADDING",0,"24px","DRAWER_HEADER_PADDING",0,p,"DRAWER_WIDTH",0,"60%","FONT_FAMILY_MONO",0,g,"FONT_SIZE_HEADER",0,16,"FONT_SIZE_MEDIUM",0,13,"FONT_SIZE_SMALL",0,12,"JSON_MAX_HEIGHT",0,400,"KEY_ESCAPE",0,h,"KEY_J_LOWER",0,"j","KEY_J_UPPER",0,"J","KEY_K_LOWER",0,"k","KEY_K_UPPER",0,"K","METADATA_MAX_HEIGHT",0,300,"SPACING_LARGE",0,12,"SPACING_MEDIUM",0,8,"SPACING_SMALL",0,4,"SPACING_XLARGE",0,16,"TAB_REQUEST",0,"request","TAB_RESPONSE",0,"response"],207066);let{Text:j}=o.Typography;function b({log:e,onClose:t,onPrevious:s,onNext:l,statusLabel:r,statusColor:i,environment:n}){let o=e.custom_llm_provider||"",d=o?(0,u.getProviderLogoAndName)(o):null;return(0,a.jsxs)("div",{style:{padding:p,borderBottom:`1px solid ${f}`,backgroundColor:y,position:"sticky",top:0,zIndex:10},children:[(0,a.jsx)(v,{model:e.model,providerLogo:d?.logo,providerName:d?.displayName}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[(0,a.jsx)(_,{requestId:e.request_id}),(0,a.jsx)(N,{onPrevious:s,onNext:l,onClose:t})]}),(0,a.jsx)(w,{log:e,statusLabel:r,statusColor:i,environment:n})]})}function v({model:e,providerLogo:t,providerName:s}){return(0,a.jsxs)(r.Space,{size:8,style:{marginBottom:8},children:[t&&(0,a.jsx)("img",{src:t,alt:s||"Provider",style:{width:24,height:24},onError:e=>{e.target.style.display="none"}}),(0,a.jsxs)(r.Space,{size:8,direction:"horizontal",children:[(0,a.jsx)(j,{strong:!0,style:{fontSize:14},children:e}),s&&(0,a.jsx)(j,{type:"secondary",style:{fontSize:12},children:s})]})]})}function _({requestId:e}){return(0,a.jsx)("div",{style:{flex:1,minWidth:0},children:(0,a.jsx)(n.Tooltip,{title:e,children:(0,a.jsx)(j,{strong:!0,copyable:{text:e,tooltips:["Copy Request ID","Copied!"]},style:{fontSize:16,fontFamily:g,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:e})})})}function N({onPrevious:e,onNext:t,onClose:s}){let i={border:"1px solid #d9d9d9",borderRadius:4,padding:"0 4px",fontSize:12,fontFamily:"monospace",marginLeft:4,background:"#fafafa"};return(0,a.jsxs)(r.Space,{size:4,split:(0,a.jsx)("div",{style:{width:1,height:20,background:f}}),children:[(0,a.jsxs)(l.Button,{type:"text",size:"small",onClick:e,children:[(0,a.jsx)(c.default,{}),(0,a.jsx)("span",{style:i,children:"K"})]}),(0,a.jsxs)(l.Button,{type:"text",size:"small",onClick:t,children:[(0,a.jsx)(m.DownOutlined,{}),(0,a.jsx)("span",{style:i,children:"J"})]}),(0,a.jsx)(n.Tooltip,{title:"ESC to close",children:(0,a.jsx)(l.Button,{type:"text",icon:(0,a.jsx)(d.CloseOutlined,{}),onClick:s})})]})}function w({log:e,statusLabel:t,statusColor:s,environment:l}){return(0,a.jsxs)(r.Space,{size:12,children:[(0,a.jsx)(i.Tag,{color:s,children:t}),(0,a.jsxs)(i.Tag,{children:["Env: ",l]}),(0,a.jsxs)(r.Space,{size:8,children:[(0,a.jsx)(j,{type:"secondary",style:{fontSize:13},children:(0,x.default)(e.startTime).format("MMM D, YYYY h:mm:ss A")}),(0,a.jsxs)(j,{type:"secondary",style:{fontSize:13},children:["(",(0,x.default)(e.startTime).fromNow(),")"]})]})]})}e.s(["DrawerHeader",()=>b],337767);var S=e.i(271645);function k({isOpen:e,currentLog:t,allLogs:s,onClose:a,onSelectLog:l}){(0,S.useEffect)(()=>{let t=t=>{var s;if(!((s=t.target)instanceof HTMLInputElement||s instanceof HTMLTextAreaElement)&&e)switch(t.key){case h:a();break;case"j":case"J":r();break;case"k":case"K":i()}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,t,s]);let r=()=>{if(!t||!s.length||!l)return;let e=s.findIndex(e=>e.request_id===t.request_id);e{if(!t||!s.length||!l)return;let e=s.findIndex(e=>e.request_id===t.request_id);e>0&&l(s[e-1])};return{selectNextLog:r,selectPreviousLog:i}}e.s(["useKeyboardNavigation",()=>k],237062)},869939,e=>{"use strict";var t=e.i(843476),s=e.i(175712),a=e.i(262218),l=e.i(291542),r=e.i(898586),i=e.i(770914),n=e.i(592968),o=e.i(245704),d=e.i(518617),c=e.i(19732);let{Text:m}=r.Typography;function x({data:e}){let s=Array.isArray(e)?e:[e];return s.length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[(0,t.jsx)(c.ExperimentOutlined,{style:{fontSize:16,color:"#6366f1"}}),(0,t.jsx)(m,{strong:!0,style:{fontSize:15},children:"LLM Judge Results"})]}),s.map((e,s)=>(0,t.jsx)(u,{entry:e},e.eval_id||s))]}):null}function u({entry:e}){let r=e.passed,c=r?"#52c41a":"#ff4d4f",x=(e.verdicts||[]).filter(e=>"overall"!==(e.criterion_name||"").toLowerCase()),u=[{title:"Criterion",dataIndex:"criterion_name",key:"criterion_name",width:160,render:e=>(0,t.jsx)(m,{strong:!0,style:{whiteSpace:"nowrap"},children:e})},{title:"Weight",dataIndex:"weight",key:"weight",width:65,render:e=>null!=e?(0,t.jsxs)(m,{type:"secondary",style:{fontSize:12},children:[e,"%"]}):null},{title:"Score",dataIndex:"score",key:"score",width:65,render:e=>(0,t.jsx)(m,{style:{color:e>=70?"#52c41a":e>=50?"#faad14":"#ff4d4f",fontWeight:600},children:e})},{title:(0,t.jsx)(n.Tooltip,{title:"Score × Weight — how much each criterion contributes to the final score",children:(0,t.jsx)("span",{style:{borderBottom:"1px dashed #aaa",cursor:"help"},children:"Weighted"})}),key:"weighted",width:75,render:(e,s)=>{if(null==s.weight)return null;let a=s.score*s.weight/100;return(0,t.jsx)(m,{type:"secondary",style:{fontSize:12},children:a%1==0?a:a.toFixed(1)})}},{title:"Comment",dataIndex:"reasoning",key:"reasoning",ellipsis:{showTitle:!1},render:e=>(0,t.jsx)(n.Tooltip,{title:e,children:(0,t.jsx)("span",{style:{fontSize:12},children:e})})}];return(0,t.jsxs)(s.Card,{size:"small",className:"mb-3",style:{borderLeft:`3px solid ${c}`},title:(0,t.jsxs)(i.Space,{children:[r?(0,t.jsx)(o.CheckCircleOutlined,{style:{color:"#52c41a"}}):(0,t.jsx)(d.CloseCircleOutlined,{style:{color:"#ff4d4f"}}),(0,t.jsx)(m,{strong:!0,children:e.eval_name}),(0,t.jsx)(a.Tag,{color:r?"success":"error",children:r?"PASSED":"FAILED"}),(0,t.jsx)(n.Tooltip,{title:`Weighted average of all criterion scores. Each criterion has a weight (%) set when the eval was created — higher-weight criteria count more toward the final score.`,children:(0,t.jsxs)(m,{type:"secondary",style:{fontSize:12,cursor:"help",borderBottom:"1px dashed #aaa"},children:[e.overall_score?.toFixed(0)," / 100",null!=e.threshold&&` (threshold: ${e.threshold})`]})})]}),extra:(0,t.jsxs)(i.Space,{size:"small",children:[e.judge_model&&(0,t.jsxs)(m,{type:"secondary",style:{fontSize:12},children:["Judge: ",e.judge_model]}),null!=e.iteration&&(0,t.jsxs)(m,{type:"secondary",style:{fontSize:12},children:["Iter: ",e.iteration+1]})]}),children:[e.eval_error&&(0,t.jsxs)(m,{type:"warning",style:{display:"block",marginBottom:8,fontSize:12},children:["Judge error: ",e.eval_error]}),x.length>0?(0,t.jsx)(l.Table,{dataSource:x,columns:u,pagination:!1,size:"small",rowKey:"criterion_name",scroll:{x:!0},summary:()=>{if(!x.some(e=>null!=e.weight))return null;let e=x.reduce((e,t)=>e+(null!=t.weight?t.score*t.weight/100:0),0);return(0,t.jsxs)(l.Table.Summary.Row,{children:[(0,t.jsx)(l.Table.Summary.Cell,{index:0,children:(0,t.jsx)(m,{strong:!0,style:{fontSize:12},children:"Total"})}),(0,t.jsx)(l.Table.Summary.Cell,{index:1}),(0,t.jsx)(l.Table.Summary.Cell,{index:2}),(0,t.jsx)(l.Table.Summary.Cell,{index:3,children:(0,t.jsx)(m,{strong:!0,style:{fontSize:12,color:c},children:e%1==0?e:e.toFixed(1)})}),(0,t.jsx)(l.Table.Summary.Cell,{index:4})]})}}):(0,t.jsxs)(m,{type:"secondary",style:{fontSize:12},children:["Score: ",e.overall_score?.toFixed(1)," — no per-criterion breakdown available."]})]})}e.s(["default",()=>x])},3565,331052,867612,502626,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(464571),l=e.i(608856),r=e.i(492030),i=e.i(166406),n=e.i(894660),o=e.i(240647),d=e.i(531245),c=e.i(283086),m=e.i(195116),x=e.i(97859),u=e.i(257486),p=e.i(337767),h=e.i(237062),g=e.i(898586),f=e.i(869216),y=e.i(175712),j=e.i(262218),b=e.i(653496),v=e.i(560445),_=e.i(362024),N=e.i(91739),w=e.i(770914),S=e.i(482725),k=e.i(166540),C=e.i(500330),T=e.i(517442),L=e.i(869939),M=e.i(70635),A=e.i(70969),E=e.i(916925);function D({data:e}){let[a,l]=(0,s.useState)({});if(!e||0===e.length)return null;let r=e=>new Date(1e3*e).toLocaleString();return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{defaultActiveKey:["1"],expandIconPosition:"start",items:[{key:"1",label:(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Vector Store Requests"}),children:(0,t.jsx)("div",{className:"p-4",children:e.map((e,s)=>{var i,n;return(0,t.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,t.jsx)("span",{className:"font-mono",children:e.query})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,t.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,t.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:a}=(0,E.getProviderLogoAndName)(e.custom_llm_provider);return(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("img",{src:s,alt:`${a} logo`,className:"h-5 w-5 mr-2"}),a]})})()})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,t.jsx)("span",{children:r(e.start_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,t.jsx)("span",{children:r(e.end_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsx)("span",{children:(i=e.start_time,n=e.end_time,`${((n-i)*1e3).toFixed(2)}ms`)})]})]})]})}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,t.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,r)=>{let i=a[`${s}-${r}`]||!1;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>{let e;return e=`${s}-${r}`,void l(t=>({...t,[e]:!t[e]}))},children:[(0,t.jsx)("svg",{className:`w-5 h-5 mr-2 transition-transform ${i?"transform rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("span",{className:"font-medium mr-2",children:["Result ",r+1]}),(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,t.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),i&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},r)})})]},s)})})}]})})}e.s(["VectorStoreViewer",()=>D],331052);var I=e.i(592968),z=e.i(207066);let{Text:O}=g.Typography;function R({value:e,maxWidth:s=z.DEFAULT_MAX_WIDTH}){return e?(0,t.jsx)(I.Tooltip,{title:e,children:(0,t.jsx)(O,{copyable:{text:e,tooltips:["Copy","Copied!"]},style:{maxWidth:s,display:"inline-block",verticalAlign:"bottom",fontFamily:z.FONT_FAMILY_MONO,fontSize:z.FONT_SIZE_SMALL},ellipsis:!0,children:e})}):(0,t.jsx)(O,{type:"secondary",children:"-"})}let{Text:P}=g.Typography;function B({prompt:e=0,completion:s=0,total:a=0}){return(0,t.jsxs)(P,{children:[a.toLocaleString()," (",e.toLocaleString()," prompt tokens + ",s.toLocaleString()," completion tokens)"]})}let F=e=>!!e&&e instanceof Date,q=e=>"object"==typeof e&&null!==e,H=e=>!!e&&e instanceof Object&&"function"==typeof e;function $(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function Y(e){let{field:t,value:a,data:l,lastElement:r,openBracket:i,closeBracket:n,level:o,style:d,shouldExpandNode:c,clickToExpandNode:m,outerRef:x,beforeExpandChange:u}=e,p=(0,s.useRef)(!1),[h,g]=(0,s.useState)(()=>c(o,a,t)),f=(0,s.useRef)(null);(0,s.useEffect)(()=>{p.current?g(c(o,a,t)):p.current=!0},[c]);let y=(0,s.useId)();if(0===l.length)return function(e){let{field:t,openBracket:a,closeBracket:l,lastElement:r,style:i}=e;return(0,s.createElement)("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,s.createElement)("span",{className:i.label},$(t,i.quotesForFieldNames),":"),(0,s.createElement)("span",{className:i.punctuation},a),(0,s.createElement)("span",{className:i.punctuation},l),!r&&(0,s.createElement)("span",{className:i.punctuation},","))}({field:t,openBracket:i,closeBracket:n,lastElement:r,style:d});let j=h?d.collapseIcon:d.expandIcon,b=h?d.ariaLables.collapseJson:d.ariaLables.expandJson,v=o+1,_=l.length-1,N=e=>{h!==e&&(!u||u({level:o,value:a,field:t,newExpandValue:e}))&&g(e)},w=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),N("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let t="ArrowUp"===e.key?-1:1;if(!x.current)return;let s=x.current.querySelectorAll("[role=button]"),a=-1;for(let e=0;e{var e;N(!h);let t=f.current;if(!t)return;let s=null==(e=x.current)?void 0:e.querySelector('[role=button][tabindex="0"]');s&&(s.tabIndex=-1),t.tabIndex=0,t.focus()};return(0,s.createElement)("div",{className:d.basicChildStyle,role:"treeitem","aria-expanded":h,"aria-selected":void 0},(0,s.createElement)("span",{className:j,onClick:S,onKeyDown:w,role:"button","aria-label":b,"aria-expanded":h,"aria-controls":h?y:void 0,ref:f,tabIndex:0===o?0:-1}),(t||""===t)&&(m?(0,s.createElement)("span",{className:d.clickableLabel,onClick:S,onKeyDown:w},$(t,d.quotesForFieldNames),":"):(0,s.createElement)("span",{className:d.label},$(t,d.quotesForFieldNames),":")),(0,s.createElement)("span",{className:d.punctuation},i),h?(0,s.createElement)("ul",{id:y,role:"group",className:d.childFieldsContainer},l.map((e,t)=>(0,s.createElement)(U,{key:e[0]||t,field:e[0],value:e[1],style:d,lastElement:t===_,level:v,shouldExpandNode:c,clickToExpandNode:m,beforeExpandChange:u,outerRef:x}))):(0,s.createElement)("span",{className:d.collapsedContent,onClick:S,onKeyDown:w}),(0,s.createElement)("span",{className:d.punctuation},n),!r&&(0,s.createElement)("span",{className:d.punctuation},","))}function K(e){let{field:t,value:s,style:a,lastElement:l,shouldExpandNode:r,clickToExpandNode:i,level:n,outerRef:o,beforeExpandChange:d}=e;return Y({field:t,value:s,lastElement:l||!1,level:n,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:r,clickToExpandNode:i,data:Object.keys(s).map(e=>[e,s[e]]),outerRef:o,beforeExpandChange:d})}function V(e){let{field:t,value:s,style:a,lastElement:l,level:r,shouldExpandNode:i,clickToExpandNode:n,outerRef:o,beforeExpandChange:d}=e;return Y({field:t,value:s,lastElement:l||!1,level:r,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:i,clickToExpandNode:n,data:s.map(e=>[void 0,e]),outerRef:o,beforeExpandChange:d})}function W(e){let t,{field:a,value:l,style:r,lastElement:i}=e,n=r.otherValue;if(null===l)t="null",n=r.nullValue;else if(void 0===l)t="undefined",n=r.undefinedValue;else if("string"==typeof l||l instanceof String){var o;o=!r.noQuotesForStringValues,t=r.stringifyStringValues?JSON.stringify(l):o?`"${l}"`:l,n=r.stringValue}else if("boolean"==typeof l||l instanceof Boolean)t=l?"true":"false",n=r.booleanValue;else if("number"==typeof l||l instanceof Number)t=l.toString(),n=r.numberValue;else"bigint"==typeof l||l instanceof BigInt?(t=`${l.toString()}n`,n=r.numberValue):t=F(l)?l.toISOString():H(l)?"function() { }":l.toString();return(0,s.createElement)("div",{className:r.basicChildStyle,role:"treeitem","aria-selected":void 0},(a||""===a)&&(0,s.createElement)("span",{className:r.label},$(a,r.quotesForFieldNames),":"),(0,s.createElement)("span",{className:n},t),!i&&(0,s.createElement)("span",{className:r.punctuation},","))}function U(e){let t=e.value;return Array.isArray(t)?(0,s.createElement)(V,Object.assign({},e)):!q(t)||F(t)||H(t)?(0,s.createElement)(W,Object.assign({},e)):(0,s.createElement)(K,Object.assign({},e))}let G={container:"_2IvMF _GzYRV",basicChildStyle:"_2bkNM",childFieldsContainer:"_1BXBN",label:"_1MGIk",clickableLabel:"_2YKJg _1MGIk _1MFti",nullValue:"_2T6PJ",undefinedValue:"_1Gho6",stringValue:"_vGjyY",booleanValue:"_3zQKs",numberValue:"_1bQdo",otherValue:"_1xvuR",punctuation:"_3uHL6 _3eOF8",collapseIcon:"_oLqym _f10Tu _1MFti _1LId0",expandIcon:"_2AXVT _f10Tu _1MFti _1UmXx",collapsedContent:"_2KJWg _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:{collapseJson:"collapse JSON",expandJson:"expand JSON"},stringifyStringValues:!1},J=()=>!0,Q=e=>{let{data:t,style:a=G,shouldExpandNode:l=J,clickToExpandNode:r=!1,beforeExpandChange:i,compactTopLevel:n,...o}=e,d=(0,s.useRef)(null);return(0,s.createElement)("div",Object.assign({"aria-label":"JSON view"},o,{className:a.container,ref:d,role:"tree"}),n&&q(t)?Object.entries(t).map(e=>{let[t,n]=e;return(0,s.createElement)(U,{key:t,field:t,value:n,style:{...G,...a},lastElement:!0,level:1,shouldExpandNode:l,clickToExpandNode:r,beforeExpandChange:i,outerRef:d})}):(0,s.createElement)(U,{value:t,style:{...G,...a},lastElement:!0,level:0,shouldExpandNode:l,clickToExpandNode:r,outerRef:d,beforeExpandChange:i}))};e.s(["JsonView",()=>Q,"defaultStyles",()=>G],867612);let{Text:X}=g.Typography;function Z({data:e}){return e?(0,t.jsx)("div",{style:{maxHeight:z.JSON_MAX_HEIGHT,overflow:"auto",background:z.COLOR_BG_LIGHT,padding:z.SPACING_LARGE,borderRadius:4},children:(0,t.jsx)("div",{className:"[&_[role='tree']]:bg-white [&_[role='tree']]:text-slate-900",children:(0,t.jsx)(Q,{data:e,style:G,clickToExpandNode:!0})})}):(0,t.jsx)(X,{type:"secondary",children:"No data"})}function ee(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function et(e){return Array.isArray(e)?e:e?[e]:[]}function es(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}var ea=e.i(366308),el=e.i(755151),er=e.i(291542);let{Text:ei}=g.Typography;function en({tool:e}){let s=Object.entries(e.parameters?.properties||{}).map(([t,s])=>({key:t,name:t,type:s.type||"any",description:s.description||"-",required:e.parameters?.required?.includes(t)||!1})),a=[{title:"Parameter",dataIndex:"name",key:"name",render:(e,s)=>(0,t.jsxs)(ei,{code:!0,children:[e,s.required&&(0,t.jsx)(ei,{type:"danger",children:"*"})]})},{title:"Type",dataIndex:"type",key:"type",render:e=>(0,t.jsx)(ei,{code:!0,style:{color:"#1890ff"},children:e})},{title:"Description",dataIndex:"description",key:"description",render:e=>(0,t.jsx)(ei,{type:"secondary",children:e})}];return(0,t.jsxs)("div",{children:[e.description&&(0,t.jsx)("div",{style:{marginBottom:16},children:(0,t.jsx)(ei,{style:{lineHeight:1.6,whiteSpace:"pre-wrap"},children:e.description})}),s.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(ei,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"Parameters"}),(0,t.jsx)(er.Table,{dataSource:s,columns:a,pagination:!1,size:"small",bordered:!0})]}),e.called&&e.callData&&(0,t.jsxs)("div",{style:{marginTop:16},children:[(0,t.jsx)(ei,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"Called With"}),(0,t.jsx)("div",{style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:4,padding:12},children:(0,t.jsx)("pre",{style:{margin:0,fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(e.callData.arguments,null,2)})})]})]})}function eo({tool:e}){let s={type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}};return(0,t.jsx)("pre",{style:{margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:12,background:"#fafafa",padding:12,borderRadius:4,maxHeight:300,overflow:"auto"},children:JSON.stringify(s,null,2)})}let{Text:ed}=g.Typography;function ec({tool:e}){let[a,l]=(0,s.useState)("formatted");return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:12},children:[(0,t.jsx)(ed,{type:"secondary",style:{fontSize:12},children:"Description"}),(0,t.jsxs)(N.Radio.Group,{size:"small",value:a,onChange:e=>l(e.target.value),children:[(0,t.jsx)(N.Radio.Button,{value:"formatted",children:"Formatted"}),(0,t.jsx)(N.Radio.Button,{value:"json",children:"JSON"})]})]}),"formatted"===a?(0,t.jsx)(en,{tool:e}):(0,t.jsx)(eo,{tool:e})]})}let{Text:em}=g.Typography;function ex({tool:e}){let[a,l]=(0,s.useState)(!1);return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{onClick:()=>l(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",cursor:"pointer",background:a?"#fafafa":"#fff",transition:"background 0.2s"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)(ea.ToolOutlined,{style:{color:"#8c8c8c",fontSize:14}}),(0,t.jsxs)(em,{style:{fontSize:14},children:[e.index,". ",e.name]})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)(j.Tag,{color:e.called?"blue":"default",children:e.called?"called":"not called"}),a?(0,t.jsx)(el.DownOutlined,{style:{fontSize:12,color:"#8c8c8c"}}):(0,t.jsx)(o.RightOutlined,{style:{fontSize:12,color:"#8c8c8c"}})]})]}),a&&(0,t.jsx)("div",{style:{padding:"16px",borderTop:"1px solid #f0f0f0",background:"#fff"},children:(0,t.jsx)(ec,{tool:e})})]})}let{Text:eu}=g.Typography;function ep({log:e}){let s=function(e){let t,s=!(t=es(e.proxy_server_request||e.messages))||Array.isArray(t)?[]:"object"==typeof t&&t.tools&&Array.isArray(t.tools)?t.tools:[];if(0===s.length)return[];let a=function(e){let t=es(e.response);if(!t||"object"!=typeof t)return[];let s=t.choices;if(Array.isArray(s)&&s.length>0){let e=s[0].message;if(e&&Array.isArray(e.tool_calls))return e.tool_calls}if(Array.isArray(t.content)){let e=t.content.filter(e=>"tool_use"===e.type);if(e.length>0)return e.map(e=>({id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.input||{})}}))}if(Array.isArray(t.tool_calls))return t.tool_calls;if(Array.isArray(t.results)){let e=[];for(let s of t.results)if("response.done"===s.type&&s.response?.output)for(let t of s.response.output)"function_call"===t.type&&e.push({id:t.call_id||"",type:"function",function:{name:t.name||"",arguments:t.arguments||"{}"}});if(e.length>0)return e}return[]}(e),l=new Set(a.map(e=>e.function?.name).filter(Boolean)),r=new Map;return a.forEach(e=>{let t=e.function?.name;t&&r.set(t,{id:e.id,name:t,arguments:function(e){try{return JSON.parse(e)}catch{return{}}}(e.function?.arguments||"{}")})}),s.map((e,t)=>{let s=e.function?.name||e.name||`Tool ${t+1}`;return{index:t+1,name:s,description:e.function?.description||e.description||"",parameters:e.function?.parameters||e.input_schema||{},called:l.has(s),callData:r.get(s)}})}(e);if(0===s.length)return null;let a=s.length,l=s.filter(e=>e.called).length,r=s.slice(0,2).map(e=>e.name).join(", "),i=s.length>2;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{expandIconPosition:"start",items:[{key:"1",label:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Tools"}),(0,t.jsxs)(eu,{type:"secondary",style:{fontSize:14},children:[a," provided, ",l," called"]}),(0,t.jsxs)(eu,{type:"secondary",style:{fontSize:14},children:["• ",r,i&&"..."]})]}),children:(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s.map(e=>(0,t.jsx)(ex,{tool:e},e.name))})}]})})}let eh=e=>{if(!e)return{};if("string"==typeof e)try{return JSON.parse(e)}catch{return{raw:e}}return e};var eg=e.i(888259),ef=e.i(264843),ey=e.i(624001);let{Text:ej}=g.Typography;function eb({type:e,tokens:s,cost:l,onCopy:r,isCollapsed:n,onToggleCollapse:o,turnCount:d}){return(0,t.jsxs)("div",{onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",borderBottom:n?"none":"1px solid #f0f0f0",background:"#fafafa",cursor:o?"pointer":"default",transition:"background 0.15s ease"},onMouseEnter:e=>{o&&(e.currentTarget.style.background="#f5f5f5")},onMouseLeave:e=>{e.currentTarget.style.background="#fafafa"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[o&&(0,t.jsx)("div",{style:{display:"flex",alignItems:"center"},children:n?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(ey.UpOutlined,{style:{fontSize:10,color:"#8c8c8c"}})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:["input"===e?(0,t.jsx)(ef.MessageOutlined,{style:{color:"#8c8c8c",fontSize:14}}):(0,t.jsx)("span",{style:{fontSize:14,filter:"grayscale(1)",opacity:.6},children:"✨"}),(0,t.jsx)(ej,{style:{fontWeight:500,fontSize:14},children:"input"===e?"Input":"Output"})]}),void 0!==s&&(0,t.jsxs)(ej,{type:"secondary",style:{fontSize:12},children:["Tokens: ",s.toLocaleString()]}),void 0!==l&&(0,t.jsxs)(ej,{type:"secondary",style:{fontSize:12},children:["Cost: $",l.toFixed(6)]}),void 0!==d&&d>0&&(0,t.jsxs)(ej,{type:"secondary",style:{fontSize:12},children:["Turns: ",d]})]}),(0,t.jsx)(I.Tooltip,{title:"Copy",children:(0,t.jsx)(a.Button,{type:"text",size:"small",icon:(0,t.jsx)(i.CopyOutlined,{}),onClick:e=>{e.stopPropagation(),r()}})})]})}let{Text:ev}=g.Typography;function e_({label:e,content:a,defaultExpanded:l=!1}){let[r,i]=(0,s.useState)(l),[n,d]=(0,s.useState)(!1),c=a?.length||0;return a&&0!==c?(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsxs)("div",{onClick:()=>i(!r),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"4px 0",borderRadius:4,background:n?"#f5f5f5":"transparent",transition:"background 0.15s ease",marginBottom:4*!!r},children:[r?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(o.RightOutlined,{style:{fontSize:10,color:"#8c8c8c"}}),(0,t.jsx)(ev,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase"},children:e}),(0,t.jsxs)(ev,{type:"secondary",style:{fontSize:10},children:["(",c.toLocaleString()," chars)"]})]}),(0,t.jsx)("div",{style:{maxHeight:r?"2000px":"0px",overflow:"hidden",transition:"max-height 0.2s ease-out, opacity 0.2s ease-out",opacity:+!!r},children:(0,t.jsx)("div",{style:{paddingLeft:16,fontSize:13,lineHeight:1.7,color:"#262626",borderLeft:"1px solid #f0f0f0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a})})]}):null}let{Text:eN}=g.Typography;function ew({tool:e,compact:s=!1}){return(0,t.jsxs)("div",{style:{background:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:6,padding:s?"6px 10px":"10px 14px",marginTop:8,fontFamily:"monospace",fontSize:12,position:"relative"},children:[(0,t.jsx)("div",{style:{position:"absolute",top:-8,left:12,background:"#fff",padding:"0 6px",fontSize:10,color:"#8c8c8c",border:"1px solid #e9ecef",borderRadius:3},children:"function"}),(0,t.jsx)(eN,{strong:!0,style:{fontSize:13,display:"block",marginBottom:6},children:e.name}),Object.keys(e.arguments).length>0&&(0,t.jsx)("div",{children:Object.entries(e.arguments).map(([e,s])=>(0,t.jsxs)("div",{style:{marginBottom:2},children:[(0,t.jsxs)(eN,{type:"secondary",style:{fontSize:12},children:[e,":"," "]}),(0,t.jsx)(eN,{style:{fontSize:12},children:JSON.stringify(s)})]},e))})]})}let{Text:eS}=g.Typography;function ek({label:e,content:s,toolCalls:a,isCompact:l=!1}){let r=s&&"null"!==s&&s.length>0?s:null,i=a&&a.length>0;return r||i?(0,t.jsxs)("div",{style:{marginBottom:8*!!l},children:[(0,t.jsx)(eS,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase",display:"block",marginBottom:3},children:e}),r&&(0,t.jsx)("div",{style:{fontSize:13,lineHeight:1.7,color:"#262626",whiteSpace:"pre-wrap",wordBreak:"break-word",marginBottom:6*!!i},children:r}),i&&(0,t.jsx)("div",{children:a.map((e,s)=>(0,t.jsx)(ew,{tool:e,compact:l},e.id||s))})]}):null}let{Text:eC}=g.Typography;function eT({messages:e}){let[a,l]=(0,s.useState)(!1),[r,i]=(0,s.useState)(!1);return 0===e.length?null:(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsxs)("div",{onClick:()=>l(!a),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"4px 0",borderRadius:4,background:r?"#f5f5f5":"transparent",transition:"background 0.15s ease",marginBottom:4*!!a},children:[a?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(o.RightOutlined,{style:{fontSize:10,color:"#8c8c8c"}}),(0,t.jsxs)(eC,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase"},children:["HISTORY (",e.length," message",1!==e.length?"s":"",")"]})]}),(0,t.jsx)("div",{style:{maxHeight:a?"2000px":"0px",overflow:"hidden",transition:"max-height 0.2s ease-out, opacity 0.2s ease-out",opacity:+!!a},children:(0,t.jsx)("div",{style:{paddingLeft:16,borderLeft:"1px solid #f0f0f0"},children:e.map((e,s)=>(0,t.jsx)(ek,{label:e.role.toUpperCase(),content:e.content,toolCalls:e.toolCalls,isCompact:!0},s))})})]})}function eL({messages:e,promptTokens:a,inputCost:l}){let[r,i]=(0,s.useState)(!1);if(0===e.length)return null;let n=e.find(e=>"system"===e.role),o=e.filter(e=>"system"!==e.role),d=o.length>0?o[o.length-1]:null,c=o.slice(0,-1);return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,marginBottom:8,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"input",tokens:a,cost:l,onCopy:()=>{let e=d?.content||"";navigator.clipboard.writeText(e),eg.default.success("Input copied")},isCollapsed:r,onToggleCollapse:()=>i(!r)}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsxs)("div",{style:{padding:"12px 16px"},children:[n&&(0,t.jsx)(e_,{label:"SYSTEM",content:n.content,defaultExpanded:!!(n.content&&n.content.length<200)}),c.length>0&&(0,t.jsx)(eT,{messages:c}),d&&(0,t.jsx)(ek,{label:d.role.toUpperCase(),content:d.content,toolCalls:d.toolCalls})]})})]})}let{Text:eM}=g.Typography;function eA({message:e,completionTokens:a,outputCost:l}){let[r,i]=(0,s.useState)(!1),n=()=>{if(!e)return;let t=e.content||"";navigator.clipboard.writeText(t),eg.default.success("Output copied")};return e?(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"output",tokens:a,cost:l,onCopy:n,isCollapsed:r,onToggleCollapse:()=>i(!r)}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsx)("div",{style:{padding:"12px 16px"},children:(0,t.jsx)(ek,{label:"ASSISTANT",content:e.content,toolCalls:e.toolCalls})})})]}):(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"output",tokens:a,cost:l,onCopy:n,isCollapsed:r,onToggleCollapse:()=>i(!r)}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsx)("div",{style:{padding:"12px 16px"},children:(0,t.jsx)(eM,{type:"secondary",style:{fontSize:13,fontStyle:"italic"},children:"No response data available"})})})]})}var eE=e.i(782273),eD=e.i(313603),eI=e.i(793916);let{Text:ez}=g.Typography;function eO({response:e,metrics:s}){let a=e?.results||[],l=e?.usage,r=a.find(e=>"session.created"===e.type||"session.updated"===e.type),i=a.filter(e=>"response.done"===e.type);return(0,t.jsxs)("div",{children:[r?.session&&(0,t.jsx)(eR,{session:r.session,turnCount:i.length}),i.length>0&&(0,t.jsx)(eP,{responses:i.map(e=>e.response).filter(Boolean),totalUsage:l,metrics:s}),!r&&0===i.length&&(0,t.jsx)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,padding:"16px",color:"#8c8c8c",fontStyle:"italic",fontSize:13},children:"No recognized realtime events found"})]})}function eR({session:e,turnCount:a}){let[l,r]=(0,s.useState)(!0);return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,marginBottom:8,overflow:"hidden"},children:[(0,t.jsx)("div",{onClick:()=>r(!l),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",borderBottom:l?"none":"1px solid #f0f0f0",background:"#fafafa",cursor:"pointer",transition:"background 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.background="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.background="#fafafa"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"center"},children:l?(0,t.jsx)(el.DownOutlined,{style:{fontSize:10,color:"#8c8c8c"}}):(0,t.jsx)(ey.UpOutlined,{style:{fontSize:10,color:"#8c8c8c"}})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)(eD.SettingOutlined,{style:{color:"#8c8c8c",fontSize:14}}),(0,t.jsx)(ez,{style:{fontWeight:500,fontSize:14},children:"Session"})]}),(0,t.jsx)(ez,{type:"secondary",style:{fontSize:12},children:e.model}),a>0&&(0,t.jsxs)(j.Tag,{color:"purple",style:{margin:0,fontWeight:500},children:[a," ",1===a?"turn":"turns"]}),e.voice&&(0,t.jsxs)(j.Tag,{color:"blue",style:{margin:0},children:[(0,t.jsx)(eE.SoundOutlined,{})," ",e.voice]}),e.modalities&&(0,t.jsx)("div",{style:{display:"flex",gap:4},children:e.modalities.map(e=>(0,t.jsxs)(j.Tag,{style:{margin:0},children:["audio"===e?(0,t.jsx)(eI.AudioOutlined,{}):(0,t.jsx)(ef.MessageOutlined,{})," ",e]},e))})]})}),(0,t.jsx)("div",{style:{maxHeight:l?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!l},children:(0,t.jsxs)("div",{style:{padding:"12px 16px"},children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px 24px",fontSize:13},children:[(0,t.jsx)(eH,{label:"Model",value:e.model}),(0,t.jsx)(eH,{label:"Voice",value:e.voice}),(0,t.jsx)(eH,{label:"Temperature",value:e.temperature}),(0,t.jsx)(eH,{label:"Max Output Tokens",value:e.max_response_output_tokens}),(0,t.jsx)(eH,{label:"Input Audio Format",value:e.input_audio_format}),(0,t.jsx)(eH,{label:"Output Audio Format",value:e.output_audio_format}),e.turn_detection&&(0,t.jsx)(eH,{label:"Turn Detection",value:e.turn_detection.type}),e.tools&&e.tools.length>0&&(0,t.jsx)(eH,{label:"Tools",value:`${e.tools.length} tool(s)`})]}),e.instructions&&(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsx)(ez,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase",display:"block",marginBottom:4},children:"Instructions"}),(0,t.jsx)("div",{style:{fontSize:12,lineHeight:1.6,color:"#595959",background:"#fafafa",padding:"8px 12px",borderRadius:4,border:"1px solid #f0f0f0",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:120,overflowY:"auto"},children:e.instructions})]})]})})]})}function eP({responses:e,totalUsage:a,metrics:l}){let[r,i]=(0,s.useState)(!1),n=a?.total_tokens,o=e.length;return(0,t.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(eb,{type:"output",tokens:l?.completion_tokens??n,cost:l?.output_cost,onCopy:()=>{let t=e.flatMap(e=>(e.output||[]).flatMap(e=>(e.content||[]).map(t=>`${e.role}: ${t.transcript||t.text||""}`))).join("\n");navigator.clipboard.writeText(t)},isCollapsed:r,onToggleCollapse:()=>i(!r),turnCount:o}),(0,t.jsx)("div",{style:{maxHeight:r?"0px":"10000px",overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out",opacity:+!r},children:(0,t.jsx)("div",{style:{padding:"12px 16px"},children:e.map((e,s)=>(0,t.jsx)(eB,{response:e,index:s},e.id||s))})})]})}function eB({response:e,index:s}){let a=e.output||[],l=e.usage;return(0,t.jsxs)("div",{style:{marginBottom:12,paddingBottom:12,borderBottom:"1px solid #f5f5f5"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,t.jsx)(j.Tag,{color:"completed"===e.status?"green":"orange",style:{margin:0},children:e.status||"unknown"}),l&&(0,t.jsxs)(ez,{type:"secondary",style:{fontSize:11},children:[l.input_tokens??0," in / ",l.output_tokens??0," out tokens"]}),e.conversation_id&&(0,t.jsx)(I.Tooltip,{title:e.conversation_id,children:(0,t.jsxs)(ez,{type:"secondary",style:{fontSize:11,cursor:"help"},children:["conv: ",e.conversation_id.slice(0,12),"..."]})})]}),a.map((e,s)=>(0,t.jsx)(eF,{output:e},e.id||s)),l?.input_token_details&&(0,t.jsx)(eq,{label:"Input",details:l.input_token_details}),l?.output_token_details&&(0,t.jsx)(eq,{label:"Output",details:l.output_token_details})]})}function eF({output:e}){let s=e.content||[];return s.some(e=>e.transcript||e.text)?(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)(ez,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase",display:"block",marginBottom:3},children:e.role?.toUpperCase()||"ASSISTANT"}),s.map((e,s)=>{let a=e.transcript||e.text;return a?(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,marginBottom:4},children:["audio"===e.type&&(0,t.jsx)(eI.AudioOutlined,{style:{color:"#8c8c8c",fontSize:12,marginTop:3,flexShrink:0}}),"text"===e.type&&(0,t.jsx)(ef.MessageOutlined,{style:{color:"#8c8c8c",fontSize:12,marginTop:3,flexShrink:0}}),(0,t.jsx)("div",{style:{fontSize:13,lineHeight:1.7,color:"#262626",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a})]},s):null})]}):null}function eq({label:e,details:s}){let a=Object.entries(s).filter(([,e])=>"number"==typeof e||"object"==typeof e&&null!==e);return 0===a.length?null:(0,t.jsxs)("div",{style:{marginTop:4},children:[(0,t.jsxs)(ez,{type:"secondary",style:{fontSize:10,letterSpacing:"0.5px",textTransform:"uppercase"},children:[e," Token Breakdown"]}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:4},children:a.map(([e,s])=>"number"==typeof s?(0,t.jsxs)(j.Tag,{style:{margin:0},children:[e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),": ",s.toLocaleString()]},e):null)})]})}function eH({label:e,value:s}){return null==s?null:(0,t.jsxs)("div",{children:[(0,t.jsx)(ez,{type:"secondary",style:{fontSize:11},children:e}),(0,t.jsx)("div",{style:{fontSize:13,color:"#262626"},children:String(s)})]})}function e$({request:e,response:s,metrics:a}){let l,r,i;if(s&&s.results&&Array.isArray(s.results)&&0!==s.results.length&&s.results.some(e=>"session.created"===e.type||"session.updated"===e.type||"response.done"===e.type))return(0,t.jsx)(eO,{response:s,metrics:a});let{requestMessages:n,responseMessage:o}=(l=[],e?.messages&&Array.isArray(e.messages)&&e.messages.forEach(e=>{let t;l.push({role:e.role||"user",content:"string"==typeof(t=e.content)?t:Array.isArray(t)?t.map(e=>"string"==typeof e?e:"text"===e.type?e.text:"image_url"===e.type?"[Image]":JSON.stringify(e)).join("\n"):JSON.stringify(t),toolCallId:e.tool_call_id})}),r=null,(i=s?.choices?.[0]?.message)&&(r={role:i.role||"assistant",content:i.content||"",toolCalls:(e=>{if(e&&Array.isArray(e))return e.map(e=>({id:e.id||"",name:e.function?.name||"unknown",arguments:eh(e.function?.arguments)}))})(i.tool_calls)}),{requestMessages:l,responseMessage:r});return(0,t.jsxs)("div",{children:[(0,t.jsx)(eL,{messages:n,promptTokens:a?.prompt_tokens,inputCost:a?.input_cost}),(0,t.jsx)(eA,{message:o,completionTokens:a?.completion_tokens,outputCost:a?.output_cost})]})}let{Text:eY}=g.Typography;function eK({logEntry:e,onOpenSettings:s,isLoadingDetails:a=!1,accessToken:l}){var r,i;let n=e.metadata||{},o="failure"===n.status,d=o?n.error_information:null,c=!!(r=e.messages)&&(Array.isArray(r)?r.length>0:"object"==typeof r&&Object.keys(r).length>0),m=!!(i=e.response)&&Object.keys(ee(i)).length>0,x=!c&&!m&&!o&&!a,u=n?.guardrail_information,p=et(u),h=p.length>0,g=p.reduce((e,t)=>{let s=t?.masked_entity_count;return s?e+Object.values(s).reduce((e,t)=>"number"==typeof t?e+t:e,0):e},0),j=0===p.length?"-":1===p.length?p[0]?.guardrail_name??"-":`${p.length} guardrails`,b=n?.eval_information,_=n.vector_store_request_metadata&&Array.isArray(n.vector_store_request_metadata)&&n.vector_store_request_metadata.length>0;return(0,t.jsxs)("div",{style:{padding:`${z.DRAWER_CONTENT_PADDING} ${z.DRAWER_CONTENT_PADDING} 0`},children:[o&&d&&(0,t.jsx)(v.Alert,{type:"error",showIcon:!0,message:"Request Failed",description:(0,t.jsx)(eV,{errorInfo:d}),className:"mb-6"}),e.request_tags&&Object.keys(e.request_tags).length>0&&(0,t.jsx)(eW,{tags:e.request_tags}),(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(y.Card,{title:"Request Details",size:"small",bordered:!1,style:{marginBottom:0},children:(0,t.jsxs)(f.Descriptions,{column:2,size:"small",children:[(0,t.jsx)(f.Descriptions.Item,{label:"Model",children:e.model}),(0,t.jsx)(f.Descriptions.Item,{label:"Provider",children:e.custom_llm_provider||"-"}),(0,t.jsx)(f.Descriptions.Item,{label:"Call Type",children:e.call_type}),(0,t.jsx)(f.Descriptions.Item,{label:"Model ID",children:(0,t.jsx)(R,{value:e.model_id})}),(0,t.jsx)(f.Descriptions.Item,{label:"API Base",children:(0,t.jsx)(R,{value:e.api_base,maxWidth:z.API_BASE_MAX_WIDTH})}),e.requester_ip_address&&(0,t.jsx)(f.Descriptions.Item,{label:"IP Address",children:e.requester_ip_address}),h&&(0,t.jsx)(f.Descriptions.Item,{label:"Guardrail",children:(0,t.jsx)(eU,{label:j,maskedCount:g})})]})})}),(0,t.jsx)(eG,{logEntry:e,metadata:n}),(0,t.jsx)(M.CostBreakdownViewer,{costBreakdown:n?.cost_breakdown,totalSpend:e.spend??0,promptTokens:e.prompt_tokens,completionTokens:e.completion_tokens,cacheHit:e.cache_hit,rawInputTokens:n?.additional_usage_values?.prompt_tokens_details?.text_tokens,cacheReadTokens:n?.additional_usage_values?.cache_read_input_tokens,cacheCreationTokens:n?.additional_usage_values?.cache_creation_input_tokens}),(0,t.jsx)(ep,{log:e}),x&&(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(A.ConfigInfoMessage,{show:x,onOpenSettings:s})}),a?(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6 p-8 text-center",children:[(0,t.jsx)(S.Spin,{size:"default"}),(0,t.jsx)("div",{style:{marginTop:8,color:"#999"},children:"Loading request & response data..."})]}):(0,t.jsx)(eJ,{hasResponse:m,hasError:o,getRawRequest:()=>ee(e.proxy_server_request||e.messages),getFormattedResponse:()=>o&&d?{error:{message:d.error_message||"An error occurred",type:d.error_class||"error",code:d.error_code||"unknown",param:null}}:ee(e.response),logEntry:e}),h&&(0,t.jsx)("div",{id:"guardrail-section",children:(0,t.jsx)(T.default,{data:u,accessToken:l??null,logEntry:{request_id:e.request_id,user:e.user,model:e.model,startTime:e.startTime,metadata:e.metadata}})}),null!=b&&(0,t.jsx)(L.default,{data:b}),_&&(0,t.jsx)(D,{data:n.vector_store_request_metadata}),e.metadata&&Object.keys(e.metadata).length>0&&(0,t.jsx)(eX,{metadata:e.metadata}),(0,t.jsx)("div",{style:{height:z.DRAWER_CONTENT_PADDING}})]})}function eV({errorInfo:e}){return(0,t.jsxs)("div",{children:[e.error_code&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eY,{strong:!0,children:"Error Code:"})," ",e.error_code]}),e.error_message&&(0,t.jsxs)("div",{children:[(0,t.jsx)(eY,{strong:!0,children:"Message:"})," ",e.error_message]})]})}function eW({tags:e}){return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden p-4 mb-6",children:[(0,t.jsx)(eY,{strong:!0,style:{display:"block",marginBottom:8,fontSize:16},children:"Tags"}),(0,t.jsx)(w.Space,{size:z.SPACING_MEDIUM,wrap:!0,children:Object.entries(e).map(([e,s])=>(0,t.jsxs)(j.Tag,{children:[e,": ",String(s)]},e))})]})}function eU({label:e,maskedCount:s}){return(0,t.jsxs)(w.Space,{size:z.SPACING_MEDIUM,children:[(0,t.jsx)("a",{onClick:()=>{let e=document.getElementById("guardrail-section");e&&e.scrollIntoView({behavior:"smooth"})},style:{cursor:"pointer"},children:e}),s>0&&(0,t.jsxs)(j.Tag,{color:"blue",children:[s," masked"]})]})}function eG({logEntry:e,metadata:s}){let a=e.completionStartTime,l=a&&a!==e.endTime?new Date(a).getTime()-new Date(e.startTime).getTime():null,r=e.cache_hit||s?.additional_usage_values?.cache_read_input_tokens&&s.additional_usage_values.cache_read_input_tokens>0,i=String(e.cache_hit??"None"),n="true"===i.toLowerCase()?"green":"false"===i.toLowerCase()?"red":"default",o=function(e){let t=e?.additional_usage_values?.prompt_tokens_details?.text_tokens??e?.usage_object?.prompt_tokens_details?.text_tokens;if(null==t)return;let s=Number(t);return Number.isFinite(s)?s:void 0}(s),d="anthropic_messages"===e.call_type&&void 0!==o;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(y.Card,{title:"Metrics",size:"small",style:{marginBottom:0},children:(0,t.jsxs)(f.Descriptions,{column:2,size:"small",children:[d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.Descriptions.Item,{label:"Input Tokens",children:(0,C.formatNumberWithCommas)(o)}),(0,t.jsx)(f.Descriptions.Item,{label:"Output Tokens",children:(0,C.formatNumberWithCommas)(e.completion_tokens)})]}):(0,t.jsx)(f.Descriptions.Item,{label:"Tokens",children:(0,t.jsx)(B,{prompt:e.prompt_tokens,completion:e.completion_tokens,total:e.total_tokens})}),(0,t.jsxs)(f.Descriptions.Item,{label:"Cost",children:["$",(0,C.formatNumberWithCommas)(e.spend||0,8)]}),(0,t.jsxs)(f.Descriptions.Item,{label:"Duration",children:[null!=e.request_duration_ms?(e.request_duration_ms/1e3).toFixed(3):"-"," s"]}),null!=l&&l>0&&(0,t.jsxs)(f.Descriptions.Item,{label:"Time to First Token",children:[(l/1e3).toFixed(3)," s"]}),r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.Descriptions.Item,{label:"Cache Hit",children:(0,t.jsx)(j.Tag,{color:n,children:i})}),s?.additional_usage_values?.cache_read_input_tokens>0&&(0,t.jsx)(f.Descriptions.Item,{label:"Cache Read Tokens",children:(0,C.formatNumberWithCommas)(s.additional_usage_values.cache_read_input_tokens)}),s?.additional_usage_values?.cache_creation_input_tokens>0&&(0,t.jsx)(f.Descriptions.Item,{label:"Cache Creation Tokens",children:(0,C.formatNumberWithCommas)(s.additional_usage_values.cache_creation_input_tokens)})]}),s?.litellm_overhead_time_ms!==void 0&&null!==s.litellm_overhead_time_ms&&(0,t.jsxs)(f.Descriptions.Item,{label:"LiteLLM Overhead",children:[s.litellm_overhead_time_ms.toFixed(2)," ms"]}),(0,t.jsx)(f.Descriptions.Item,{label:"Retries",children:s?.attempted_retries!==void 0&&s?.attempted_retries!==null?s.attempted_retries>0?(0,t.jsxs)(t.Fragment,{children:[s.attempted_retries,void 0!==s.max_retries&&null!==s.max_retries?` / ${s.max_retries}`:""]}):(0,t.jsx)(j.Tag,{color:"green",children:"None"}):"-"}),(0,t.jsx)(f.Descriptions.Item,{label:"Start Time",children:(0,k.default)(e.startTime).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")}),(0,t.jsx)(f.Descriptions.Item,{label:"End Time",children:(0,k.default)(e.endTime).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")})]})})})}function eJ({hasResponse:e,hasError:a,getRawRequest:l,getFormattedResponse:r,logEntry:i}){let[n,o]=(0,s.useState)(z.TAB_REQUEST),[d,c]=(0,s.useState)("pretty"),m=i.spend??0,x=i.prompt_tokens||0,u=i.completion_tokens||0,p=x+u,h=i.metadata?.cost_breakdown,g=h?.input_cost!==void 0&&h?.output_cost!==void 0,f=g?h.input_cost??0:p>0?m*x/p:0,y=g?h.output_cost??0:p>0?m*u/p:0;return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{defaultActiveKey:["1"],expandIconPosition:"start",items:[{key:"1",label:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},onClick:e=>{e.target.closest(".ant-radio-group")&&e.stopPropagation()},children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",style:{margin:0},children:"Request & Response"}),(0,t.jsxs)(N.Radio.Group,{size:"small",value:d,onChange:e=>c(e.target.value),children:[(0,t.jsx)(N.Radio.Button,{value:"pretty",children:"Pretty"}),(0,t.jsx)(N.Radio.Button,{value:"json",children:"JSON"})]})]}),children:(0,t.jsx)("div",{children:"pretty"===d?(0,t.jsx)(e$,{request:l(),response:r(),metrics:{prompt_tokens:x,completion_tokens:u,input_cost:f,output_cost:y}}):(0,t.jsx)(b.Tabs,{activeKey:n,onChange:e=>o(e),tabBarExtraContent:(0,t.jsx)(eY,{copyable:{text:JSON.stringify(n===z.TAB_REQUEST?l():r(),null,2),tooltips:["Copy JSON","Copied!"]},disabled:n===z.TAB_RESPONSE&&!e&&!a}),items:[{key:z.TAB_REQUEST,label:"Request",children:(0,t.jsx)("div",{style:{paddingTop:z.SPACING_XLARGE,paddingBottom:z.SPACING_XLARGE},children:(0,t.jsx)(Z,{data:l(),mode:"formatted"})})},{key:z.TAB_RESPONSE,label:"Response",children:(0,t.jsx)("div",{style:{paddingTop:z.SPACING_XLARGE,paddingBottom:z.SPACING_XLARGE},children:e||a?(0,t.jsx)(Z,{data:r(),mode:"formatted"}):(0,t.jsx)("div",{style:{textAlign:"center",padding:20,color:"#999",fontStyle:"italic"},children:"Response data not available"})})}]})})}]})})}function eQ({guardrailEntries:e}){let s=e.every(e=>{let t=e?.guardrail_status||e?.status;return"pass"===t||"passed"===t||"success"===t});return(0,t.jsx)("div",{style:{textAlign:"left",marginBottom:12},children:(0,t.jsxs)("div",{onClick:()=>{let e=document.getElementById("guardrail-section");e&&e.scrollIntoView({behavior:"smooth"})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px",borderRadius:16,cursor:"pointer",fontSize:13,fontWeight:500,backgroundColor:s?"#f0fdf4":"#fef2f2",color:s?"#15803d":"#b91c1c",border:`1px solid ${s?"#bbf7d0":"#fecaca"}`},children:[s?"✓":"✗"," ",e.length," guardrail",1!==e.length?"s":""," evaluated",(0,t.jsx)("span",{style:{fontSize:11,opacity:.7},children:"↓"})]})})}function eX({metadata:e}){return(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden mb-6",children:(0,t.jsx)(_.Collapse,{defaultActiveKey:["1"],expandIconPosition:"start",items:[{key:"1",label:(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Metadata"}),children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:8},children:(0,t.jsx)(eY,{copyable:{text:JSON.stringify(e,null,2),tooltips:["Copy Metadata","Copied!"]}})}),(0,t.jsx)("pre",{style:{maxHeight:z.METADATA_MAX_HEIGHT,overflowY:"auto",fontSize:z.FONT_SIZE_SMALL,fontFamily:z.FONT_FAMILY_MONO,whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:JSON.stringify(e,null,2)})]})}]})})}var eZ=e.i(764205),e0=e.i(266027),e1=e.i(135214);function e2({row:e,isSelected:s,onClick:a}){let l=x.MCP_CALL_TYPES.includes(e.call_type),r=x.AGENT_CALL_TYPES.includes(e.call_type),i=null!=e.request_duration_ms?(e.request_duration_ms/1e3).toFixed(3):e.startTime&&e.endTime?((Date.parse(e.endTime)-Date.parse(e.startTime))/1e3).toFixed(3):"-";return(0,t.jsxs)("button",{type:"button",className:`w-full text-left pl-8 pr-2 py-1 transition-colors ${s?"bg-blue-50":"hover:bg-slate-100"}`,onClick:a,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[l?(0,t.jsx)(m.Wrench,{size:12,className:"text-slate-500 flex-shrink-0"}):r?(0,t.jsx)(d.Bot,{size:12,className:"text-slate-500 flex-shrink-0"}):(0,t.jsx)(c.Sparkles,{size:12,className:"text-slate-500 flex-shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-medium text-slate-900 truncate",children:(0,u.getEventDisplayName)(e.call_type,e.model)})]}),(0,t.jsxs)("div",{className:"text-[10px] text-slate-500 mt-0 flex items-center gap-1.5 font-mono",children:[(0,t.jsxs)("span",{children:[i,"s"]}),e.spend?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsx)("span",{children:(0,C.getSpendString)(e.spend)})]}):null,e.total_tokens?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[e.total_tokens," tok"]})]}):null]})]})}function e5({open:e,onClose:d,logEntry:c,sessionId:m,accessToken:u,onOpenSettings:g,allLogs:f=[],onSelectLog:y,startTime:j}){let b=!!m,[v,_]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1),[S,k]=(0,s.useState)(!1),{data:T=[]}=(0,e0.useQuery)({queryKey:["sessionLogs",m],queryFn:async()=>{if(!m||!u)return[];let e=await (0,eZ.sessionSpendLogsCall)(u,m);return(e.data||e||[]).map(e=>({...e,request_duration_ms:e.request_duration_ms??Date.parse(e.endTime)-Date.parse(e.startTime)})).sort((e,t)=>{let s=+!!x.MCP_CALL_TYPES.includes(e.call_type),a=+!!x.MCP_CALL_TYPES.includes(t.call_type);return s!==a?s-a:new Date(e.startTime).getTime()-new Date(t.startTime).getTime()})},enabled:!!(e&&b&&m&&u)}),L=(0,s.useMemo)(()=>b?T.length?v?T.find(e=>e.request_id===v)||T[0]:c?.request_id&&T.find(e=>e.request_id===c.request_id)||T[0]:null:c,[b,c,v,T]);(0,s.useEffect)(()=>{b&&T.length&&(v&&T.some(e=>e.request_id===v)||_(c?.request_id&&T.some(e=>e.request_id===c.request_id)?c.request_id:T[0].request_id))},[b,c,v,T]),(0,s.useEffect)(()=>{e?w(!1):(b&&_(null),k(!1))},[e,b]);let{selectNextLog:M,selectPreviousLog:A}=(0,h.useKeyboardNavigation)({isOpen:e,currentLog:L,allLogs:b?T:f,onClose:d,onSelectLog:e=>{b&&_(e.request_id),y?.(e)}}),E=((e,t,s)=>{let{accessToken:a}=(0,e1.default)();return(0,e0.useQuery)({queryKey:["logDetails",e,t,a],queryFn:async()=>a&&e&&t?await (0,eZ.uiSpendLogDetailsCall)(a,e,t):null,enabled:s&&!!a&&!!e&&!!t,staleTime:6e5,gcTime:6e5})})(L?.request_id,j,e&&!!L?.request_id),D=E.data,I=E.isLoading,O=(0,s.useMemo)(()=>L?{...L,messages:D?.messages||L.messages,response:D?.response||L.response,proxy_server_request:D?.proxy_server_request||L.proxy_server_request}:null,[L,D]),R=L?.metadata||{},P="failure"===R.status?"Failure":"Success",B="failure"===R.status?"error":"success",F=R?.user_api_key_team_alias||"default",q=T.reduce((e,t)=>e+(t.spend||0),0),H=T.length>0?new Date(Math.min(...T.map(e=>new Date(e.startTime).getTime()))):null,$=T.length>0?new Date(Math.max(...T.map(e=>new Date(e.endTime).getTime()))):null,Y=H&&$?(($.getTime()-H.getTime())/1e3).toFixed(2):"0.00",K=T.filter(e=>!x.MCP_CALL_TYPES.includes(e.call_type)&&!x.AGENT_CALL_TYPES.includes(e.call_type)).length,V=T.filter(e=>x.AGENT_CALL_TYPES.includes(e.call_type)).length,W=T.filter(e=>x.MCP_CALL_TYPES.includes(e.call_type)).length,U=b?T:L?[L]:[],G=b?m||"":L?.request_id||"",J=G.length>14?`${G.slice(0,11)}...`:G,Q=async()=>{if(G)try{await navigator.clipboard.writeText(G),k(!0),setTimeout(()=>k(!1),1200)}catch{}};return L&&O?(0,t.jsx)(l.Drawer,{title:null,placement:"right",onClose:d,open:e,width:z.DRAWER_WIDTH,closable:!1,mask:!0,maskClosable:!0,styles:{body:{padding:0,overflow:"hidden"},header:{display:"none"}},children:(0,t.jsxs)("div",{style:{height:"100%"},className:"flex relative",children:[N?(0,t.jsx)(a.Button,{type:"text",size:"small",icon:(0,t.jsx)(o.RightOutlined,{}),onClick:()=>w(!1),className:"absolute top-2 left-2 z-20 !bg-white !border !border-slate-200 !rounded-md","aria-label":"Expand trace sidebar"}):(0,t.jsx)(a.Button,{type:"text",size:"small",icon:(0,t.jsx)(n.LeftOutlined,{}),onClick:()=>w(!0),className:"absolute top-2 left-2 z-20 !bg-white !border !border-slate-200 !rounded-md","aria-label":"Collapse trace sidebar"}),!N&&(0,t.jsxs)("div",{className:"border-r border-slate-200 bg-slate-50 flex flex-col",style:{width:224},children:[(0,t.jsxs)("div",{className:"pl-12 pr-3 py-2 border-b border-slate-200 bg-white",children:[(0,t.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:b?"Session":"Trace"}),(0,t.jsxs)("div",{className:"font-mono text-[12px] text-slate-900 leading-tight flex items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate",children:J}),(0,t.jsx)("button",{type:"button",onClick:Q,className:"text-slate-400 hover:text-slate-600","aria-label":"Copy trace id",children:S?(0,t.jsx)(r.CheckOutlined,{className:"text-[11px]"}):(0,t.jsx)(i.CopyOutlined,{className:"text-[11px]"})})]})]})}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-slate-500 font-mono",children:[U.length," req",[b?K:U.filter(e=>!x.MCP_CALL_TYPES.includes(e.call_type)&&!x.AGENT_CALL_TYPES.includes(e.call_type)).length,b?V:U.filter(e=>x.AGENT_CALL_TYPES.includes(e.call_type)).length,b?W:U.filter(e=>x.MCP_CALL_TYPES.includes(e.call_type)).length].map((e,s)=>{let a=[" LLM"," Agent"," MCP"][s];return e>0?(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"mx-1.5",children:"·"}),e,a]},a):null}),(0,t.jsx)("span",{className:"mx-1.5",children:"·"}),b?(0,C.getSpendString)(q):(0,C.getSpendString)(L.spend||0),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"mx-1.5",children:"·"}),Y,"s"]})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[et(R?.guardrail_information).length>0&&(0,t.jsx)("div",{className:"px-3 pt-2",children:(0,t.jsx)(eQ,{guardrailEntries:et(R?.guardrail_information)})}),b?(0,t.jsx)("div",{className:"py-1",children:(0,t.jsxs)("div",{className:"relative pl-2",children:[(0,t.jsx)("div",{className:"absolute left-4 top-1 bottom-1 border-l border-slate-300"}),U.map((e,s)=>{let a=s===U.length-1;return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute left-4 top-3 w-3 border-t border-slate-300"}),a&&(0,t.jsx)("div",{className:"absolute left-4 top-3 bottom-0 w-px bg-slate-50"}),(0,t.jsx)(e2,{row:e,isSelected:e.request_id===L.request_id,onClick:()=>{_(e.request_id),y?.(e)}})]},e.request_id)})]})}):(0,t.jsx)("div",{className:"py-1",children:U.map(e=>(0,t.jsx)(e2,{row:e,isSelected:e.request_id===L.request_id,onClick:()=>y?.(e)},e.request_id))})]})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsx)(p.DrawerHeader,{log:L,onClose:d,onPrevious:A,onNext:M,statusLabel:P,statusColor:B,environment:F}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(eK,{logEntry:O,onOpenSettings:g,isLoadingDetails:I,accessToken:u??null})})]})]})}):null}e.s(["LogDetailsDrawer",()=>e5],502626),e.s([],3565)},936190,e=>{"use strict";var t=e.i(843476),s=e.i(619273),a=e.i(266027),l=e.i(912598),r=e.i(166540),i=e.i(271645);e.i(517442),e.i(500330),e.i(122550);var n=e.i(313603),o=e.i(772345),d=e.i(793130),c=e.i(197647),m=e.i(653824),x=e.i(881073),u=e.i(404206),p=e.i(723731),h=e.i(464571),g=e.i(708347),f=e.i(93648),y=e.i(245767),j=e.i(313793),b=e.i(50882),v=e.i(291950),_=e.i(969550),N=e.i(764205),w=e.i(20147),S=e.i(942161),k=e.i(245099);e.i(70969);var C=e.i(97859);e.i(70635),e.i(339086);var T=e.i(504809);e.i(3565);var L=e.i(502626),M=e.i(727749);e.i(867612);var A=e.i(153472),E=e.i(954616),D=e.i(135214);let I=async(e,t)=>{let s=(0,N.getProxyBaseUrl)(),a=s?`${s}/config/update`:"/config/update",l=await fetch(a,{method:"POST",headers:{[(0,N.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({general_settings:{store_prompts_in_spend_logs:t.store_prompts_in_spend_logs,...t.maximum_spend_logs_retention_period&&{maximum_spend_logs_retention_period:t.maximum_spend_logs_retention_period}}})});if(!l.ok){let e=await l.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to update spend logs settings")}return await l.json()};var z=e.i(190702),O=e.i(637235),R=e.i(808613),P=e.i(311451),B=e.i(212931),F=e.i(981339),q=e.i(770914),H=e.i(790848),$=e.i(898586);let Y=({isVisible:e,onCancel:s,onSuccess:a})=>{let[l]=R.Form.useForm(),{mutateAsync:r,isPending:n}=(()=>{let{accessToken:e}=(0,D.default)();return(0,E.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return await I(e,t)}})})(),{mutateAsync:o,isPending:d}=(0,A.useDeleteProxyConfigField)(),{data:c,isLoading:m,refetch:x}=(0,A.useProxyConfig)(A.ConfigType.GENERAL_SETTINGS),u=R.Form.useWatch("store_prompts_in_spend_logs",l);(0,i.useEffect)(()=>{e&&x()},[e,x]);let p=(0,i.useMemo)(()=>{if(!c)return{store_prompts_in_spend_logs:!1,maximum_spend_logs_retention_period:void 0};let e=c.find(e=>"store_prompts_in_spend_logs"===e.field_name),t=c.find(e=>"maximum_spend_logs_retention_period"===e.field_name);return{store_prompts_in_spend_logs:e?.field_value??!1,maximum_spend_logs_retention_period:t?.field_value??void 0}},[c]),g=async e=>{try{let t=e.maximum_spend_logs_retention_period;if(!t||"string"==typeof t&&""===t.trim())try{await o({config_type:A.ConfigType.GENERAL_SETTINGS,field_name:A.GeneralSettingsFieldName.MAXIMUM_SPEND_LOGS_RETENTION_PERIOD})}catch(e){console.warn("Failed to delete retention period field (may not exist):",e)}let s={store_prompts_in_spend_logs:e.store_prompts_in_spend_logs,...t&&"string"==typeof t&&""!==t.trim()&&{maximum_spend_logs_retention_period:t}};await r(s,{onSuccess:()=>{M.default.success("Spend logs settings updated successfully"),x(),a?.()},onError:e=>{M.default.fromBackend("Failed to save spend logs settings: "+(0,z.parseErrorMessage)(e))}})}catch(e){M.default.fromBackend("Failed to save spend logs settings: "+(0,z.parseErrorMessage)(e))}},f=()=>{l.resetFields(),s()};return(0,t.jsx)(B.Modal,{title:(0,t.jsx)($.Typography.Title,{level:5,children:"Spend Logs Settings"}),open:e,footer:(0,t.jsxs)(q.Space,{children:[(0,t.jsx)(h.Button,{onClick:f,disabled:n||d||m,children:"Cancel"}),(0,t.jsx)(h.Button,{type:"primary",loading:n||d,disabled:m,onClick:()=>l.submit(),children:n||d?"Saving...":"Save Settings"})]}),onCancel:f,children:(0,t.jsxs)(R.Form,{form:l,layout:"horizontal",onFinish:g,initialValues:p,children:[(0,t.jsx)(R.Form.Item,{label:"Store Prompts in Spend Logs",name:"store_prompts_in_spend_logs",tooltip:c?.find(e=>"store_prompts_in_spend_logs"===e.field_name)?.field_description||"When enabled, prompts will be stored in spend logs for tracking and analysis purposes.",valuePropName:"checked",children:(0,t.jsx)("div",{children:m?(0,t.jsx)(F.Skeleton.Input,{active:!0,block:!0}):(0,t.jsx)(H.Switch,{checked:u??!1,onChange:e=>l.setFieldValue("store_prompts_in_spend_logs",e)})})}),(0,t.jsx)(R.Form.Item,{label:"Maximum Spend Logs Retention Period (Optional)",name:"maximum_spend_logs_retention_period",tooltip:c?.find(e=>"maximum_spend_logs_retention_period"===e.field_name)?.field_description||"Set the maximum retention period for spend logs (e.g., '7d' for 7 days, '30d' for 30 days). Leave empty for no limit.",children:m?(0,t.jsx)(F.Skeleton.Input,{active:!0,block:!0}):(0,t.jsx)(P.Input,{placeholder:"e.g., 7d, 30d",prefix:(0,t.jsx)(O.ClockCircleOutlined,{})})})]},c?JSON.stringify(p):"loading")})};var K=e.i(149121);function V({accessToken:e,token:M,userRole:A,userID:E,premiumUser:D}){let[I,z]=(0,i.useState)(""),[O,R]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[F,q]=(0,i.useState)(1),[H]=(0,i.useState)(50),$=(0,i.useRef)(null),V=(0,i.useRef)(null),W=(0,i.useRef)(null),[U,G]=(0,i.useState)((0,r.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[J,Q]=(0,i.useState)((0,r.default)().format("YYYY-MM-DDTHH:mm")),[X,Z]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,ea]=(0,i.useState)(""),[el,er]=(0,i.useState)(""),[ei,en]=(0,i.useState)(""),[eo,ed]=(0,i.useState)(""),[ec,em]=(0,i.useState)(""),[ex,eu]=(0,i.useState)(null),[ep,eh]=(0,i.useState)(null),[eg,ef]=(0,i.useState)(""),[ey,ej]=(0,i.useState)(""),[eb,ev]=(0,i.useState)(A&&g.internalUserRoles.includes(A)),[e_,eN]=(0,i.useState)("request logs"),[ew,eS]=(0,i.useState)(null),[ek,eC]=(0,i.useState)(!1),[eT,eL]=(0,i.useState)(null),[eM,eA]=(0,i.useState)(!1),[eE,eD]=(0,i.useState)("startTime"),[eI,ez]=(0,i.useState)("desc"),[eO,eR]=(0,i.useState)(!0);(0,l.useQueryClient)();let[eP,eB]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eP))},[eP]);let[eF,eq]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{ep&&e&&eu({...(await (0,N.keyInfoV1Call)(e,ep)).info,token:ep,api_key:ep})})()},[ep,e]),(0,i.useEffect)(()=>{function e(e){$.current&&!$.current.contains(e.target)&&B(!1),V.current&&!V.current.contains(e.target)&&R(!1),W.current&&!W.current.contains(e.target)&&et(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{A&&g.internalUserRoles.includes(A)&&ev(!0)},[A]);let eH=(0,a.useQuery)({queryKey:["logs","table",F,H,U,J,ei,eo,eb?E:null,eg,ec,eE,eI],queryFn:async()=>{if(!e||!M||!A||!E)return{data:[],total:0,page:1,page_size:H,total_pages:0};let t=(0,r.default)(U).utc().format("YYYY-MM-DD HH:mm:ss"),s=X?(0,r.default)(J).utc().format("YYYY-MM-DD HH:mm:ss"):(0,r.default)().utc().format("YYYY-MM-DD HH:mm:ss");return await (0,N.uiSpendLogsCall)({accessToken:e,start_date:t,end_date:s,page:F,page_size:H,params:{api_key:eo||void 0,team_id:ei||void 0,user_id:eb?E??void 0:void 0,end_user:ey||void 0,status_filter:eg||void 0,model_id:ec||void 0,sort_by:eE,sort_order:eI}})},enabled:!!e&&!!M&&!!A&&!!E&&"request logs"===e_&&eO,refetchInterval:!!eP&&1===F&&15e3,placeholderData:s.keepPreviousData,refetchIntervalInBackground:!0}),e$=(0,i.useDeferredValue)(eH.isFetching),eY=eH.isFetching||e$,eK=eH.data||{data:[],total:0,page:1,page_size:H||10,total_pages:1},{filters:eV,filteredLogs:eW,hasBackendFilters:eU,allTeams:eG,handleFilterChange:eJ,handleFilterReset:eQ,refetchWithFilters:eX}=(0,T.useLogFilterLogic)({logs:eK,accessToken:e,startTime:U,endTime:J,pageSize:H,isCustomDate:X,setCurrentPage:q,userID:E,userRole:A,sortBy:eE,sortOrder:eI,currentPage:F}),eZ=(0,i.useCallback)(()=>{eQ(),G((0,r.default)().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),Q((0,r.default)().format("YYYY-MM-DDTHH:mm")),Z(!1),eq({value:24,unit:"hours"}),q(1)},[eQ]);if((0,i.useEffect)(()=>{eR(!eU)},[eU]),(0,i.useEffect)(()=>{e&&(eV["Team ID"]?en(eV["Team ID"]):en(""),ef(eV.Status||""),em(eV.Model||""),ej(eV["End User"]||""),ed(eV["Key Hash"]||""))},[eV,e]),!e||!M||!A||!E)return null;let e0=eW.data.filter(e=>!I||e.request_id.includes(I)||e.model.includes(I)||e.user&&e.user.includes(I)),e1=e0.reduce((e,t)=>(t.session_id&&(e[t.session_id]||(e[t.session_id]={llm:0,agent:0,mcp:0}),C.MCP_CALL_TYPES.includes(t.call_type)?e[t.session_id].mcp+=1:C.AGENT_CALL_TYPES.includes(t.call_type)?e[t.session_id].agent+=1:e[t.session_id].llm+=1),e),{}),e2=new Map;for(let e of e0){if(!e.session_id||1>=(e.session_total_count||1))continue;let t=C.MCP_CALL_TYPES.includes(e.call_type),s=e2.get(e.session_id);s&&(!s.isMcp||t)||e2.set(e.session_id,{requestId:e.request_id,isMcp:t})}let e5=e0.map(e=>{let t=e.session_id?e1[e.session_id]:void 0;return{...e,request_duration_ms:e.request_duration_ms,session_llm_count:t?.llm??void 0,session_mcp_count:t?.mcp??void 0,session_agent_count:t?.agent??void 0,onKeyHashClick:e=>eh(e),onSessionClick:t=>{t&&(eL(t),eS(e),eC(!0))}}}).filter(e=>!e.session_id||1>=(e.session_total_count||1)||e2.get(e.session_id)?.requestId===e.request_id)||[],e4=[{name:"Team ID",label:"Team ID",customComponent:j.default},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",customComponent:v.PaginatedModelSelect},{name:"Key Alias",label:"Key Alias",customComponent:b.PaginatedKeyAliasSelect},{name:"End User",label:"End User",isSearchable:!0,searchFn:async t=>{if(!e)return[];let s=await (0,N.allEndUsersCall)(e);return(s?.map(e=>e.user_id)||[]).filter(e=>e.toLowerCase().includes(t.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Error Code",label:"Error Code",isSearchable:!0,searchFn:async e=>{if(!e)return C.ERROR_CODE_OPTIONS;let t=e.toLowerCase(),s=C.ERROR_CODE_OPTIONS.filter(e=>e.label.toLowerCase().includes(t));return!C.ERROR_CODE_OPTIONS.some(t=>t.value===e.trim())&&e.trim()&&s.push({label:`Use custom code: ${e.trim()}`,value:e.trim()}),s}},{name:"Key Hash",label:"Key Hash",isSearchable:!1},{name:"Error Message",label:"Error Message",isSearchable:!1}],e6=C.QUICK_SELECT_OPTIONS.find(e=>e.value===eF.value&&e.unit===eF.unit),e3=X?((e,t,s)=>{if(e)return`${(0,r.default)(t).format("MMM D, h:mm A")} - ${(0,r.default)(s).format("MMM D, h:mm A")}`;let a=(0,r.default)(),l=(0,r.default)(t),i=a.diff(l,"minutes");if(i>=0&&i<2)return"Last 1 Minute";if(i>=2&&i<16)return"Last 15 Minutes";if(i>=16&&i<61)return"Last Hour";let n=a.diff(l,"hours");return n>=1&&n<5?"Last 4 Hours":n>=5&&n<25?"Last 24 Hours":n>=25&&n<169?"Last 7 Days":`${l.format("MMM D")} - ${a.format("MMM D")}`})(X,U,J):e6?.label;return(0,t.jsxs)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:[(0,t.jsxs)(m.TabGroup,{defaultIndex:0,onIndexChange:e=>eN(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(x.TabList,{children:[(0,t.jsx)(c.Tab,{children:"Request Logs"}),(0,t.jsx)(c.Tab,{children:"Audit Logs"}),(0,t.jsx)(c.Tab,{children:"Deleted Keys"}),(0,t.jsx)(c.Tab,{children:"Deleted Teams"})]}),(0,t.jsxs)(p.TabPanels,{children:[(0,t.jsxs)(u.TabPanel,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"Request Logs"}),(0,t.jsx)(h.Button,{icon:(0,t.jsx)(n.SettingOutlined,{}),onClick:()=>eA(!0),title:"Spend Logs Settings"})]}),ex&&ep&&ex.api_key===ep?(0,t.jsx)(w.default,{keyId:ep,keyData:ex,teams:eG??[],onClose:()=>eh(null),backButtonText:"Back to Logs"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.default,{options:e4,onApplyFilters:eJ,onResetFilters:eZ}),(0,t.jsx)(Y,{isVisible:eM,onCancel:()=>eA(!1),onSuccess:()=>eA(!1)}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 w-full max-w-full box-border",children:[(0,t.jsxs)("div",{className:"relative w-64 min-w-0 flex-shrink-0",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:I,onChange:e=>z(e.target.value)}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[(0,t.jsxs)("div",{className:"relative z-50",ref:W,children:[(0,t.jsxs)("button",{onClick:()=>et(!ee),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),e3]}),ee&&(0,t.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,t.jsxs)("div",{className:"space-y-1",children:[C.QUICK_SELECT_OPTIONS.map(e=>(0,t.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${e3===e.label?"bg-blue-50 text-blue-600":""}`,onClick:()=>{q(1),Q((0,r.default)().format("YYYY-MM-DDTHH:mm")),G((0,r.default)().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eq({value:e.value,unit:e.unit}),Z(!1),et(!1)},children:e.label},e.label)),(0,t.jsx)("div",{className:"border-t my-2"}),(0,t.jsx)("button",{className:`w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ${X?"bg-blue-50 text-blue-600":""}`,onClick:()=>Z(!X),children:"Custom Range"})]})})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,t.jsx)(d.Switch,{color:"green",checked:eP,defaultChecked:!0,onChange:eB})]}),{}),(0,t.jsx)(h.Button,{type:"default",icon:(0,t.jsx)(o.SyncOutlined,{spin:eY}),onClick:()=>{eU?eX():eH.refetch()},disabled:eY,title:"Fetch data",children:eY?"Fetching":"Fetch"})]}),X&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:U,onChange:e=>{G(e.target.value),q(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,t.jsx)("span",{className:"text-gray-500",children:"to"}),(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:J,onChange:e=>{Q(e.target.value),q(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700 whitespace-nowrap",children:["Showing ",eH.isLoading?"...":eW?(F-1)*H+1:0," -"," ",eH.isLoading?"...":eW?Math.min(F*H,eW.total):0," ","of ",eH.isLoading?"...":eW?eW.total:0," results"]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700 min-w-[90px]",children:["Page ",eH.isLoading?"...":F," of"," ",eH.isLoading?"...":eW?eW.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>q(e=>Math.max(1,e-1)),disabled:eH.isLoading||1===F,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,t.jsx)("button",{onClick:()=>q(e=>Math.min(eW.total_pages||1,e+1)),disabled:eH.isLoading||F===(eW.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),eP&&1===F&&eO&&(0,t.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,t.jsx)("button",{onClick:()=>eB(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(K.DataTable,{columns:(0,k.createColumns)({sortBy:eE,sortOrder:eI,onSortChange:(e,t)=>{eD(e),ez(t),q(1)}}),data:e5,onRowClick:e=>{if(e.session_id&&(e.session_total_count||1)>1){eL(e.session_id),eS(e),eC(!0);return}eL(null),eS(e),eC(!0)},isLoading:eH.isLoading})]})]})]}),(0,t.jsx)(u.TabPanel,{children:(0,t.jsx)(S.default,{userID:E,userRole:A,token:M,accessToken:e,isActive:"audit logs"===e_,premiumUser:D})}),(0,t.jsx)(u.TabPanel,{children:(0,t.jsx)(f.default,{})}),(0,t.jsx)(u.TabPanel,{children:(0,t.jsx)(y.default,{})})]})]}),(0,t.jsx)(L.LogDetailsDrawer,{open:ek,onClose:()=>{eC(!1),eL(null)},logEntry:ew,sessionId:eT,accessToken:e,onOpenSettings:()=>eA(!0),allLogs:e5,onSelectLog:e=>{eS(e)},startTime:(0,r.default)(U).utc().format("YYYY-MM-DD HH:mm:ss")})]})}e.i(331052),e.s(["default",()=>V],936190)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2975ec0f3dbe2fc7.js b/litellm/proxy/_experimental/out/_next/static/chunks/2975ec0f3dbe2fc7.js
new file mode 100644
index 0000000000..0dfc157884
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/2975ec0f3dbe2fc7.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var a=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(a.default,(0,t.default)({},e,{ref:l,icon:s}))});e.s(["ArrowLeftOutlined",0,l],447566)},536916,e=>{"use strict";var t=e.i(374276);e.s(["Checkbox",()=>t.default])},599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),s=e.i(673706),a=e.i(271645);let l=a.default.forwardRef((e,l)=>{let{color:n,className:i,children:o}=e;return a.default.createElement("p",{ref:l,className:(0,r.tremorTwMerge)("text-tremor-default",n?(0,s.getColorClassNames)(n,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),i)},o)});l.displayName="Text",e.s(["default",()=>l],936325),e.s(["Text",()=>l],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),s=e.i(480731),a=e.i(95779),l=e.i(444755),n=e.i(673706);let i=(0,n.makeClassName)("Card"),o=r.default.forwardRef((e,o)=>{let{decoration:c="",decorationColor:d,children:u,className:m}=e,p=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:o,className:(0,l.tremorTwMerge)(i("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",d?(0,n.getColorClassNames)(d,a.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case s.HorizontalPositions.Left:return"border-l-4";case s.VerticalPositions.Top:return"border-t-4";case s.HorizontalPositions.Right:return"border-r-4";case s.VerticalPositions.Bottom:return"border-b-4";default:return""}})(c),m)},p),u)});o.displayName="Card",e.s(["Card",()=>o],304967)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),s=e.i(444755),a=e.i(673706),l=e.i(271645);let n=l.default.forwardRef((e,n)=>{let{color:i,children:o,className:c}=e,d=(0,t.__rest)(e,["color","children","className"]);return l.default.createElement("p",Object.assign({ref:n,className:(0,s.tremorTwMerge)("font-medium text-tremor-title",i?(0,a.getColorClassNames)(i,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},d),o)});n.displayName="Title",e.s(["Title",()=>n],629569)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},292639,e=>{"use strict";var t=e.i(764205),r=e.i(266027);let s=(0,e.i(243652).createQueryKeys)("uiSettings");e.s(["useUISettings",0,()=>(0,r.useQuery)({queryKey:s.list({}),queryFn:async()=>await (0,t.getUiSettings)(),staleTime:36e5,gcTime:36e5})])},250980,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["PlusCircleIcon",0,r],250980)},502547,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});e.s(["ChevronRightIcon",0,r],502547)},214541,e=>{"use strict";var t=e.i(271645),r=e.i(135214),s=e.i(270345);e.s(["default",0,()=>{let[e,a]=(0,t.useState)([]),{accessToken:l,userId:n,userRole:i}=(0,r.default)();return(0,t.useEffect)(()=>{(async()=>{a(await (0,s.fetchTeams)(l,n,i,null))})()},[l,n,i]),{teams:e,setTeams:a}}])},211576,e=>{"use strict";var t=e.i(131757);e.s(["Col",()=>t.default])},530212,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.s(["ArrowLeftIcon",0,r],530212)},646563,e=>{"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},178654,621192,e=>{"use strict";let t=e.i(211576).Col;e.s(["Col",0,t],178654);let r=e.i(264042).Row;e.s(["Row",0,r],621192)},525720,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),s=e.i(529681),a=e.i(908286),l=e.i(242064),n=e.i(246422),i=e.i(838378);let o=["wrap","nowrap","wrap-reverse"],c=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],d=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],u=function(e,t){let s,a,l;return(0,r.default)(Object.assign(Object.assign(Object.assign({},(s=!0===t.wrap?"wrap":t.wrap,{[`${e}-wrap-${s}`]:s&&o.includes(s)})),(a={},d.forEach(r=>{a[`${e}-align-${r}`]=t.align===r}),a[`${e}-align-stretch`]=!t.align&&!!t.vertical,a)),(l={},c.forEach(r=>{l[`${e}-justify-${r}`]=t.justify===r}),l)))},m=(0,n.genStyleHooks)("Flex",e=>{let{paddingXS:t,padding:r,paddingLG:s}=e,a=(0,i.mergeToken)(e,{flexGapSM:t,flexGap:r,flexGapLG:s});return[(e=>{let{componentCls:t}=e;return{[t]:{display:"flex",margin:0,padding:0,"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}})(a),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}})(a),(e=>{let{componentCls:t}=e,r={};return o.forEach(e=>{r[`${t}-wrap-${e}`]={flexWrap:e}}),r})(a),(e=>{let{componentCls:t}=e,r={};return d.forEach(e=>{r[`${t}-align-${e}`]={alignItems:e}}),r})(a),(e=>{let{componentCls:t}=e,r={};return c.forEach(e=>{r[`${t}-justify-${e}`]={justifyContent:e}}),r})(a)]},()=>({}),{resetStyle:!1});var p=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,s=Object.getOwnPropertySymbols(e);at.indexOf(s[a])&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r};let g=t.default.forwardRef((e,n)=>{let{prefixCls:i,rootClassName:o,className:c,style:d,flex:g,gap:x,vertical:f=!1,component:h="div",children:v}=e,b=p(e,["prefixCls","rootClassName","className","style","flex","gap","vertical","component","children"]),{flex:y,direction:w,getPrefixCls:j}=t.default.useContext(l.ConfigContext),N=j("flex",i),[k,C,_]=m(N),S=null!=f?f:null==y?void 0:y.vertical,T=(0,r.default)(c,o,null==y?void 0:y.className,N,C,_,u(N,e),{[`${N}-rtl`]:"rtl"===w,[`${N}-gap-${x}`]:(0,a.isPresetSize)(x),[`${N}-vertical`]:S}),$=Object.assign(Object.assign({},null==y?void 0:y.style),d);return g&&($.flex=g),x&&!(0,a.isPresetSize)(x)&&($.gap=x),k(t.default.createElement(h,Object.assign({ref:n,className:T,style:$},(0,s.default)(b,["justify","wrap","align"])),v))});e.s(["Flex",0,g],525720)},637235,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var a=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(a.default,(0,t.default)({},e,{ref:l,icon:s}))});e.s(["ClockCircleOutlined",0,l],637235)},891547,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:l,className:n,accessToken:i,disabled:o})=>{let[c,d]=(0,r.useState)([]),[u,m]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(i){m(!0);try{let e=await (0,a.getGuardrailsList)(i);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),d(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{m(!1)}}})()},[i]),(0,t.jsx)("div",{children:(0,t.jsx)(s.Select,{mode:"multiple",disabled:o,placeholder:o?"Setting guardrails is a premium feature.":"Select guardrails",onChange:t=>{console.log("Selected guardrails:",t),e(t)},value:l,loading:u,className:n,allowClear:!0,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:`${e.guardrail_name}`,value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}])},921511,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(199133),a=e.i(764205);function l(e){return e.filter(e=>(e.version_status??"draft")!=="draft").map(e=>{var t;let r=e.version_number??1,s=e.version_status??"draft";return{label:`${e.policy_name} — v${r} (${s})${e.description?` — ${e.description}`:""}`,value:"production"===s?e.policy_name:e.policy_id?(t=e.policy_id,`policy_${t}`):e.policy_name}})}e.s(["default",0,({onChange:e,value:n,className:i,accessToken:o,disabled:c,onPoliciesLoaded:d})=>{let[u,m]=(0,r.useState)([]),[p,g]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){g(!0);try{let e=await (0,a.getPoliciesList)(o);e.policies&&(m(e.policies),d?.(e.policies))}catch(e){console.error("Error fetching policies:",e)}finally{g(!1)}}})()},[o,d]),(0,t.jsx)("div",{children:(0,t.jsx)(s.Select,{mode:"multiple",disabled:c,placeholder:c?"Setting policies is a premium feature.":"Select policies (production or published versions)",onChange:t=>{e(t)},value:n,loading:p,className:i,allowClear:!0,options:l(u),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},"getPolicyOptionEntries",()=>l])},439189,435684,96226,497245,e=>{"use strict";function t(e){let t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):new Date("number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?e:NaN)}function r(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function s(e,s){let a=t(e);return isNaN(s)?r(e,NaN):(s&&a.setDate(a.getDate()+s),a)}function a(e,s){let a=t(e);if(isNaN(s))return r(e,NaN);if(!s)return a;let l=a.getDate(),n=r(e,a.getTime());return(n.setMonth(a.getMonth()+s+1,0),l>=n.getDate())?n:(a.setFullYear(n.getFullYear(),n.getMonth(),l),a)}e.s(["toDate",()=>t],435684),e.s(["constructFrom",()=>r],96226),e.s(["addDays",()=>s],439189),e.s(["addMonths",()=>a],497245)},384767,e=>{"use strict";var t=e.i(843476),r=e.i(599724),s=e.i(271645),a=e.i(389083);let l=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});var n=e.i(764205);let i=function({vectorStores:e,accessToken:i}){let[o,c]=(0,s.useState)([]);return(0,s.useEffect)(()=>{(async()=>{if(i&&0!==e.length)try{let e=await (0,n.vectorStoreListCall)(i);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[i,e.length]),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,t.jsx)(a.Badge,{color:"blue",size:"xs",children:e.length})]}),e.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((e,r)=>{let s;return(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:(s=o.find(t=>t.vector_store_id===e))?`${s.vector_store_name||s.vector_store_id} (${s.vector_store_id})`:e},r)})}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(l,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(r.Text,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},o=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});var c=e.i(871943),d=e.i(502547),u=e.i(592968);let m=function({mcpServers:e,mcpAccessGroups:l=[],mcpToolPermissions:i={},mcpToolsets:m=[],accessToken:p}){let[g,x]=(0,s.useState)([]),[f,h]=(0,s.useState)([]),[v,b]=(0,s.useState)(new Set),[y,w]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{(async()=>{if(p&&e.length>0)try{let e=await (0,n.fetchMCPServers)(p);e&&Array.isArray(e)?x(e):e.data&&Array.isArray(e.data)&&x(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[p,e.length]),(0,s.useEffect)(()=>{(async()=>{if(p&&m.length>0)try{let e=await (0,n.fetchMCPToolsets)(p),t=Array.isArray(e)?e.filter(e=>m.includes(e.toolset_id)):[];h(t)}catch(e){console.error("Error fetching toolsets:",e)}})()},[p,m.length]);let j=[...e.map(e=>({type:"server",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],N=j.length+m.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,t.jsx)(a.Badge,{color:"blue",size:"xs",children:N})]}),N>0?(0,t.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:[j.map((e,r)=>{let s="server"===e.type?i[e.value]:void 0,a=s&&s.length>0,l=v.has(e.value);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>{var t;return a&&(t=e.value,void b(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}))},className:`flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ${a?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,t.jsx)(u.Tooltip,{title:`Full ID: ${e.value}`,placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:(e=>{let t=g.find(t=>t.server_id===e);if(t){let r=e.length>7?`${e.slice(0,3)}...${e.slice(-4)}`:e;return`${t.alias} (${r})`}return e})(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),a&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:s.length}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===s.length?"tool":"tools"}),l?(0,t.jsx)(c.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(d.ChevronRightIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),a&&l&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.map((e,r)=>(0,t.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},r))})})]},r)}),m.length>0&&m.map((e,r)=>{let s=f.find(t=>t.toolset_id===e),a=y.has(e),l=s?.tools.length??0;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>l>0&&void w(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),className:`flex items-center gap-3 py-2 px-3 rounded-lg border border-purple-200 transition-all ${l>0?"cursor-pointer hover:bg-purple-50 hover:border-purple-300":"bg-white"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:s?.toolset_name??e}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-purple-600 bg-purple-50 border border-purple-200 rounded uppercase tracking-wide flex-shrink-0",children:"Toolset"})]}),l>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:l}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===l?"tool":"tools"}),a?(0,t.jsx)(c.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(d.ChevronRightIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l>0&&a&&s&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-purple-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.tools.map((e,r)=>(0,t.jsxs)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-xs font-medium",children:[(0,t.jsxs)("span",{className:"text-purple-400 mr-1 text-[10px]",children:[e.server_id.slice(0,6),"…"]}),e.tool_name]},r))})})]},`toolset-${r}`)})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(o,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(r.Text,{className:"text-gray-500 text-sm",children:"No MCP servers, access groups, or toolsets configured"})]})]})},p=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))}),g=function({agents:e,agentAccessGroups:l=[],accessToken:i}){let[o,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(i&&e.length>0)try{let e=await (0,n.getAgentsList)(i);e&&e.agents&&Array.isArray(e.agents)&&c(e.agents)}catch(e){console.error("Error fetching agents:",e)}})()},[i,e.length]);let d=[...e.map(e=>({type:"agent",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],m=d.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p,{className:"h-4 w-4 text-purple-600"}),(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"Agents"}),(0,t.jsx)(a.Badge,{color:"purple",size:"xs",children:m})]}),m>0?(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:d.map((e,r)=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)("div",{className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"agent"===e.type?(0,t.jsx)(u.Tooltip,{title:`Full ID: ${e.value}`,placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:(e=>{let t=o.find(t=>t.agent_id===e);if(t){let r=e.length>7?`${e.slice(0,3)}...${e.slice(-4)}`:e;return`${t.agent_name} (${r})`}return e})(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})})})},r))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(p,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(r.Text,{className:"text-gray-500 text-sm",children:"No agents or access groups configured"})]})]})};e.s(["default",0,function({objectPermission:e,variant:s="card",className:a="",accessToken:l}){let n=e?.vector_stores||[],o=e?.mcp_servers||[],c=e?.mcp_access_groups||[],d=e?.mcp_tool_permissions||{},u=e?.mcp_toolsets||[],p=e?.agents||[],x=e?.agent_access_groups||[],f=e?.search_tools||[],h=(0,t.jsxs)("div",{className:"card"===s?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6":"space-y-4",children:[(0,t.jsx)(i,{vectorStores:n,accessToken:l}),(0,t.jsx)(m,{mcpServers:o,mcpAccessGroups:c,mcpToolPermissions:d,mcpToolsets:u,accessToken:l}),(0,t.jsx)(g,{agents:p,agentAccessGroups:x,accessToken:l}),(0,t.jsxs)("div",{className:"rounded-md border border-gray-100 p-4",children:[(0,t.jsx)(r.Text,{className:"text-sm font-medium text-gray-800",children:"Search tools"}),0===f.length?(0,t.jsx)(r.Text,{className:"mt-1 block text-xs text-gray-500",children:"No restriction — all configured search tools are allowed for this team."}):(0,t.jsx)(r.Text,{className:"mt-1 block text-xs text-gray-700",children:f.join(", ")})]})]});return"card"===s?(0,t.jsxs)("div",{className:`bg-white border border-gray-200 rounded-lg p-6 ${a}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,t.jsx)(r.Text,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),h]}):(0,t.jsxs)("div",{className:`${a}`,children:[(0,t.jsx)(r.Text,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),h]})}],384767)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/673d847ad9c91666.js b/litellm/proxy/_experimental/out/_next/static/chunks/2a5f4a7388e54210.js
similarity index 88%
rename from litellm/proxy/_experimental/out/_next/static/chunks/673d847ad9c91666.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/2a5f4a7388e54210.js
index e3b1d20124..800957b3f9 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/673d847ad9c91666.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/2a5f4a7388e54210.js
@@ -1,4 +1,4 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,349356,e=>{e.v({AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"})},137429,e=>{e.v({0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"})},599724,936325,e=>{"use strict";var o=e.i(95779),r=e.i(444755),l=e.i(673706),t=e.i(271645);let n=t.default.forwardRef((e,n)=>{let{color:a,className:s,children:i}=e;return t.default.createElement("p",{ref:n,className:(0,r.tremorTwMerge)("text-tremor-default",a?(0,l.getColorClassNames)(a,o.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),s)},i)});n.displayName="Text",e.s(["default",()=>n],936325),e.s(["Text",()=>n],599724)},350967,46757,e=>{"use strict";var o=e.i(290571),r=e.i(444755),l=e.i(673706),t=e.i(271645);let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},a={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},s={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},i={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},c={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},d={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},g={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},p={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};e.s(["colSpan",()=>c,"colSpanLg",()=>p,"colSpanMd",()=>g,"colSpanSm",()=>d,"gridCols",()=>n,"gridColsLg",()=>i,"gridColsMd",()=>s,"gridColsSm",()=>a],46757);let m=(0,l.makeClassName)("Grid"),h=(e,o)=>e&&Object.keys(o).includes(String(e))?o[e]:"",u=t.default.forwardRef((e,l)=>{let{numItems:c=1,numItemsSm:d,numItemsMd:g,numItemsLg:p,children:u,className:b}=e,k=(0,o.__rest)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=h(c,n),v=h(d,a),x=h(g,s),w=h(p,i),y=(0,r.tremorTwMerge)(f,v,x,w);return t.default.createElement("div",Object.assign({ref:l,className:(0,r.tremorTwMerge)(m("root"),"grid",y,b)},k),u)});u.displayName="Grid",e.s(["Grid",()=>u],350967)},678784,678745,e=>{"use strict";let o=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>o],678745),e.s(["CheckIcon",()=>o],678784)},546467,e=>{"use strict";let o=(0,e.i(475254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["default",()=>o])},673709,e=>{"use strict";var o=e.i(843476),r=e.i(271645),l=e.i(678784);let t=(0,e.i(475254).default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);var n=e.i(650056);let a={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};e.s(["default",0,({code:e,language:s})=>{let[i,c]=(0,r.useState)(!1);return(0,o.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,o.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:i?(0,o.jsx)(l.CheckIcon,{size:16}):(0,o.jsx)(t,{size:16})}),(0,o.jsx)(n.Prism,{language:s,style:a,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:e})]})}],673709)},778917,e=>{"use strict";var o=e.i(546467);e.s(["ExternalLink",()=>o.default])},191905,e=>{"use strict";var o=e.i(843476),r=e.i(599724),l=e.i(197647),t=e.i(653824),n=e.i(881073),a=e.i(404206),s=e.i(723731),i=e.i(350967),c=e.i(673709),d=e.i(778917);let g=({href:e,className:r})=>(0,o.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(...e){return e.filter(Boolean).join(" ")}("inline-flex items-center gap-2 rounded-xl border border-zinc-200 bg-white/80 px-3.5 py-2 text-sm font-medium text-zinc-700 shadow-sm","hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:translate-y-[0.5px]",r),children:[(0,o.jsx)("span",{children:"API Reference Docs"}),(0,o.jsx)(d.ExternalLink,{"aria-hidden":!0,className:"h-4 w-4 opacity-80"}),(0,o.jsx)("span",{className:"sr-only",children:"(opens in a new tab)"})]}),p=({proxySettings:e})=>{let d="",p=e?.LITELLM_UI_API_DOC_BASE_URL;return p&&p.trim()?d=p:e?.PROXY_BASE_URL&&(d=e.PROXY_BASE_URL),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(i.Grid,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,o.jsxs)("div",{className:"mb-5",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,o.jsx)(g,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,o.jsxs)(r.Text,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,o.jsxs)(t.TabGroup,{children:[(0,o.jsxs)(n.TabList,{children:[(0,o.jsx)(l.Tab,{children:"OpenAI Python SDK"}),(0,o.jsx)(l.Tab,{children:"LlamaIndex"}),(0,o.jsx)(l.Tab,{children:"Langchain Py"})]}),(0,o.jsxs)(s.TabPanels,{children:[(0,o.jsx)(a.TabPanel,{children:(0,o.jsx)(c.default,{language:"python",code:`import openai
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,349356,e=>{e.v({AElig:"Æ",AMP:"&",Aacute:"Á",Acirc:"Â",Agrave:"À",Aring:"Å",Atilde:"Ã",Auml:"Ä",COPY:"©",Ccedil:"Ç",ETH:"Ð",Eacute:"É",Ecirc:"Ê",Egrave:"È",Euml:"Ë",GT:">",Iacute:"Í",Icirc:"Î",Igrave:"Ì",Iuml:"Ï",LT:"<",Ntilde:"Ñ",Oacute:"Ó",Ocirc:"Ô",Ograve:"Ò",Oslash:"Ø",Otilde:"Õ",Ouml:"Ö",QUOT:'"',REG:"®",THORN:"Þ",Uacute:"Ú",Ucirc:"Û",Ugrave:"Ù",Uuml:"Ü",Yacute:"Ý",aacute:"á",acirc:"â",acute:"´",aelig:"æ",agrave:"à",amp:"&",aring:"å",atilde:"ã",auml:"ä",brvbar:"¦",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",ecirc:"ê",egrave:"è",eth:"ð",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",iacute:"í",icirc:"î",iexcl:"¡",igrave:"ì",iquest:"¿",iuml:"ï",laquo:"«",lt:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",oacute:"ó",ocirc:"ô",ograve:"ò",ordf:"ª",ordm:"º",oslash:"ø",otilde:"õ",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',raquo:"»",reg:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",times:"×",uacute:"ú",ucirc:"û",ugrave:"ù",uml:"¨",uuml:"ü",yacute:"ý",yen:"¥",yuml:"ÿ"})},137429,e=>{e.v({0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"})},599724,936325,e=>{"use strict";var o=e.i(95779),r=e.i(444755),l=e.i(673706),t=e.i(271645);let n=t.default.forwardRef((e,n)=>{let{color:a,className:s,children:i}=e;return t.default.createElement("p",{ref:n,className:(0,r.tremorTwMerge)("text-tremor-default",a?(0,l.getColorClassNames)(a,o.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),s)},i)});n.displayName="Text",e.s(["default",()=>n],936325),e.s(["Text",()=>n],599724)},350967,46757,e=>{"use strict";var o=e.i(290571),r=e.i(444755),l=e.i(673706),t=e.i(271645);let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},a={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},s={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},i={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},c={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},d={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},g={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},p={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};e.s(["colSpan",()=>c,"colSpanLg",()=>p,"colSpanMd",()=>g,"colSpanSm",()=>d,"gridCols",()=>n,"gridColsLg",()=>i,"gridColsMd",()=>s,"gridColsSm",()=>a],46757);let m=(0,l.makeClassName)("Grid"),h=(e,o)=>e&&Object.keys(o).includes(String(e))?o[e]:"",u=t.default.forwardRef((e,l)=>{let{numItems:c=1,numItemsSm:d,numItemsMd:g,numItemsLg:p,children:u,className:b}=e,k=(0,o.__rest)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=h(c,n),v=h(d,a),x=h(g,s),w=h(p,i),y=(0,r.tremorTwMerge)(f,v,x,w);return t.default.createElement("div",Object.assign({ref:l,className:(0,r.tremorTwMerge)(m("root"),"grid",y,b)},k),u)});u.displayName="Grid",e.s(["Grid",()=>u],350967)},678784,678745,e=>{"use strict";let o=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>o],678745),e.s(["CheckIcon",()=>o],678784)},546467,e=>{"use strict";let o=(0,e.i(475254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["default",()=>o])},673709,e=>{"use strict";var o=e.i(843476),r=e.i(271645),l=e.i(678784);let t=(0,e.i(475254).default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);var n=e.i(650056);let a={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};e.s(["default",0,({code:e,language:s})=>{let[i,c]=(0,r.useState)(!1);return(0,o.jsxs)("div",{className:"relative rounded-lg border border-gray-200 overflow-hidden",children:[(0,o.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),2e3)},className:"absolute top-3 right-3 p-2 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-600 z-10","aria-label":"Copy code",children:i?(0,o.jsx)(l.CheckIcon,{size:16}):(0,o.jsx)(t,{size:16})}),(0,o.jsx)(n.Prism,{language:s,style:a,customStyle:{margin:0,padding:"1.5rem",borderRadius:"0.5rem",fontSize:"0.9rem",backgroundColor:"#fafafa"},showLineNumbers:!0,children:e})]})}],673709)},592392,e=>{"use strict";var o=e.i(271645),r=e.i(62478),l=e.i(135214);function t(){let{accessToken:e}=(0,l.default)(),[t,n]=(0,o.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null});return(0,o.useEffect)(()=>{e&&(0,r.fetchProxySettings)(e).then(e=>{e&&n(e)})},[e]),t}e.s(["default",()=>t])},778917,e=>{"use strict";var o=e.i(546467);e.s(["ExternalLink",()=>o.default])},191905,e=>{"use strict";var o=e.i(843476),r=e.i(599724),l=e.i(197647),t=e.i(653824),n=e.i(881073),a=e.i(404206),s=e.i(723731),i=e.i(350967),c=e.i(673709),d=e.i(778917);let g=({href:e,className:r})=>(0,o.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Open documentation in a new tab",className:function(...e){return e.filter(Boolean).join(" ")}("inline-flex items-center gap-2 rounded-xl border border-zinc-200 bg-white/80 px-3.5 py-2 text-sm font-medium text-zinc-700 shadow-sm","hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:translate-y-[0.5px]",r),children:[(0,o.jsx)("span",{children:"API Reference Docs"}),(0,o.jsx)(d.ExternalLink,{"aria-hidden":!0,className:"h-4 w-4 opacity-80"}),(0,o.jsx)("span",{className:"sr-only",children:"(opens in a new tab)"})]}),p=({proxySettings:e})=>{let d="",p=e?.LITELLM_UI_API_DOC_BASE_URL;return p&&p.trim()?d=p:e?.PROXY_BASE_URL&&(d=e.PROXY_BASE_URL),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(i.Grid,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,o.jsxs)("div",{className:"mb-5",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,o.jsx)(g,{className:"ml-3 shrink-0",href:"https://docs.litellm.ai/docs/proxy/user_keys"})]}),(0,o.jsxs)(r.Text,{className:"mt-2 mb-2",children:["LiteLLM is OpenAI Compatible. This means your API Key works with the OpenAI SDK. Just replace the base_url to point to your litellm proxy. Example Below"," "]}),(0,o.jsxs)(t.TabGroup,{children:[(0,o.jsxs)(n.TabList,{children:[(0,o.jsx)(l.Tab,{children:"OpenAI Python SDK"}),(0,o.jsx)(l.Tab,{children:"LlamaIndex"}),(0,o.jsx)(l.Tab,{children:"Langchain Py"})]}),(0,o.jsxs)(s.TabPanels,{children:[(0,o.jsx)(a.TabPanel,{children:(0,o.jsx)(c.default,{language:"python",code:`import openai
client = openai.OpenAI(
api_key="your_api_key",
base_url="${d}" # LiteLLM Proxy is OpenAI compatible, Read More: https://docs.litellm.ai/docs/proxy/user_keys
@@ -65,4 +65,4 @@ messages = [
]
response = chat(messages)
-print(response)`})})]})]})]})})})};var m=e.i(271645),h=e.i(62478),u=e.i(135214);e.s(["default",0,()=>{let e=function(){let{accessToken:e}=(0,u.default)(),[o,r]=(0,m.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:"",LITELLM_UI_API_DOC_BASE_URL:null});return(0,m.useEffect)(()=>{e&&(0,h.fetchProxySettings)(e).then(e=>{e&&r(e)})},[e]),o}();return(0,o.jsx)(p,{proxySettings:e})}],191905)}]);
\ No newline at end of file
+print(response)`})})]})]})]})})})};var m=e.i(592392);e.s(["default",0,()=>{let e=(0,m.default)();return(0,o.jsx)(p,{proxySettings:e})}],191905)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2b682a7f2932def8.js b/litellm/proxy/_experimental/out/_next/static/chunks/2b682a7f2932def8.js
new file mode 100644
index 0000000000..f328d17283
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/2b682a7f2932def8.js
@@ -0,0 +1,11 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,127952,368869,e=>{"use strict";var t=e.i(843476),n=e.i(560445),l=e.i(175712),o=e.i(869216),r=e.i(311451),i=e.i(212931),a=e.i(898586);e.i(296059);var s=e.i(868297),d=e.i(732961),c=e.i(289882),u=e.i(170517),b=e.i(628882),g=e.i(320890),p=e.i(104458),m=e.i(722319),f=e.i(8398),h=e.i(279728);e.i(765846);var $=e.i(602716),y=e.i(328052);e.i(262370);var v=e.i(135551);let O=(e,t)=>new v.FastColor(e).setA(t).toRgbString(),x=(e,t)=>new v.FastColor(e).lighten(t).toHexString(),S=e=>{let t=(0,$.generate)(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},j=(e,t)=>{let n=e||"#000",l=t||"#fff";return{colorBgBase:n,colorTextBase:l,colorText:O(l,.85),colorTextSecondary:O(l,.65),colorTextTertiary:O(l,.45),colorTextQuaternary:O(l,.25),colorFill:O(l,.18),colorFillSecondary:O(l,.12),colorFillTertiary:O(l,.08),colorFillQuaternary:O(l,.04),colorBgSolid:O(l,.95),colorBgSolidHover:O(l,1),colorBgSolidActive:O(l,.9),colorBgElevated:x(n,12),colorBgContainer:x(n,8),colorBgLayout:x(n,0),colorBgSpotlight:x(n,26),colorBgBlur:O(l,.04),colorBorder:x(n,26),colorBorderSecondary:x(n,19)}},C={defaultSeed:g.defaultConfig.token,useToken:function(){let[e,t,n]=(0,p.useToken)();return{theme:e,token:t,hashId:n}},defaultAlgorithm:m.default,darkAlgorithm:(e,t)=>{let n=Object.keys(u.defaultPresetColors).map(t=>{let n=(0,$.generate)(e[t],{theme:"dark"});return Array.from({length:10},()=>1).reduce((e,l,o)=>(e[`${t}-${o+1}`]=n[o],e[`${t}${o+1}`]=n[o],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{}),l=null!=t?t:(0,m.default)(e),o=(0,y.default)(e,{generateColorPalettes:S,generateNeutralColorPalettes:j});return Object.assign(Object.assign(Object.assign(Object.assign({},l),n),o),{colorPrimaryBg:o.colorPrimaryBorder,colorPrimaryBgHover:o.colorPrimaryBorderHover})},compactAlgorithm:(e,t)=>{let n=null!=t?t:(0,m.default)(e),l=n.fontSizeSM,o=n.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),function(e){let{sizeUnit:t,sizeStep:n}=e,l=n-2;return{sizeXXL:t*(l+10),sizeXL:t*(l+6),sizeLG:t*(l+2),sizeMD:t*(l+2),sizeMS:t*(l+1),size:t*l,sizeSM:t*l,sizeXS:t*(l-1),sizeXXS:t*(l-1)}}(null!=t?t:e)),(0,h.default)(l)),{controlHeight:o}),(0,f.default)(Object.assign(Object.assign({},n),{controlHeight:o})))},getDesignToken:e=>{let t=(null==e?void 0:e.algorithm)?(0,s.createTheme)(e.algorithm):c.default,n=Object.assign(Object.assign({},u.default),null==e?void 0:e.token);return(0,d.getComputedToken)(n,{override:null==e?void 0:e.token},t,b.default)},defaultConfig:g.defaultConfig,_internalContext:g.DesignTokenContext};e.s(["theme",0,C],368869);var k=e.i(270377),E=e.i(271645);function w({isOpen:e,title:s,alertMessage:d,message:c,resourceInformationTitle:u,resourceInformation:b,onCancel:g,onOk:p,confirmLoading:m,requiredConfirmation:f}){let{Title:h,Text:$}=a.Typography,{token:y}=C.useToken(),[v,O]=(0,E.useState)("");return(0,E.useEffect)(()=>{e&&O("")},[e]),(0,t.jsx)(i.Modal,{title:s,open:e,onOk:p,onCancel:g,confirmLoading:m,okText:m?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!f&&v!==f||m},cancelButtonProps:{disabled:m},children:(0,t.jsxs)("div",{className:"space-y-4",children:[d&&(0,t.jsx)(n.Alert,{message:d,type:"warning"}),(0,t.jsx)(l.Card,{title:u,className:"mt-4",styles:{body:{padding:"16px"},header:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder}},style:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder},children:(0,t.jsx)(o.Descriptions,{column:1,size:"small",children:b&&b.map(({label:e,value:n,...l})=>(0,t.jsx)(o.Descriptions.Item,{label:(0,t.jsx)("span",{className:"font-semibold",children:e}),children:(0,t.jsx)($,{...l,children:n??"-"})},e))})}),(0,t.jsx)("div",{children:(0,t.jsx)($,{children:c})}),f&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,t.jsxs)($,{className:"block text-base font-medium text-gray-700 dark:text-gray-300 mb-2",children:[(0,t.jsx)($,{children:"Type "}),(0,t.jsx)($,{strong:!0,type:"danger",children:f}),(0,t.jsx)($,{children:" to confirm deletion:"})]}),(0,t.jsx)(r.Input,{value:v,onChange:e=>O(e.target.value),placeholder:f,className:"rounded-md",prefix:(0,t.jsx)(k.ExclamationCircleOutlined,{style:{color:y.colorError}}),autoFocus:!0})]})]})})}e.s(["default",()=>w],127952)},544195,e=>{"use strict";var t=e.i(271645),n=e.i(343794),l=e.i(981444),o=e.i(914949),r=e.i(244009),i=e.i(242064),a=e.i(321883),s=e.i(517455);let d=t.createContext(null),c=d.Provider,u=t.createContext(null),b=u.Provider;e.i(247167);var g=e.i(91874),p=e.i(611935),m=e.i(121872),f=e.i(26905),h=e.i(681216),$=e.i(937328),y=e.i(62139);e.i(296059);var v=e.i(915654),O=e.i(183293),x=e.i(246422),S=e.i(838378);let j=(0,x.genStyleHooks)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,l=`0 0 0 ${(0,v.unit)(n)} ${t}`,o=(0,S.mergeToken)(e,{radioFocusShadow:l,radioButtonFocusShadow:l});return[(e=>{let{componentCls:t,antCls:n}=e,l=`${t}-group`;return{[l]:Object.assign(Object.assign({},(0,O.resetComponent)(e)),{display:"inline-block",fontSize:0,[`&${l}-rtl`]:{direction:"rtl"},[`&${l}-block`]:{display:"flex"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"}})}})(o),(e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:l,radioSize:o,motionDurationSlow:r,motionDurationMid:i,motionEaseInOutCirc:a,colorBgContainer:s,colorBorder:d,lineWidth:c,colorBgContainerDisabled:u,colorTextDisabled:b,paddingXS:g,dotColorDisabled:p,lineType:m,radioColor:f,radioBgColor:h,calc:$}=e,y=`${t}-inner`,x=$(o).sub($(4).mul(2)),S=$(1).mul(o).equal({unit:!0});return{[`${t}-wrapper`]:Object.assign(Object.assign({},(0,O.resetComponent)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${t}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${t}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${(0,v.unit)(c)} ${m} ${l}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[t]:Object.assign(Object.assign({},(0,O.resetComponent)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${t}-wrapper:hover &,
+ &:hover ${y}`]:{borderColor:l},[`${t}-input:focus-visible + ${y}`]:(0,O.genFocusOutline)(e),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:"visible"},[`${t}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:$(1).mul(o).div(-2).equal({unit:!0}),marginInlineStart:$(1).mul(o).div(-2).equal({unit:!0}),backgroundColor:f,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:`all ${r} ${a}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:s,borderColor:d,borderStyle:"solid",borderWidth:c,borderRadius:"50%",transition:`all ${i}`},[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${t}-checked`]:{[y]:{borderColor:l,backgroundColor:h,"&::after":{transform:`scale(${e.calc(e.dotSize).div(o).equal()})`,opacity:1,transition:`all ${r} ${a}`}}},[`${t}-disabled`]:{cursor:"not-allowed",[y]:{backgroundColor:u,borderColor:d,cursor:"not-allowed","&::after":{backgroundColor:p}},[`${t}-input`]:{cursor:"not-allowed"},[`${t}-disabled + span`]:{color:b,cursor:"not-allowed"},[`&${t}-checked`]:{[y]:{"&::after":{transform:`scale(${$(x).div(o).equal()})`}}}},[`span${t} + *`]:{paddingInlineStart:g,paddingInlineEnd:g}})}})(o),(e=>{let{buttonColor:t,controlHeight:n,componentCls:l,lineWidth:o,lineType:r,colorBorder:i,motionDurationMid:a,buttonPaddingInline:s,fontSize:d,buttonBg:c,fontSizeLG:u,controlHeightLG:b,controlHeightSM:g,paddingXS:p,borderRadius:m,borderRadiusSM:f,borderRadiusLG:h,buttonCheckedBg:$,buttonSolidCheckedColor:y,colorTextDisabled:x,colorBgContainerDisabled:S,buttonCheckedBgDisabled:j,buttonCheckedColorDisabled:C,colorPrimary:k,colorPrimaryHover:E,colorPrimaryActive:w,buttonSolidCheckedBg:B,buttonSolidCheckedHoverBg:N,buttonSolidCheckedActiveBg:z,calc:I}=e;return{[`${l}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:s,paddingBlock:0,color:t,fontSize:d,lineHeight:(0,v.unit)(I(n).sub(I(o).mul(2)).equal()),background:c,border:`${(0,v.unit)(o)} ${r} ${i}`,borderBlockStartWidth:I(o).add(.02).equal(),borderInlineEndWidth:o,cursor:"pointer",transition:`color ${a},background ${a},box-shadow ${a}`,a:{color:t},[`> ${l}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:I(o).mul(-1).equal()},"&:first-child":{borderInlineStart:`${(0,v.unit)(o)} ${r} ${i}`,borderStartStartRadius:m,borderEndStartRadius:m},"&:last-child":{borderStartEndRadius:m,borderEndEndRadius:m},"&:first-child:last-child":{borderRadius:m},[`${l}-group-large &`]:{height:b,fontSize:u,lineHeight:(0,v.unit)(I(b).sub(I(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h}},[`${l}-group-small &`]:{height:g,paddingInline:I(p).sub(o).equal(),paddingBlock:0,lineHeight:(0,v.unit)(I(g).sub(I(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:f,borderEndStartRadius:f},"&:last-child":{borderStartEndRadius:f,borderEndEndRadius:f}},"&:hover":{position:"relative",color:k},"&:has(:focus-visible)":(0,O.genFocusOutline)(e),[`${l}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${l}-button-wrapper-disabled)`]:{zIndex:1,color:k,background:$,borderColor:k,"&::before":{backgroundColor:k},"&:first-child":{borderColor:k},"&:hover":{color:E,borderColor:E,"&::before":{backgroundColor:E}},"&:active":{color:w,borderColor:w,"&::before":{backgroundColor:w}}},[`${l}-group-solid &-checked:not(${l}-button-wrapper-disabled)`]:{color:y,background:B,borderColor:B,"&:hover":{color:y,background:N,borderColor:N},"&:active":{color:y,background:z,borderColor:z}},"&-disabled":{color:x,backgroundColor:S,borderColor:i,cursor:"not-allowed","&:first-child, &:hover":{color:x,backgroundColor:S,borderColor:i}},[`&-disabled${l}-button-wrapper-checked`]:{color:C,backgroundColor:j,borderColor:i,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}})(o)]},e=>{let{wireframe:t,padding:n,marginXS:l,lineWidth:o,fontSizeLG:r,colorText:i,colorBgContainer:a,colorTextDisabled:s,controlItemBgActiveDisabled:d,colorTextLightSolid:c,colorPrimary:u,colorPrimaryHover:b,colorPrimaryActive:g,colorWhite:p}=e;return{radioSize:r,dotSize:t?r-8:r-(4+o)*2,dotColorDisabled:s,buttonSolidCheckedColor:c,buttonSolidCheckedBg:u,buttonSolidCheckedHoverBg:b,buttonSolidCheckedActiveBg:g,buttonBg:a,buttonCheckedBg:a,buttonColor:i,buttonCheckedBgDisabled:d,buttonCheckedColorDisabled:s,buttonPaddingInline:n-o,wrapperMarginInlineEnd:l,radioColor:t?u:p,radioBgColor:t?a:u}},{unitless:{radioSize:!0,dotSize:!0}});var C=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};let k=t.forwardRef((e,l)=>{var o,r;let s=t.useContext(d),c=t.useContext(u),{getPrefixCls:b,direction:v,radio:O}=t.useContext(i.ConfigContext),x=t.useRef(null),S=(0,p.composeRef)(l,x),{isFormItemInput:k}=t.useContext(y.FormItemInputContext),{prefixCls:E,className:w,rootClassName:B,children:N,style:z,title:I}=e,T=C(e,["prefixCls","className","rootClassName","children","style","title"]),P=b("radio",E),R="button"===((null==s?void 0:s.optionType)||c),L=R?`${P}-button`:P,M=(0,a.default)(P),[H,G,W]=j(P,M),A=Object.assign({},T),D=t.useContext($.default);s&&(A.name=s.name,A.onChange=t=>{var n,l;null==(n=e.onChange)||n.call(e,t),null==(l=null==s?void 0:s.onChange)||l.call(s,t)},A.checked=e.value===s.value,A.disabled=null!=(o=A.disabled)?o:s.disabled),A.disabled=null!=(r=A.disabled)?r:D;let F=(0,n.default)(`${L}-wrapper`,{[`${L}-wrapper-checked`]:A.checked,[`${L}-wrapper-disabled`]:A.disabled,[`${L}-wrapper-rtl`]:"rtl"===v,[`${L}-wrapper-in-form-item`]:k,[`${L}-wrapper-block`]:!!(null==s?void 0:s.block)},null==O?void 0:O.className,w,B,G,W,M),[q,X]=(0,h.default)(A.onClick);return H(t.createElement(m.default,{component:"Radio",disabled:A.disabled},t.createElement("label",{className:F,style:Object.assign(Object.assign({},null==O?void 0:O.style),z),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:I,onClick:q},t.createElement(g.default,Object.assign({},A,{className:(0,n.default)(A.className,{[f.TARGET_CLS]:!R}),type:"radio",prefixCls:L,ref:S,onClick:X})),void 0!==N?t.createElement("span",{className:`${L}-label`},N):null)))});var E=e.i(286039);let w=t.forwardRef((e,d)=>{let{getPrefixCls:u,direction:b}=t.useContext(i.ConfigContext),{name:g}=t.useContext(y.FormItemInputContext),p=(0,l.default)((0,E.toNamePathStr)(g)),{prefixCls:m,className:f,rootClassName:h,options:$,buttonStyle:v="outline",disabled:O,children:x,size:S,style:C,id:w,optionType:B,name:N=p,defaultValue:z,value:I,block:T=!1,onChange:P,onMouseEnter:R,onMouseLeave:L,onFocus:M,onBlur:H}=e,[G,W]=(0,o.default)(z,{value:I}),A=t.useCallback(t=>{let n=t.target.value;"value"in e||W(n),n!==G&&(null==P||P(t))},[G,W,P]),D=u("radio",m),F=`${D}-group`,q=(0,a.default)(D),[X,K,_]=j(D,q),Q=x;$&&$.length>0&&(Q=$.map(e=>"string"==typeof e||"number"==typeof e?t.createElement(k,{key:e.toString(),prefixCls:D,disabled:O,value:e,checked:G===e},e):t.createElement(k,{key:`radio-group-value-options-${e.value}`,prefixCls:D,disabled:e.disabled||O,value:e.value,checked:G===e.value,title:e.title,style:e.style,className:e.className,id:e.id,required:e.required},e.label)));let U=(0,s.default)(S),J=(0,n.default)(F,`${F}-${v}`,{[`${F}-${U}`]:U,[`${F}-rtl`]:"rtl"===b,[`${F}-block`]:T},f,h,K,_,q),V=t.useMemo(()=>({onChange:A,value:G,disabled:O,name:N,optionType:B,block:T}),[A,G,O,N,B,T]);return X(t.createElement("div",Object.assign({},(0,r.default)(e,{aria:!0,data:!0}),{className:J,style:C,onMouseEnter:R,onMouseLeave:L,onFocus:M,onBlur:H,id:w,ref:d}),t.createElement(c,{value:V},Q)))}),B=t.memo(w);var N=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};let z=t.forwardRef((e,n)=>{let{getPrefixCls:l}=t.useContext(i.ConfigContext),{prefixCls:o}=e,r=N(e,["prefixCls"]),a=l("radio",o);return t.createElement(b,{value:"button"},t.createElement(k,Object.assign({prefixCls:a},r,{type:"radio",ref:n})))});k.Button=z,k.Group=B,k.__ANT_RADIO=!0,e.s(["default",0,k],544195)},175712,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),l=e.i(529681),o=e.i(242064),r=e.i(517455),i=e.i(185793),a=e.i(721369),s=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};let d=e=>{var{prefixCls:l,className:r,hoverable:i=!0}=e,a=s(e,["prefixCls","className","hoverable"]);let{getPrefixCls:d}=t.useContext(o.ConfigContext),c=d("card",l),u=(0,n.default)(`${c}-grid`,r,{[`${c}-grid-hoverable`]:i});return t.createElement("div",Object.assign({},a,{className:u}))};e.i(296059);var c=e.i(915654),u=e.i(183293),b=e.i(246422),g=e.i(838378);let p=(0,b.genStyleHooks)("Card",e=>{let t=(0,g.mergeToken)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[(e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:l,colorBorderSecondary:o,boxShadowTertiary:r,bodyPadding:i,extraColor:a}=e;return{[t]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:r},[`${t}-head`]:(e=>{let{antCls:t,componentCls:n,headerHeight:l,headerPadding:o,tabsMarginBottom:r}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:l,marginBottom:-1,padding:`0 ${(0,c.unit)(o)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)} 0 0`},(0,u.clearFix)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},u.textEllipsis),{[`
+ > ${n}-typography,
+ > ${n}-typography-edit-content
+ `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:r,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})})(e),[`${t}-extra`]:{marginInlineStart:"auto",color:a,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:i,borderRadius:`0 0 ${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)}`},[`${t}-grid`]:(e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:l,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:`
+ ${(0,c.unit)(o)} 0 0 0 ${n},
+ 0 ${(0,c.unit)(o)} 0 0 ${n},
+ ${(0,c.unit)(o)} ${(0,c.unit)(o)} 0 0 ${n},
+ ${(0,c.unit)(o)} 0 0 0 ${n} inset,
+ 0 ${(0,c.unit)(o)} 0 0 ${n} inset;
+ `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:l}}})(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:(e=>{let{componentCls:t,iconCls:n,actionsLiMargin:l,cardActionsIconSize:o,colorBorderSecondary:r,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${r}`,display:"flex",borderRadius:`0 0 ${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)}`},(0,u.clearFix)()),{"& > li":{margin:l,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,c.unit)(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:o,lineHeight:(0,c.unit)(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${r}`}}})})(e),[`${t}-meta`]:Object.assign(Object.assign({margin:`${(0,c.unit)(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,u.clearFix)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},u.textEllipsis),"&-description":{color:e.colorTextDescription}})}),[`${t}-bordered`]:{border:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${o}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:l}}},[`${t}-type-inner`]:(e=>{let{componentCls:t,colorFillAlter:n,headerPadding:l,bodyPadding:o}=e;return{[`${t}-head`]:{padding:`0 ${(0,c.unit)(l)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${(0,c.unit)(e.padding)} ${(0,c.unit)(o)}`}}})(e),[`${t}-loading`]:(e=>{let{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}})(e),[`${t}-rtl`]:{direction:"rtl"}}})(t),(e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:l,headerHeightSM:o,headerFontSizeSM:r}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:o,padding:`0 ${(0,c.unit)(l)}`,fontSize:r,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}})(t)]},e=>{var t,n;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!=(t=e.bodyPadding)?t:e.paddingLG,headerPadding:null!=(n=e.headerPadding)?n:e.paddingLG}});var m=e.i(792812),f=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};let h=e=>{let{actionClasses:n,actions:l=[],actionStyle:o}=e;return t.createElement("ul",{className:n,style:o},l.map((e,n)=>{let o=`action-${n}`;return t.createElement("li",{style:{width:`${100/l.length}%`},key:o},t.createElement("span",null,e))}))},$=t.forwardRef((e,s)=>{let c,{prefixCls:u,className:b,rootClassName:g,style:$,extra:y,headStyle:v={},bodyStyle:O={},title:x,loading:S,bordered:j,variant:C,size:k,type:E,cover:w,actions:B,tabList:N,children:z,activeTabKey:I,defaultActiveTabKey:T,tabBarExtraContent:P,hoverable:R,tabProps:L={},classNames:M,styles:H}=e,G=f(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:W,direction:A,card:D}=t.useContext(o.ConfigContext),[F]=(0,m.default)("card",C,j),q=e=>{var t;return(0,n.default)(null==(t=null==D?void 0:D.classNames)?void 0:t[e],null==M?void 0:M[e])},X=e=>{var t;return Object.assign(Object.assign({},null==(t=null==D?void 0:D.styles)?void 0:t[e]),null==H?void 0:H[e])},K=t.useMemo(()=>{let e=!1;return t.Children.forEach(z,t=>{(null==t?void 0:t.type)===d&&(e=!0)}),e},[z]),_=W("card",u),[Q,U,J]=p(_),V=t.createElement(i.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},z),Y=void 0!==I,Z=Object.assign(Object.assign({},L),{[Y?"activeKey":"defaultActiveKey"]:Y?I:T,tabBarExtraContent:P}),ee=(0,r.default)(k),et=ee&&"default"!==ee?ee:"large",en=N?t.createElement(a.default,Object.assign({size:et},Z,{className:`${_}-head-tabs`,onChange:t=>{var n;null==(n=e.onTabChange)||n.call(e,t)},items:N.map(e=>{var{tab:t}=e;return Object.assign({label:t},f(e,["tab"]))})})):null;if(x||y||en){let e=(0,n.default)(`${_}-head`,q("header")),l=(0,n.default)(`${_}-head-title`,q("title")),o=(0,n.default)(`${_}-extra`,q("extra")),r=Object.assign(Object.assign({},v),X("header"));c=t.createElement("div",{className:e,style:r},t.createElement("div",{className:`${_}-head-wrapper`},x&&t.createElement("div",{className:l,style:X("title")},x),y&&t.createElement("div",{className:o,style:X("extra")},y)),en)}let el=(0,n.default)(`${_}-cover`,q("cover")),eo=w?t.createElement("div",{className:el,style:X("cover")},w):null,er=(0,n.default)(`${_}-body`,q("body")),ei=Object.assign(Object.assign({},O),X("body")),ea=t.createElement("div",{className:er,style:ei},S?V:z),es=(0,n.default)(`${_}-actions`,q("actions")),ed=(null==B?void 0:B.length)?t.createElement(h,{actionClasses:es,actionStyle:X("actions"),actions:B}):null,ec=(0,l.default)(G,["onTabChange"]),eu=(0,n.default)(_,null==D?void 0:D.className,{[`${_}-loading`]:S,[`${_}-bordered`]:"borderless"!==F,[`${_}-hoverable`]:R,[`${_}-contain-grid`]:K,[`${_}-contain-tabs`]:null==N?void 0:N.length,[`${_}-${ee}`]:ee,[`${_}-type-${E}`]:!!E,[`${_}-rtl`]:"rtl"===A},b,g,U,J),eb=Object.assign(Object.assign({},null==D?void 0:D.style),$);return Q(t.createElement("div",Object.assign({ref:s},ec,{className:eu,style:eb}),c,eo,ea,ed))});var y=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};$.Grid=d,$.Meta=e=>{let{prefixCls:l,className:r,avatar:i,title:a,description:s}=e,d=y(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:c}=t.useContext(o.ConfigContext),u=c("card",l),b=(0,n.default)(`${u}-meta`,r),g=i?t.createElement("div",{className:`${u}-meta-avatar`},i):null,p=a?t.createElement("div",{className:`${u}-meta-title`},a):null,m=s?t.createElement("div",{className:`${u}-meta-description`},s):null,f=p||m?t.createElement("div",{className:`${u}-meta-detail`},p,m):null;return t.createElement("div",Object.assign({},d,{className:b}),g,f)},e.s(["Card",0,$],175712)},869216,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),l=e.i(908206),o=e.i(242064),r=e.i(517455),i=e.i(150073);let a={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},s=t.default.createContext({});var d=e.i(876556),c=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n},u=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};let b=e=>{let{itemPrefixCls:l,component:o,span:r,className:i,style:a,labelStyle:d,contentStyle:c,bordered:u,label:b,content:g,colon:p,type:m,styles:f}=e,{classNames:h}=t.useContext(s),$=Object.assign(Object.assign({},d),null==f?void 0:f.label),y=Object.assign(Object.assign({},c),null==f?void 0:f.content);if(u)return t.createElement(o,{colSpan:r,style:a,className:(0,n.default)(i,{[`${l}-item-${m}`]:"label"===m||"content"===m,[null==h?void 0:h.label]:(null==h?void 0:h.label)&&"label"===m,[null==h?void 0:h.content]:(null==h?void 0:h.content)&&"content"===m})},null!=b&&t.createElement("span",{style:$},b),null!=g&&t.createElement("span",{style:y},g));return t.createElement(o,{colSpan:r,style:a,className:(0,n.default)(`${l}-item`,i)},t.createElement("div",{className:`${l}-item-container`},null!=b&&t.createElement("span",{style:$,className:(0,n.default)(`${l}-item-label`,null==h?void 0:h.label,{[`${l}-item-no-colon`]:!p})},b),null!=g&&t.createElement("span",{style:y,className:(0,n.default)(`${l}-item-content`,null==h?void 0:h.content)},g)))};function g(e,{colon:n,prefixCls:l,bordered:o},{component:r,type:i,showLabel:a,showContent:s,labelStyle:d,contentStyle:c,styles:u}){return e.map(({label:e,children:g,prefixCls:p=l,className:m,style:f,labelStyle:h,contentStyle:$,span:y=1,key:v,styles:O},x)=>"string"==typeof r?t.createElement(b,{key:`${i}-${v||x}`,className:m,style:f,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},d),null==u?void 0:u.label),h),null==O?void 0:O.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},c),null==u?void 0:u.content),$),null==O?void 0:O.content)},span:y,colon:n,component:r,itemPrefixCls:p,bordered:o,label:a?e:null,content:s?g:null,type:i}):[t.createElement(b,{key:`label-${v||x}`,className:m,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),null==u?void 0:u.label),f),h),null==O?void 0:O.label),span:1,colon:n,component:r[0],itemPrefixCls:p,bordered:o,label:e,type:"label"}),t.createElement(b,{key:`content-${v||x}`,className:m,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),null==u?void 0:u.content),f),$),null==O?void 0:O.content),span:2*y-1,component:r[1],itemPrefixCls:p,bordered:o,content:g,type:"content"})])}let p=e=>{let n=t.useContext(s),{prefixCls:l,vertical:o,row:r,index:i,bordered:a}=e;return o?t.createElement(t.Fragment,null,t.createElement("tr",{key:`label-${i}`,className:`${l}-row`},g(r,e,Object.assign({component:"th",type:"label",showLabel:!0},n))),t.createElement("tr",{key:`content-${i}`,className:`${l}-row`},g(r,e,Object.assign({component:"td",type:"content",showContent:!0},n)))):t.createElement("tr",{key:i,className:`${l}-row`},g(r,e,Object.assign({component:a?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},n)))};e.i(296059);var m=e.i(915654),f=e.i(183293),h=e.i(246422),$=e.i(838378);let y=(0,h.genStyleHooks)("Descriptions",e=>(e=>{let{componentCls:t,extraColor:n,itemPaddingBottom:l,itemPaddingEnd:o,colonMarginRight:r,colonMarginLeft:i,titleMarginBottom:a}=e;return{[t]:Object.assign(Object.assign(Object.assign({},(0,f.resetComponent)(e)),(e=>{let{componentCls:t,labelBg:n}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${(0,m.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${(0,m.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,m.unit)(e.padding)} ${(0,m.unit)(e.paddingLG)}`,borderInlineEnd:`${(0,m.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:n,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,m.unit)(e.paddingSM)} ${(0,m.unit)(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,m.unit)(e.paddingXS)} ${(0,m.unit)(e.padding)}`}}}}}})(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:a},[`${t}-title`]:Object.assign(Object.assign({},f.textEllipsis),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:n,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:l,paddingInlineEnd:o},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${(0,m.unit)(i)} ${(0,m.unit)(r)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}})((0,$.mergeToken)(e,{})),e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}));var v=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);ot.indexOf(l[o])&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]]);return n};let O=e=>{let b,{prefixCls:g,title:m,extra:f,column:h,colon:$=!0,bordered:O,layout:x,children:S,className:j,rootClassName:C,style:k,size:E,labelStyle:w,contentStyle:B,styles:N,items:z,classNames:I}=e,T=v(e,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:P,direction:R,className:L,style:M,classNames:H,styles:G}=(0,o.useComponentConfig)("descriptions"),W=P("descriptions",g),A=(0,i.default)(),D=t.useMemo(()=>{var e;return"number"==typeof h?h:null!=(e=(0,l.matchScreen)(A,Object.assign(Object.assign({},a),h)))?e:3},[A,h]),F=(b=t.useMemo(()=>z||(0,d.default)(S).map(e=>Object.assign(Object.assign({},null==e?void 0:e.props),{key:e.key})),[z,S]),t.useMemo(()=>b.map(e=>{var{span:t}=e,n=c(e,["span"]);return"filled"===t?Object.assign(Object.assign({},n),{filled:!0}):Object.assign(Object.assign({},n),{span:"number"==typeof t?t:(0,l.matchScreen)(A,t)})}),[b,A])),q=(0,r.default)(E),X=((e,n)=>{let[l,o]=(0,t.useMemo)(()=>{let t,l,o,r;return t=[],l=[],o=!1,r=0,n.filter(e=>e).forEach(n=>{let{filled:i}=n,a=u(n,["filled"]);if(i){l.push(a),t.push(l),l=[],r=0;return}let s=e-r;(r+=n.span||1)>=e?(r>e?(o=!0,l.push(Object.assign(Object.assign({},a),{span:s}))):l.push(a),t.push(l),l=[],r=0):l.push(a)}),l.length>0&&t.push(l),[t=t.map(t=>{let n=t.reduce((e,t)=>e+(t.span||1),0);if(n({labelStyle:w,contentStyle:B,styles:{content:Object.assign(Object.assign({},G.content),null==N?void 0:N.content),label:Object.assign(Object.assign({},G.label),null==N?void 0:N.label)},classNames:{label:(0,n.default)(H.label,null==I?void 0:I.label),content:(0,n.default)(H.content,null==I?void 0:I.content)}}),[w,B,N,I,H,G]);return K(t.createElement(s.Provider,{value:U},t.createElement("div",Object.assign({className:(0,n.default)(W,L,H.root,null==I?void 0:I.root,{[`${W}-${q}`]:q&&"default"!==q,[`${W}-bordered`]:!!O,[`${W}-rtl`]:"rtl"===R},j,C,_,Q),style:Object.assign(Object.assign(Object.assign(Object.assign({},M),G.root),null==N?void 0:N.root),k)},T),(m||f)&&t.createElement("div",{className:(0,n.default)(`${W}-header`,H.header,null==I?void 0:I.header),style:Object.assign(Object.assign({},G.header),null==N?void 0:N.header)},m&&t.createElement("div",{className:(0,n.default)(`${W}-title`,H.title,null==I?void 0:I.title),style:Object.assign(Object.assign({},G.title),null==N?void 0:N.title)},m),f&&t.createElement("div",{className:(0,n.default)(`${W}-extra`,H.extra,null==I?void 0:I.extra),style:Object.assign(Object.assign({},G.extra),null==N?void 0:N.extra)},f)),t.createElement("div",{className:`${W}-view`},t.createElement("table",null,t.createElement("tbody",null,X.map((e,n)=>t.createElement(p,{key:n,index:n,colon:$,prefixCls:W,vertical:"vertical"===x,bordered:O,row:e}))))))))};O.Item=({children:e})=>e,e.s(["Descriptions",0,O],869216)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2d8285e144d4452a.js b/litellm/proxy/_experimental/out/_next/static/chunks/2d8285e144d4452a.js
new file mode 100644
index 0000000000..09cbef49ea
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/2d8285e144d4452a.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var a=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(a.default,(0,t.default)({},e,{ref:l,icon:s}))});e.s(["ArrowLeftOutlined",0,l],447566)},536916,e=>{"use strict";var t=e.i(374276);e.s(["Checkbox",()=>t.default])},599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),s=e.i(673706),a=e.i(271645);let l=a.default.forwardRef((e,l)=>{let{color:n,className:i,children:o}=e;return a.default.createElement("p",{ref:l,className:(0,r.tremorTwMerge)("text-tremor-default",n?(0,s.getColorClassNames)(n,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),i)},o)});l.displayName="Text",e.s(["default",()=>l],936325),e.s(["Text",()=>l],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),s=e.i(480731),a=e.i(95779),l=e.i(444755),n=e.i(673706);let i=(0,n.makeClassName)("Card"),o=r.default.forwardRef((e,o)=>{let{decoration:c="",decorationColor:d,children:u,className:m}=e,p=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:o,className:(0,l.tremorTwMerge)(i("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",d?(0,n.getColorClassNames)(d,a.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case s.HorizontalPositions.Left:return"border-l-4";case s.VerticalPositions.Top:return"border-t-4";case s.HorizontalPositions.Right:return"border-r-4";case s.VerticalPositions.Bottom:return"border-b-4";default:return""}})(c),m)},p),u)});o.displayName="Card",e.s(["Card",()=>o],304967)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),s=e.i(444755),a=e.i(673706),l=e.i(271645);let n=l.default.forwardRef((e,n)=>{let{color:i,children:o,className:c}=e,d=(0,t.__rest)(e,["color","children","className"]);return l.default.createElement("p",Object.assign({ref:n,className:(0,s.tremorTwMerge)("font-medium text-tremor-title",i?(0,a.getColorClassNames)(i,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},d),o)});n.displayName="Title",e.s(["Title",()=>n],629569)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},292639,e=>{"use strict";var t=e.i(764205),r=e.i(266027);let s=(0,e.i(243652).createQueryKeys)("uiSettings");e.s(["useUISettings",0,()=>(0,r.useQuery)({queryKey:s.list({}),queryFn:async()=>await (0,t.getUiSettings)(),staleTime:36e5,gcTime:36e5})])},250980,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["PlusCircleIcon",0,r],250980)},502547,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});e.s(["ChevronRightIcon",0,r],502547)},214541,e=>{"use strict";var t=e.i(271645),r=e.i(135214),s=e.i(270345);e.s(["default",0,()=>{let[e,a]=(0,t.useState)([]),{accessToken:l,userId:n,userRole:i}=(0,r.default)();return(0,t.useEffect)(()=>{(async()=>{a(await (0,s.fetchTeams)(l,n,i,null))})()},[l,n,i]),{teams:e,setTeams:a}}])},211576,e=>{"use strict";var t=e.i(131757);e.s(["Col",()=>t.default])},530212,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.s(["ArrowLeftIcon",0,r],530212)},646563,e=>{"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},178654,621192,e=>{"use strict";let t=e.i(211576).Col;e.s(["Col",0,t],178654);let r=e.i(264042).Row;e.s(["Row",0,r],621192)},637235,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var a=e.i(9583),l=r.forwardRef(function(e,l){return r.createElement(a.default,(0,t.default)({},e,{ref:l,icon:s}))});e.s(["ClockCircleOutlined",0,l],637235)},891547,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:l,className:n,accessToken:i,disabled:o})=>{let[c,d]=(0,r.useState)([]),[u,m]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(i){m(!0);try{let e=await (0,a.getGuardrailsList)(i);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),d(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{m(!1)}}})()},[i]),(0,t.jsx)("div",{children:(0,t.jsx)(s.Select,{mode:"multiple",disabled:o,placeholder:o?"Setting guardrails is a premium feature.":"Select guardrails",onChange:t=>{console.log("Selected guardrails:",t),e(t)},value:l,loading:u,className:n,allowClear:!0,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:`${e.guardrail_name}`,value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}])},921511,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(199133),a=e.i(764205);function l(e){return e.filter(e=>(e.version_status??"draft")!=="draft").map(e=>{var t;let r=e.version_number??1,s=e.version_status??"draft";return{label:`${e.policy_name} — v${r} (${s})${e.description?` — ${e.description}`:""}`,value:"production"===s?e.policy_name:e.policy_id?(t=e.policy_id,`policy_${t}`):e.policy_name}})}e.s(["default",0,({onChange:e,value:n,className:i,accessToken:o,disabled:c,onPoliciesLoaded:d})=>{let[u,m]=(0,r.useState)([]),[p,g]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){g(!0);try{let e=await (0,a.getPoliciesList)(o);e.policies&&(m(e.policies),d?.(e.policies))}catch(e){console.error("Error fetching policies:",e)}finally{g(!1)}}})()},[o,d]),(0,t.jsx)("div",{children:(0,t.jsx)(s.Select,{mode:"multiple",disabled:c,placeholder:c?"Setting policies is a premium feature.":"Select policies (production or published versions)",onChange:t=>{e(t)},value:n,loading:p,className:i,allowClear:!0,options:l(u),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},"getPolicyOptionEntries",()=>l])},525720,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),s=e.i(529681),a=e.i(908286),l=e.i(242064),n=e.i(246422),i=e.i(838378);let o=["wrap","nowrap","wrap-reverse"],c=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],d=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],u=function(e,t){let s,a,l;return(0,r.default)(Object.assign(Object.assign(Object.assign({},(s=!0===t.wrap?"wrap":t.wrap,{[`${e}-wrap-${s}`]:s&&o.includes(s)})),(a={},d.forEach(r=>{a[`${e}-align-${r}`]=t.align===r}),a[`${e}-align-stretch`]=!t.align&&!!t.vertical,a)),(l={},c.forEach(r=>{l[`${e}-justify-${r}`]=t.justify===r}),l)))},m=(0,n.genStyleHooks)("Flex",e=>{let{paddingXS:t,padding:r,paddingLG:s}=e,a=(0,i.mergeToken)(e,{flexGapSM:t,flexGap:r,flexGapLG:s});return[(e=>{let{componentCls:t}=e;return{[t]:{display:"flex",margin:0,padding:0,"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}})(a),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}})(a),(e=>{let{componentCls:t}=e,r={};return o.forEach(e=>{r[`${t}-wrap-${e}`]={flexWrap:e}}),r})(a),(e=>{let{componentCls:t}=e,r={};return d.forEach(e=>{r[`${t}-align-${e}`]={alignItems:e}}),r})(a),(e=>{let{componentCls:t}=e,r={};return c.forEach(e=>{r[`${t}-justify-${e}`]={justifyContent:e}}),r})(a)]},()=>({}),{resetStyle:!1});var p=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,s=Object.getOwnPropertySymbols(e);at.indexOf(s[a])&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r};let g=t.default.forwardRef((e,n)=>{let{prefixCls:i,rootClassName:o,className:c,style:d,flex:g,gap:x,vertical:f=!1,component:h="div",children:v}=e,b=p(e,["prefixCls","rootClassName","className","style","flex","gap","vertical","component","children"]),{flex:y,direction:w,getPrefixCls:j}=t.default.useContext(l.ConfigContext),N=j("flex",i),[k,C,_]=m(N),S=null!=f?f:null==y?void 0:y.vertical,T=(0,r.default)(c,o,null==y?void 0:y.className,N,C,_,u(N,e),{[`${N}-rtl`]:"rtl"===w,[`${N}-gap-${x}`]:(0,a.isPresetSize)(x),[`${N}-vertical`]:S}),$=Object.assign(Object.assign({},null==y?void 0:y.style),d);return g&&($.flex=g),x&&!(0,a.isPresetSize)(x)&&($.gap=x),k(t.default.createElement(h,Object.assign({ref:n,className:T,style:$},(0,s.default)(b,["justify","wrap","align"])),v))});e.s(["Flex",0,g],525720)},439189,435684,96226,497245,e=>{"use strict";function t(e){let t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):new Date("number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?e:NaN)}function r(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function s(e,s){let a=t(e);return isNaN(s)?r(e,NaN):(s&&a.setDate(a.getDate()+s),a)}function a(e,s){let a=t(e);if(isNaN(s))return r(e,NaN);if(!s)return a;let l=a.getDate(),n=r(e,a.getTime());return(n.setMonth(a.getMonth()+s+1,0),l>=n.getDate())?n:(a.setFullYear(n.getFullYear(),n.getMonth(),l),a)}e.s(["toDate",()=>t],435684),e.s(["constructFrom",()=>r],96226),e.s(["addDays",()=>s],439189),e.s(["addMonths",()=>a],497245)},384767,e=>{"use strict";var t=e.i(843476),r=e.i(599724),s=e.i(271645),a=e.i(389083);let l=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});var n=e.i(764205);let i=function({vectorStores:e,accessToken:i}){let[o,c]=(0,s.useState)([]);return(0,s.useEffect)(()=>{(async()=>{if(i&&0!==e.length)try{let e=await (0,n.vectorStoreListCall)(i);e.data&&c(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[i,e.length]),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,t.jsx)(a.Badge,{color:"blue",size:"xs",children:e.length})]}),e.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((e,r)=>{let s;return(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:(s=o.find(t=>t.vector_store_id===e))?`${s.vector_store_name||s.vector_store_id} (${s.vector_store_id})`:e},r)})}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(l,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(r.Text,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},o=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});var c=e.i(871943),d=e.i(502547),u=e.i(592968);let m=function({mcpServers:e,mcpAccessGroups:l=[],mcpToolPermissions:i={},mcpToolsets:m=[],accessToken:p}){let[g,x]=(0,s.useState)([]),[f,h]=(0,s.useState)([]),[v,b]=(0,s.useState)(new Set),[y,w]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{(async()=>{if(p&&e.length>0)try{let e=await (0,n.fetchMCPServers)(p);e&&Array.isArray(e)?x(e):e.data&&Array.isArray(e.data)&&x(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[p,e.length]),(0,s.useEffect)(()=>{(async()=>{if(p&&m.length>0)try{let e=await (0,n.fetchMCPToolsets)(p),t=Array.isArray(e)?e.filter(e=>m.includes(e.toolset_id)):[];h(t)}catch(e){console.error("Error fetching toolsets:",e)}})()},[p,m.length]);let j=[...e.map(e=>({type:"server",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],N=j.length+m.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,t.jsx)(a.Badge,{color:"blue",size:"xs",children:N})]}),N>0?(0,t.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:[j.map((e,r)=>{let s="server"===e.type?i[e.value]:void 0,a=s&&s.length>0,l=v.has(e.value);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>{var t;return a&&(t=e.value,void b(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}))},className:`flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ${a?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,t.jsx)(u.Tooltip,{title:`Full ID: ${e.value}`,placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:(e=>{let t=g.find(t=>t.server_id===e);if(t){let r=e.length>7?`${e.slice(0,3)}...${e.slice(-4)}`:e;return`${t.alias} (${r})`}return e})(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),a&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:s.length}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===s.length?"tool":"tools"}),l?(0,t.jsx)(c.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(d.ChevronRightIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),a&&l&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.map((e,r)=>(0,t.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},r))})})]},r)}),m.length>0&&m.map((e,r)=>{let s=f.find(t=>t.toolset_id===e),a=y.has(e),l=s?.tools.length??0;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>l>0&&void w(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),className:`flex items-center gap-3 py-2 px-3 rounded-lg border border-purple-200 transition-all ${l>0?"cursor-pointer hover:bg-purple-50 hover:border-purple-300":"bg-white"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:s?.toolset_name??e}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-purple-600 bg-purple-50 border border-purple-200 rounded uppercase tracking-wide flex-shrink-0",children:"Toolset"})]}),l>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:l}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===l?"tool":"tools"}),a?(0,t.jsx)(c.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(d.ChevronRightIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l>0&&a&&s&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-purple-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.tools.map((e,r)=>(0,t.jsxs)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-xs font-medium",children:[(0,t.jsxs)("span",{className:"text-purple-400 mr-1 text-[10px]",children:[e.server_id.slice(0,6),"…"]}),e.tool_name]},r))})})]},`toolset-${r}`)})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(o,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(r.Text,{className:"text-gray-500 text-sm",children:"No MCP servers, access groups, or toolsets configured"})]})]})},p=s.forwardRef(function(e,t){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))}),g=function({agents:e,agentAccessGroups:l=[],accessToken:i}){let[o,c]=(0,s.useState)([]);(0,s.useEffect)(()=>{(async()=>{if(i&&e.length>0)try{let e=await (0,n.getAgentsList)(i);e&&e.agents&&Array.isArray(e.agents)&&c(e.agents)}catch(e){console.error("Error fetching agents:",e)}})()},[i,e.length]);let d=[...e.map(e=>({type:"agent",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],m=d.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p,{className:"h-4 w-4 text-purple-600"}),(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"Agents"}),(0,t.jsx)(a.Badge,{color:"purple",size:"xs",children:m})]}),m>0?(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:d.map((e,r)=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)("div",{className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"agent"===e.type?(0,t.jsx)(u.Tooltip,{title:`Full ID: ${e.value}`,placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:(e=>{let t=o.find(t=>t.agent_id===e);if(t){let r=e.length>7?`${e.slice(0,3)}...${e.slice(-4)}`:e;return`${t.agent_name} (${r})`}return e})(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})})})},r))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(p,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(r.Text,{className:"text-gray-500 text-sm",children:"No agents or access groups configured"})]})]})};e.s(["default",0,function({objectPermission:e,variant:s="card",className:a="",accessToken:l}){let n=e?.vector_stores||[],o=e?.mcp_servers||[],c=e?.mcp_access_groups||[],d=e?.mcp_tool_permissions||{},u=e?.mcp_toolsets||[],p=e?.agents||[],x=e?.agent_access_groups||[],f=e?.search_tools||[],h=(0,t.jsxs)("div",{className:"card"===s?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6":"space-y-4",children:[(0,t.jsx)(i,{vectorStores:n,accessToken:l}),(0,t.jsx)(m,{mcpServers:o,mcpAccessGroups:c,mcpToolPermissions:d,mcpToolsets:u,accessToken:l}),(0,t.jsx)(g,{agents:p,agentAccessGroups:x,accessToken:l}),(0,t.jsxs)("div",{className:"rounded-md border border-gray-100 p-4",children:[(0,t.jsx)(r.Text,{className:"text-sm font-medium text-gray-800",children:"Search tools"}),0===f.length?(0,t.jsx)(r.Text,{className:"mt-1 block text-xs text-gray-500",children:"No restriction — all configured search tools are allowed for this team."}):(0,t.jsx)(r.Text,{className:"mt-1 block text-xs text-gray-700",children:f.join(", ")})]})]});return"card"===s?(0,t.jsxs)("div",{className:`bg-white border border-gray-200 rounded-lg p-6 ${a}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(r.Text,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,t.jsx)(r.Text,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),h]}):(0,t.jsxs)("div",{className:`${a}`,children:[(0,t.jsx)(r.Text,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),h]})}],384767)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2ea722d0a9ce35c8.js b/litellm/proxy/_experimental/out/_next/static/chunks/2ea722d0a9ce35c8.js
new file mode 100644
index 0000000000..80dfce818e
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/2ea722d0a9ce35c8.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68155,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});e.s(["TrashIcon",0,r],68155)},360820,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});e.s(["ChevronUpIcon",0,r],360820)},871943,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});e.s(["ChevronDownIcon",0,r],871943)},94629,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});e.s(["SwitchVerticalIcon",0,r],94629)},916925,e=>{"use strict";var t,r=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t.ZAI="Z.AI (Zhipu AI)",t);let n={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference",ZAI:"zai"},o="../ui/assets/logos/",a={"A2A Agent":`${o}a2a_agent.png`,Ai21:`${o}ai21.svg`,"Ai21 Chat":`${o}ai21.svg`,"AI/ML API":`${o}aiml_api.svg`,"Aiohttp Openai":`${o}openai_small.svg`,Anthropic:`${o}anthropic.svg`,"Anthropic Text":`${o}anthropic.svg`,AssemblyAI:`${o}assemblyai_small.png`,Azure:`${o}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${o}microsoft_azure.svg`,"Azure Text":`${o}microsoft_azure.svg`,Baseten:`${o}baseten.svg`,"Amazon Bedrock":`${o}bedrock.svg`,"Amazon Bedrock Mantle":`${o}bedrock.svg`,"AWS SageMaker":`${o}bedrock.svg`,Cerebras:`${o}cerebras.svg`,Cloudflare:`${o}cloudflare.svg`,Codestral:`${o}mistral.svg`,Cohere:`${o}cohere.svg`,"Cohere Chat":`${o}cohere.svg`,Cometapi:`${o}cometapi.svg`,Cursor:`${o}cursor.svg`,"Databricks (Qwen API)":`${o}databricks.svg`,Dashscope:`${o}dashscope.svg`,Deepseek:`${o}deepseek.svg`,Deepgram:`${o}deepgram.png`,DeepInfra:`${o}deepinfra.png`,ElevenLabs:`${o}elevenlabs.png`,"Fal AI":`${o}fal_ai.jpg`,"Featherless Ai":`${o}featherless.svg`,"Fireworks AI":`${o}fireworks.svg`,Friendliai:`${o}friendli.svg`,"Github Copilot":`${o}github_copilot.svg`,"Google AI Studio":`${o}google.svg`,GradientAI:`${o}gradientai.svg`,Groq:`${o}groq.svg`,vllm:`${o}vllm.png`,Huggingface:`${o}huggingface.svg`,Hyperbolic:`${o}hyperbolic.svg`,Infinity:`${o}infinity.png`,"Jina AI":`${o}jina.png`,"Lambda Ai":`${o}lambda.svg`,"Lm Studio":`${o}lmstudio.svg`,"Meta Llama":`${o}meta_llama.svg`,MiniMax:`${o}minimax.svg`,"Mistral AI":`${o}mistral.svg`,Moonshot:`${o}moonshot.svg`,Morph:`${o}morph.svg`,Nebius:`${o}nebius.svg`,Novita:`${o}novita.svg`,"Nvidia Nim":`${o}nvidia_nim.svg`,Ollama:`${o}ollama.svg`,"Ollama Chat":`${o}ollama.svg`,Oobabooga:`${o}openai_small.svg`,OpenAI:`${o}openai_small.svg`,"Openai Like":`${o}openai_small.svg`,"OpenAI Text Completion":`${o}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${o}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${o}openai_small.svg`,Openrouter:`${o}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${o}oracle.svg`,Perplexity:`${o}perplexity-ai.svg`,Recraft:`${o}recraft.svg`,Replicate:`${o}replicate.svg`,RunwayML:`${o}runwayml.png`,Sagemaker:`${o}bedrock.svg`,Sambanova:`${o}sambanova.svg`,"SAP Generative AI Hub":`${o}sap.png`,Snowflake:`${o}snowflake.svg`,"Text-Completion-Codestral":`${o}mistral.svg`,TogetherAI:`${o}togetherai.svg`,Topaz:`${o}topaz.svg`,Triton:`${o}nvidia_triton.png`,V0:`${o}v0.svg`,"Vercel Ai Gateway":`${o}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${o}google.svg`,"Vertex Ai Beta":`${o}google.svg`,Vllm:`${o}vllm.png`,VolcEngine:`${o}volcengine.png`,"Voyage AI":`${o}voyage.webp`,Watsonx:`${o}watsonx.svg`,"Watsonx Text":`${o}watsonx.svg`,xAI:`${o}xai.svg`,Xinference:`${o}xinference.svg`};e.s(["Providers",()=>r,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else if("Z.AI (Zhipu AI)"===e)return"zai/glm-4.5";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:a[e],displayName:e}}let t=Object.keys(n).find(t=>n[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let o=r[t];return{logo:a[o],displayName:o}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let r=n[e];console.log(`Provider mapped to: ${r}`);let o=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let n=t.litellm_provider;(n===r||"string"==typeof n&&n.includes(r))&&o.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&o.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&o.push(e)}))),o},"providerLogoMap",0,a,"provider_map",0,n])},798496,e=>{"use strict";var t=e.i(843476),r=e.i(152990),n=e.i(682830),o=e.i(271645),a=e.i(269200),i=e.i(427612),l=e.i(64848),s=e.i(942232),c=e.i(496020),u=e.i(977572),d=e.i(94629),m=e.i(360820),p=e.i(871943);function h({data:e=[],columns:h,isLoading:f=!1,defaultSorting:g=[],pagination:v,onPaginationChange:b,enablePagination:y=!1,onRowClick:x}){let[C,w]=o.default.useState(g),[A]=o.default.useState("onChange"),[S,E]=o.default.useState({}),[O,_]=o.default.useState({}),T=(0,r.useReactTable)({data:e,columns:h,state:{sorting:C,columnSizing:S,columnVisibility:O,...y&&v?{pagination:v}:{}},columnResizeMode:A,onSortingChange:w,onColumnSizingChange:E,onColumnVisibilityChange:_,...y&&b?{onPaginationChange:b}:{},getCoreRowModel:(0,n.getCoreRowModel)(),getSortedRowModel:(0,n.getSortedRowModel)(),...y?{getPaginationRowModel:(0,n.getPaginationRowModel)()}:{},enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("div",{className:"relative min-w-full",children:(0,t.jsxs)(a.Table,{className:"[&_td]:py-2 [&_th]:py-2",style:{width:T.getTotalSize(),minWidth:"100%",tableLayout:"fixed"},children:[(0,t.jsx)(i.TableHead,{children:T.getHeaderGroups().map(e=>(0,t.jsx)(c.TableRow,{children:e.headers.map(e=>(0,t.jsxs)(l.TableHeaderCell,{className:`py-1 h-8 relative ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,r.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(m.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(p.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(d.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,t.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 ${e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200"}`})]},e.id))},e.id))}),(0,t.jsx)(s.TableBody,{children:f?(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(u.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading models..."})})})}):T.getRowModel().rows.length>0?T.getRowModel().rows.map(e=>(0,t.jsx)(c.TableRow,{onClick:()=>x?.(e.original),className:x?"cursor-pointer hover:bg-gray-50":"",children:e.getVisibleCells().map(e=>(0,t.jsx)(u.TableCell,{className:`py-0.5 overflow-hidden ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,r.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(u.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No models found"})})})})})]})})})})}e.s(["ModelDataTable",()=>h])},829672,836938,310730,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(914949),o=e.i(404948);let a=e=>e?"function"==typeof e?e():e:null;e.s(["getRenderPropValue",0,a],836938);var i=e.i(613541),l=e.i(763731),s=e.i(242064),c=e.i(491816);e.i(793154);var u=e.i(880476),d=e.i(183293),m=e.i(717356),p=e.i(320560),h=e.i(307358),f=e.i(246422),g=e.i(838378),v=e.i(617933);let b=(0,f.genStyleHooks)("Popover",e=>{let{colorBgElevated:t,colorText:r}=e,n=(0,g.mergeToken)(e,{popoverBg:t,popoverColor:r});return[(e=>{let{componentCls:t,popoverColor:r,titleMinWidth:n,fontWeightStrong:o,innerPadding:a,boxShadowSecondary:i,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:m,popoverBg:h,titleBorderBottom:f,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,d.resetComponent)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":m,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:i,padding:a},[`${t}-title`]:{minWidth:n,marginBottom:u,color:l,fontWeight:o,borderBottom:f,padding:v},[`${t}-inner-content`]:{color:r,padding:g}})},(0,p.default)(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]})(n),(e=>{let{componentCls:t}=e;return{[t]:v.PresetColors.map(r=>{let n=e[`${r}6`];return{[`&${t}-${r}`]:{"--antd-arrow-background-color":n,[`${t}-inner`]:{backgroundColor:n},[`${t}-arrow`]:{background:"transparent"}}}})}})(n),(0,m.initZoomMotion)(n,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:r,fontHeight:n,padding:o,wireframe:a,zIndexPopupBase:i,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=e,m=r-n;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:i+30},(0,h.getArrowToken)(e)),(0,p.getArrowOffsetToken)({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:12*!a,titleMarginBottom:a?0:s,titlePadding:a?`${m/2}px ${o}px ${m/2-t}px`:0,titleBorderBottom:a?`${t}px ${c} ${u}`:"none",innerContentPadding:a?`${d}px ${o}px`:0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let x=({title:e,content:r,prefixCls:n})=>e||r?t.createElement(t.Fragment,null,e&&t.createElement("div",{className:`${n}-title`},e),r&&t.createElement("div",{className:`${n}-inner-content`},r)):null,C=e=>{let{hashId:n,prefixCls:o,className:i,style:l,placement:s="top",title:c,content:d,children:m}=e,p=a(c),h=a(d),f=(0,r.default)(n,o,`${o}-pure`,`${o}-placement-${s}`,i);return t.createElement("div",{className:f,style:l},t.createElement("div",{className:`${o}-arrow`}),t.createElement(u.Popup,Object.assign({},e,{className:n,prefixCls:o}),m||t.createElement(x,{prefixCls:o,title:p,content:h})))},w=e=>{let{prefixCls:n,className:o}=e,a=y(e,["prefixCls","className"]),{getPrefixCls:i}=t.useContext(s.ConfigContext),l=i("popover",n),[c,u,d]=b(l);return c(t.createElement(C,Object.assign({},a,{prefixCls:l,hashId:u,className:(0,r.default)(o,d)})))};e.s(["Overlay",0,x,"default",0,w],310730);var A=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let S=t.forwardRef((e,u)=>{var d,m;let{prefixCls:p,title:h,content:f,overlayClassName:g,placement:v="top",trigger:y="hover",children:C,mouseEnterDelay:w=.1,mouseLeaveDelay:S=.1,onOpenChange:E,overlayStyle:O={},styles:_,classNames:T}=e,I=A(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:k,className:R,style:M,classNames:j,styles:N}=(0,s.useComponentConfig)("popover"),L=k("popover",p),[P,$,z]=b(L),D=k(),F=(0,r.default)(g,$,z,R,j.root,null==T?void 0:T.root),B=(0,r.default)(j.body,null==T?void 0:T.body),[V,H]=(0,n.default)(!1,{value:null!=(d=e.open)?d:e.visible,defaultValue:null!=(m=e.defaultOpen)?m:e.defaultVisible}),G=(e,t)=>{H(e,!0),null==E||E(e,t)},U=a(h),W=a(f);return P(t.createElement(c.default,Object.assign({placement:v,trigger:y,mouseEnterDelay:w,mouseLeaveDelay:S},I,{prefixCls:L,classNames:{root:F,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},N.root),M),O),null==_?void 0:_.root),body:Object.assign(Object.assign({},N.body),null==_?void 0:_.body)},ref:u,open:V,onOpenChange:e=>{G(e)},overlay:U||W?t.createElement(x,{prefixCls:L,title:U,content:W}):null,transitionName:(0,i.getTransitionName)(D,"zoom-big",I.transitionName),"data-popover-inject":!0}),(0,l.cloneElement)(C,{onKeyDown:e=>{var r,n;(0,t.isValidElement)(C)&&(null==(n=null==C?void 0:(r=C.props).onKeyDown)||n.call(r,e)),e.keyCode===o.default.ESC&&G(!1,e)}})))});S._InternalPanelDoNotUseOrYouWillBeFired=w,e.s(["default",0,S],829672)},282786,e=>{"use strict";var t=e.i(829672);e.s(["Popover",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},516015,(e,t,r)=>{},898547,(e,t,r)=>{var n=e.i(247167);e.r(516015);var o=e.r(271645),a=o&&"object"==typeof o&&"default"in o?o:{default:o},i=void 0!==n.default&&n.default.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,o=t.optimizeForSpeed,a=void 0===o?i:o;c(l(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t,r=e.prototype;return r.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;ttypeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!r.cssRules[e])return e;r.deleteRule(e);try{r.insertRule(t,e)}catch(n){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),r.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},r.deleteRule=function(e){if("u"typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},r.cssRules=function(){var e=this;return"u">>0},d={};function m(e,t){if(!t)return"jsx-"+e;var r=String(t),n=e+r;return d[n]||(d[n]="jsx-"+u(e+"-"+r)),d[n]}function p(e,t){"u"typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),n=r.styleId,o=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var a=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=a,this._instancesCounts[n]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,n=e.id;if(r){var o=m(n,r);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:m(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),f=o.createContext(null);function g(){return new h}function v(){return o.useContext(f)}f.displayName="StyleSheetContext";var b=a.default.useInsertionEffect||a.default.useLayoutEffect,y="u">typeof window?g():void 0;function x(e){var t=y||v();return t&&("u"{t.exports=e.r(898547).style},883552,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(562901),n=e.i(343794),o=e.i(914949),a=e.i(529681),i=e.i(242064),l=e.i(829672),s=e.i(285781),c=e.i(836938),u=e.i(920228),d=e.i(62405),m=e.i(408850),p=e.i(87414),h=e.i(310730);let f=(0,e.i(246422).genStyleHooks)("Popconfirm",e=>(e=>{let{componentCls:t,iconCls:r,antCls:n,zIndexPopup:o,colorText:a,colorWarning:i,marginXXS:l,marginXS:s,fontSize:c,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:o,[`&${n}-popover`]:{fontSize:c},[`${t}-message`]:{marginBottom:s,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${r}`]:{color:i,fontSize:c,lineHeight:1,marginInlineEnd:s},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:l,color:a}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:s}}}}})(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1});var g=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let v=e=>{let{prefixCls:n,okButtonProps:o,cancelButtonProps:a,title:l,description:h,cancelText:f,okText:g,okType:v="primary",icon:b=t.createElement(r.default,null),showCancel:y=!0,close:x,onConfirm:C,onCancel:w,onPopupClick:A}=e,{getPrefixCls:S}=t.useContext(i.ConfigContext),[E]=(0,m.useLocale)("Popconfirm",p.default.Popconfirm),O=(0,c.getRenderPropValue)(l),_=(0,c.getRenderPropValue)(h);return t.createElement("div",{className:`${n}-inner-content`,onClick:A},t.createElement("div",{className:`${n}-message`},b&&t.createElement("span",{className:`${n}-message-icon`},b),t.createElement("div",{className:`${n}-message-text`},O&&t.createElement("div",{className:`${n}-title`},O),_&&t.createElement("div",{className:`${n}-description`},_))),t.createElement("div",{className:`${n}-buttons`},y&&t.createElement(u.default,Object.assign({onClick:w,size:"small"},a),f||(null==E?void 0:E.cancelText)),t.createElement(s.default,{buttonProps:Object.assign(Object.assign({size:"small"},(0,d.convertLegacyProps)(v)),o),actionFn:C,close:x,prefixCls:S("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},g||(null==E?void 0:E.okText))))};var b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let y=t.forwardRef((e,s)=>{var c,u;let{prefixCls:d,placement:m="top",trigger:p="click",okType:h="primary",icon:g=t.createElement(r.default,null),children:y,overlayClassName:x,onOpenChange:C,onVisibleChange:w,overlayStyle:A,styles:S,classNames:E}=e,O=b(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:_,className:T,style:I,classNames:k,styles:R}=(0,i.useComponentConfig)("popconfirm"),[M,j]=(0,o.default)(!1,{value:null!=(c=e.open)?c:e.visible,defaultValue:null!=(u=e.defaultOpen)?u:e.defaultVisible}),N=(e,t)=>{j(e,!0),null==w||w(e),null==C||C(e,t)},L=_("popconfirm",d),P=(0,n.default)(L,T,x,k.root,null==E?void 0:E.root),$=(0,n.default)(k.body,null==E?void 0:E.body),[z]=f(L);return z(t.createElement(l.default,Object.assign({},(0,a.default)(O,["title"]),{trigger:p,placement:m,onOpenChange:(t,r)=>{let{disabled:n=!1}=e;n||N(t,r)},open:M,ref:s,classNames:{root:P,body:$},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},R.root),I),A),null==S?void 0:S.root),body:Object.assign(Object.assign({},R.body),null==S?void 0:S.body)},content:t.createElement(v,Object.assign({okType:h,icon:g},e,{prefixCls:L,close:e=>{N(!1,e)},onConfirm:t=>{var r;return null==(r=e.onConfirm)?void 0:r.call(void 0,t)},onCancel:t=>{var r;N(!1,t),null==(r=e.onCancel)||r.call(void 0,t)}})),"data-popover-inject":!0}),y))});y._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:r,placement:o,className:a,style:l}=e,s=g(e,["prefixCls","placement","className","style"]),{getPrefixCls:c}=t.useContext(i.ConfigContext),u=c("popconfirm",r),[d]=f(u);return d(t.createElement(h.default,{placement:o,className:(0,n.default)(u,a),style:l,content:t.createElement(v,Object.assign({prefixCls:u},s))}))},e.s(["Popconfirm",0,y],883552)},724154,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["StopOutlined",0,a],724154)},750113,e=>{"use strict";var t=e.i(684024);e.s(["QuestionCircleOutlined",()=>t.default])},751904,e=>{"use strict";var t=e.i(401361);e.s(["EditOutlined",()=>t.default])},564897,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["MinusCircleOutlined",0,a],564897)},446891,836991,e=>{"use strict";var t=e.i(843476),r=e.i(464571),n=e.i(326373),o=e.i(94629),a=e.i(360820),i=e.i(871943),l=e.i(271645);let s=l.forwardRef(function(e,t){return l.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),l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))});e.s(["XIcon",0,s],836991),e.s(["TableHeaderSortDropdown",0,({sortState:e,onSortChange:l})=>{let c=[{key:"asc",label:"Ascending",icon:(0,t.jsx)(a.ChevronUpIcon,{className:"h-4 w-4"})},{key:"desc",label:"Descending",icon:(0,t.jsx)(i.ChevronDownIcon,{className:"h-4 w-4"})},{key:"reset",label:"Reset",icon:(0,t.jsx)(s,{className:"h-4 w-4"})}];return(0,t.jsx)(n.Dropdown,{menu:{items:c,onClick:({key:e})=>{"asc"===e?l("asc"):"desc"===e?l("desc"):"reset"===e&&l(!1)},selectable:!0,selectedKeys:e?[e]:[]},trigger:["click"],autoAdjustOverflow:!0,children:(0,t.jsx)(r.Button,{type:"text",onClick:e=>e.stopPropagation(),icon:"asc"===e?(0,t.jsx)(a.ChevronUpIcon,{className:"h-4 w-4"}):"desc"===e?(0,t.jsx)(i.ChevronDownIcon,{className:"h-4 w-4"}):(0,t.jsx)(o.SwitchVerticalIcon,{className:"h-4 w-4"}),className:e?"text-blue-500 hover:text-blue-600":"text-gray-400 hover:text-blue-500"})})}],446891)},153472,e=>{"use strict";var t,r,n=e.i(266027),o=e.i(954616),a=e.i(912598),i=e.i(243652),l=e.i(135214),s=e.i(764205),c=((t={}).GENERAL_SETTINGS="general_settings",t),u=((r={}).MAXIMUM_SPEND_LOGS_RETENTION_PERIOD="maximum_spend_logs_retention_period",r);let d=async(e,t)=>{try{let r=s.proxyBaseUrl?`${s.proxyBaseUrl}/config/list?config_type=${t}`:`/config/list?config_type=${t}`,n=await fetch(r,{method:"GET",headers:{[(0,s.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=(0,s.deriveErrorMessage)(e);throw(0,s.handleError)(t),Error(t)}return await n.json()}catch(e){throw console.error(`Failed to get proxy config for ${t}:`,e),e}},m=(0,i.createQueryKeys)("proxyConfig"),p=async(e,t)=>{try{let r=s.proxyBaseUrl?`${s.proxyBaseUrl}/config/field/delete`:"/config/field/delete",n=await fetch(r,{method:"POST",headers:{[(0,s.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.json(),t=(0,s.deriveErrorMessage)(e);throw(0,s.handleError)(t),Error(t)}return await n.json()}catch(e){throw console.error(`Failed to delete proxy config field ${t.field_name}:`,e),e}};e.s(["ConfigType",()=>c,"GeneralSettingsFieldName",()=>u,"proxyConfigKeys",0,m,"useDeleteProxyConfigField",0,()=>{let{accessToken:e}=(0,l.default)(),t=(0,a.useQueryClient)();return(0,o.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return await p(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:m.all})}})},"useProxyConfig",0,e=>{let{accessToken:t}=(0,l.default)();return(0,n.useQuery)({queryKey:m.list({filters:{configType:e}}),queryFn:async()=>await d(t,e),enabled:!!t})}])},475647,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["PlusCircleOutlined",0,a],475647)},286536,77705,e=>{"use strict";var t=e.i(475254);let r=(0,t.default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>r],286536);let n=(0,t.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",()=>n],77705)},149121,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(152990),o=e.i(682830),a=e.i(269200),i=e.i(427612),l=e.i(64848),s=e.i(942232),c=e.i(496020),u=e.i(977572);function d({data:e=[],columns:d,onRowClick:m,renderSubComponent:p,renderChildRows:h,getRowCanExpand:f,isLoading:g=!1,loadingMessage:v="🚅 Loading logs...",noDataMessage:b="No logs found",enableSorting:y=!1}){let x=!!(p||h)&&!!f,[C,w]=(0,r.useState)([]),A=(0,n.useReactTable)({data:e,columns:d,...y&&{state:{sorting:C},onSortingChange:w,enableSortingRemoval:!1},...x&&{getRowCanExpand:f},getRowId:(e,t)=>e?.request_id??String(t),getCoreRowModel:(0,o.getCoreRowModel)(),...y&&{getSortedRowModel:(0,o.getSortedRowModel)()},...x&&{getExpandedRowModel:(0,o.getExpandedRowModel)()}});return(0,t.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,t.jsxs)(a.Table,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,t.jsx)(i.TableHead,{children:A.getHeaderGroups().map(e=>(0,t.jsx)(c.TableRow,{children:e.headers.map(e=>{let r=y&&e.column.getCanSort(),o=e.column.getIsSorted();return(0,t.jsx)(l.TableHeaderCell,{className:`py-1 h-8 ${r?"cursor-pointer select-none hover:bg-gray-50":""}`,onClick:r?e.column.getToggleSortingHandler():void 0,children:e.isPlaceholder?null:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.flexRender)(e.column.columnDef.header,e.getContext()),r&&(0,t.jsx)("span",{className:"text-gray-400",children:"asc"===o?"↑":"desc"===o?"↓":"⇅"})]})},e.id)})},e.id))}),(0,t.jsx)(s.TableBody,{children:g?(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(u.TableCell,{colSpan:d.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:v})})})}):A.getRowModel().rows.length>0?A.getRowModel().rows.map(e=>(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(c.TableRow,{className:`h-8 ${m?"cursor-pointer hover:bg-gray-50":""}`,onClick:()=>m?.(e.original),children:e.getVisibleCells().map(e=>(0,t.jsx)(u.TableCell,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,n.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))}),x&&e.getIsExpanded()&&h&&h({row:e}),x&&e.getIsExpanded()&&p&&!h&&(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(u.TableCell,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:p({row:e})})})})]},e.id)):(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(u.TableCell,{colSpan:d.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:b})})})})})]})})}e.s(["DataTable",()=>d])},37091,e=>{"use strict";var t=e.i(290571),r=e.i(95779),n=e.i(444755),o=e.i(673706),a=e.i(271645);let i=a.default.forwardRef((e,i)=>{let{color:l,children:s,className:c}=e,u=(0,t.__rest)(e,["color","children","className"]);return a.default.createElement("p",Object.assign({ref:i,className:(0,n.tremorTwMerge)(l?(0,o.getColorClassNames)(l,r.colorPalette.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},u),s)});i.displayName="Subtitle",e.s(["Subtitle",()=>i],37091)},738014,e=>{"use strict";var t=e.i(135214),r=e.i(764205),n=e.i(266027);let o=(0,e.i(243652).createQueryKeys)("users");e.s(["useCurrentUser",0,()=>{let{accessToken:e,userId:a}=(0,t.default)();return(0,n.useQuery)({queryKey:o.detail(a),queryFn:async()=>await (0,r.userGetInfoV2)(e),enabled:!!(e&&a)})}])},160818,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["GlobalOutlined",0,a],160818)},757440,e=>{"use strict";var t=e.i(290571),r=e.i(271645);let n=e=>{var n=(0,t.__rest)(e,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},n),r.default.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"}))};e.s(["default",()=>n])},446428,854056,e=>{"use strict";let t;var r=e.i(290571),n=e.i(271645);let o=e=>{var t=(0,r.__rest)(e,[]);return n.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),n.default.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"}))};e.s(["default",()=>o],446428);var a=e.i(746725),i=e.i(914189),l=e.i(553521),s=e.i(835696),c=e.i(941444),u=e.i(178677),d=e.i(294316),m=e.i(83733),p=e.i(233137),h=e.i(732607),f=e.i(397701),g=e.i(700020);function v(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:A)!==n.Fragment||1===n.default.Children.count(e.children)}let b=(0,n.createContext)(null);b.displayName="TransitionContext";var y=((t=y||{}).Visible="visible",t.Hidden="hidden",t);let x=(0,n.createContext)(null);function C(e){return"children"in e?C(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function w(e,t){let r=(0,c.useLatestValue)(e),o=(0,n.useRef)([]),s=(0,l.useIsMounted)(),u=(0,a.useDisposables)(),d=(0,i.useEvent)((e,t=g.RenderStrategy.Hidden)=>{let n=o.current.findIndex(({el:t})=>t===e);-1!==n&&((0,f.match)(t,{[g.RenderStrategy.Unmount](){o.current.splice(n,1)},[g.RenderStrategy.Hidden](){o.current[n].state="hidden"}}),u.microTask(()=>{var e;!C(o)&&s.current&&(null==(e=r.current)||e.call(r))}))}),m=(0,i.useEvent)(e=>{let t=o.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):o.current.push({el:e,state:"visible"}),()=>d(e,g.RenderStrategy.Unmount)}),p=(0,n.useRef)([]),h=(0,n.useRef)(Promise.resolve()),v=(0,n.useRef)({enter:[],leave:[]}),b=(0,i.useEvent)((e,r,n)=>{p.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(([t])=>t!==e)),null==t||t.chains.current[r].push([e,new Promise(e=>{p.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(v.current[r].map(([e,t])=>t)).then(()=>e())})]),"enter"===r?h.current=h.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),y=(0,i.useEvent)((e,t,r)=>{Promise.all(v.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=p.current.shift())||e()}).then(()=>r(t))});return(0,n.useMemo)(()=>({children:o,register:m,unregister:d,onStart:b,onStop:y,wait:h,chains:v}),[m,d,o,b,y,v,h])}x.displayName="NestingContext";let A=n.Fragment,S=g.RenderFeatures.RenderStrategy,E=(0,g.forwardRefWithAs)(function(e,t){let{show:r,appear:o=!1,unmount:a=!0,...l}=e,c=(0,n.useRef)(null),m=v(e),h=(0,d.useSyncRefs)(...m?[c,t]:null===t?[]:[t]);(0,u.useServerHandoffComplete)();let f=(0,p.useOpenClosed)();if(void 0===r&&null!==f&&(r=(f&p.State.Open)===p.State.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[y,A]=(0,n.useState)(r?"visible":"hidden"),E=w(()=>{r||A("hidden")}),[_,T]=(0,n.useState)(!0),I=(0,n.useRef)([r]);(0,s.useIsoMorphicEffect)(()=>{!1!==_&&I.current[I.current.length-1]!==r&&(I.current.push(r),T(!1))},[I,r]);let k=(0,n.useMemo)(()=>({show:r,appear:o,initial:_}),[r,o,_]);(0,s.useIsoMorphicEffect)(()=>{r?A("visible"):C(E)||null===c.current||A("hidden")},[r,E]);let R={unmount:a},M=(0,i.useEvent)(()=>{var t;_&&T(!1),null==(t=e.beforeEnter)||t.call(e)}),j=(0,i.useEvent)(()=>{var t;_&&T(!1),null==(t=e.beforeLeave)||t.call(e)}),N=(0,g.useRender)();return n.default.createElement(x.Provider,{value:E},n.default.createElement(b.Provider,{value:k},N({ourProps:{...R,as:n.Fragment,children:n.default.createElement(O,{ref:h,...R,...l,beforeEnter:M,beforeLeave:j})},theirProps:{},defaultTag:n.Fragment,features:S,visible:"visible"===y,name:"Transition"})))}),O=(0,g.forwardRefWithAs)(function(e,t){var r,o;let{transition:a=!0,beforeEnter:l,afterEnter:c,beforeLeave:y,afterLeave:E,enter:O,enterFrom:_,enterTo:T,entered:I,leave:k,leaveFrom:R,leaveTo:M,...j}=e,[N,L]=(0,n.useState)(null),P=(0,n.useRef)(null),$=v(e),z=(0,d.useSyncRefs)(...$?[P,t,L]:null===t?[]:[t]),D=null==(r=j.unmount)||r?g.RenderStrategy.Unmount:g.RenderStrategy.Hidden,{show:F,appear:B,initial:V}=function(){let e=(0,n.useContext)(b);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[H,G]=(0,n.useState)(F?"visible":"hidden"),U=function(){let e=(0,n.useContext)(x);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:W,unregister:K}=U;(0,s.useIsoMorphicEffect)(()=>W(P),[W,P]),(0,s.useIsoMorphicEffect)(()=>{if(D===g.RenderStrategy.Hidden&&P.current)return F&&"visible"!==H?void G("visible"):(0,f.match)(H,{hidden:()=>K(P),visible:()=>W(P)})},[H,P,W,K,F,D]);let q=(0,u.useServerHandoffComplete)();(0,s.useIsoMorphicEffect)(()=>{if($&&q&&"visible"===H&&null===P.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[P,H,q,$]);let X=V&&!B,Z=B&&F&&V,Q=(0,n.useRef)(!1),Y=w(()=>{Q.current||(G("hidden"),K(P))},U),J=(0,i.useEvent)(e=>{Q.current=!0,Y.onStart(P,e?"enter":"leave",e=>{"enter"===e?null==l||l():"leave"===e&&(null==y||y())})}),ee=(0,i.useEvent)(e=>{let t=e?"enter":"leave";Q.current=!1,Y.onStop(P,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==E||E())}),"leave"!==t||C(Y)||(G("hidden"),K(P))});(0,n.useEffect)(()=>{$&&a||(J(F),ee(F))},[F,$,a]);let et=!(!a||!$||!q||X),[,er]=(0,m.useTransition)(et,N,F,{start:J,end:ee}),en=(0,g.compact)({ref:z,className:(null==(o=(0,h.classNames)(j.className,Z&&O,Z&&_,er.enter&&O,er.enter&&er.closed&&_,er.enter&&!er.closed&&T,er.leave&&k,er.leave&&!er.closed&&R,er.leave&&er.closed&&M,!er.transition&&F&&I))?void 0:o.trim())||void 0,...(0,m.transitionDataAttributes)(er)}),eo=0;"visible"===H&&(eo|=p.State.Open),"hidden"===H&&(eo|=p.State.Closed),er.enter&&(eo|=p.State.Opening),er.leave&&(eo|=p.State.Closing);let ea=(0,g.useRender)();return n.default.createElement(x.Provider,{value:Y},n.default.createElement(p.OpenClosedProvider,{value:eo},ea({ourProps:en,theirProps:j,defaultTag:A,features:S,visible:"visible"===H,name:"Transition.Child"})))}),_=(0,g.forwardRefWithAs)(function(e,t){let r=null!==(0,n.useContext)(b),o=null!==(0,p.useOpenClosed)();return n.default.createElement(n.default.Fragment,null,!r&&o?n.default.createElement(E,{ref:t,...e}):n.default.createElement(O,{ref:t,...e}))}),T=Object.assign(E,{Child:_,Root:E});e.s(["Transition",()=>T],854056)},206929,e=>{"use strict";var t=e.i(290571),r=e.i(757440),n=e.i(271645),o=e.i(446428),a=e.i(444755),i=e.i(673706),l=e.i(103471),s=e.i(495470),c=e.i(854056),u=e.i(888288);let d=(0,i.makeClassName)("Select"),m=n.default.forwardRef((e,i)=>{let{defaultValue:m="",value:p,onValueChange:h,placeholder:f="Select...",disabled:g=!1,icon:v,enableClear:b=!1,required:y,children:x,name:C,error:w=!1,errorMessage:A,className:S,id:E}=e,O=(0,t.__rest)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),_=(0,n.useRef)(null),T=n.Children.toArray(x),[I,k]=(0,u.default)(m,p),R=(0,n.useMemo)(()=>{let e=n.default.Children.toArray(x).filter(n.isValidElement);return(0,l.constructValueToNameMapping)(e)},[x]);return n.default.createElement("div",{className:(0,a.tremorTwMerge)("w-full min-w-[10rem] text-tremor-default",S)},n.default.createElement("div",{className:"relative"},n.default.createElement("select",{title:"select-hidden",required:y,className:(0,a.tremorTwMerge)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:I,onChange:e=>{e.preventDefault()},name:C,disabled:g,id:E,onFocus:()=>{let e=_.current;e&&e.focus()}},n.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},f),T.map(e=>{let t=e.props.value,r=e.props.children;return n.default.createElement("option",{className:"hidden",key:t,value:t},r)})),n.default.createElement(s.Listbox,Object.assign({as:"div",ref:i,defaultValue:I,value:I,onChange:e=>{null==h||h(e),k(e)},disabled:g,id:E},O),({value:e})=>{var t;return n.default.createElement(n.default.Fragment,null,n.default.createElement(s.ListboxButton,{ref:_,className:(0,a.tremorTwMerge)("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,l.getSelectButtonColors)((0,l.hasValue)(e),g,w))},v&&n.default.createElement("span",{className:(0,a.tremorTwMerge)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},n.default.createElement(v,{className:(0,a.tremorTwMerge)(d("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.default.createElement("span",{className:"w-[90%] block truncate"},e&&null!=(t=R.get(e))?t:f),n.default.createElement("span",{className:(0,a.tremorTwMerge)("absolute inset-y-0 right-0 flex items-center mr-3")},n.default.createElement(r.default,{className:(0,a.tremorTwMerge)(d("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),b&&I?n.default.createElement("button",{type:"button",className:(0,a.tremorTwMerge)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),k(""),null==h||h("")}},n.default.createElement(o.default,{className:(0,a.tremorTwMerge)(d("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,n.default.createElement(c.Transition,{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"},n.default.createElement(s.ListboxOptions,{anchor:"bottom start",className:(0,a.tremorTwMerge)("z-10 w-[var(--button-width)] divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]","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")},x)))})),w&&A?n.default.createElement("p",{className:(0,a.tremorTwMerge)("errorMessage","text-sm text-rose-500 mt-1")},A):null)});m.displayName="Select",e.s(["Select",()=>m],206929)},502275,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["InformationCircleIcon",0,r],502275)},954616,e=>{"use strict";var t=e.i(271645),r=e.i(114272),n=e.i(540143),o=e.i(915823),a=e.i(619273),i=class extends o.Subscribable{#e;#t=void 0;#r;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,a.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.hashKey)(t.mutationKey)!==(0,a.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#o(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#a()}mutate(e,t){return this.#n=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#o(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){n.notifyManager.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,r,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,r,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,r,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,r,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},l=e.i(912598);function s(e,r){let o=(0,l.useQueryClient)(r),[s]=t.useState(()=>new i(o,e));t.useEffect(()=>{s.setOptions(e)},[s,e]);let c=t.useSyncExternalStore(t.useCallback(e=>s.subscribe(n.notifyManager.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=t.useCallback((e,t)=>{s.mutate(e,t).catch(a.noop)},[s]);if(c.error&&(0,a.shouldThrowError)(s.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}e.s(["useMutation",()=>s],954616)},127952,368869,e=>{"use strict";var t=e.i(843476),r=e.i(560445),n=e.i(175712),o=e.i(869216),a=e.i(311451),i=e.i(212931),l=e.i(898586);e.i(296059);var s=e.i(868297),c=e.i(732961),u=e.i(289882),d=e.i(170517),m=e.i(628882),p=e.i(320890),h=e.i(104458),f=e.i(722319),g=e.i(8398),v=e.i(279728);e.i(765846);var b=e.i(602716),y=e.i(328052);e.i(262370);var x=e.i(135551);let C=(e,t)=>new x.FastColor(e).setA(t).toRgbString(),w=(e,t)=>new x.FastColor(e).lighten(t).toHexString(),A=e=>{let t=(0,b.generate)(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},S=(e,t)=>{let r=e||"#000",n=t||"#fff";return{colorBgBase:r,colorTextBase:n,colorText:C(n,.85),colorTextSecondary:C(n,.65),colorTextTertiary:C(n,.45),colorTextQuaternary:C(n,.25),colorFill:C(n,.18),colorFillSecondary:C(n,.12),colorFillTertiary:C(n,.08),colorFillQuaternary:C(n,.04),colorBgSolid:C(n,.95),colorBgSolidHover:C(n,1),colorBgSolidActive:C(n,.9),colorBgElevated:w(r,12),colorBgContainer:w(r,8),colorBgLayout:w(r,0),colorBgSpotlight:w(r,26),colorBgBlur:C(n,.04),colorBorder:w(r,26),colorBorderSecondary:w(r,19)}},E={defaultSeed:p.defaultConfig.token,useToken:function(){let[e,t,r]=(0,h.useToken)();return{theme:e,token:t,hashId:r}},defaultAlgorithm:f.default,darkAlgorithm:(e,t)=>{let r=Object.keys(d.defaultPresetColors).map(t=>{let r=(0,b.generate)(e[t],{theme:"dark"});return Array.from({length:10},()=>1).reduce((e,n,o)=>(e[`${t}-${o+1}`]=r[o],e[`${t}${o+1}`]=r[o],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{}),n=null!=t?t:(0,f.default)(e),o=(0,y.default)(e,{generateColorPalettes:A,generateNeutralColorPalettes:S});return Object.assign(Object.assign(Object.assign(Object.assign({},n),r),o),{colorPrimaryBg:o.colorPrimaryBorder,colorPrimaryBgHover:o.colorPrimaryBorderHover})},compactAlgorithm:(e,t)=>{let r=null!=t?t:(0,f.default)(e),n=r.fontSizeSM,o=r.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),function(e){let{sizeUnit:t,sizeStep:r}=e,n=r-2;return{sizeXXL:t*(n+10),sizeXL:t*(n+6),sizeLG:t*(n+2),sizeMD:t*(n+2),sizeMS:t*(n+1),size:t*n,sizeSM:t*n,sizeXS:t*(n-1),sizeXXS:t*(n-1)}}(null!=t?t:e)),(0,v.default)(n)),{controlHeight:o}),(0,g.default)(Object.assign(Object.assign({},r),{controlHeight:o})))},getDesignToken:e=>{let t=(null==e?void 0:e.algorithm)?(0,s.createTheme)(e.algorithm):u.default,r=Object.assign(Object.assign({},d.default),null==e?void 0:e.token);return(0,c.getComputedToken)(r,{override:null==e?void 0:e.token},t,m.default)},defaultConfig:p.defaultConfig,_internalContext:p.DesignTokenContext};e.s(["theme",0,E],368869);var O=e.i(270377),_=e.i(271645);function T({isOpen:e,title:s,alertMessage:c,message:u,resourceInformationTitle:d,resourceInformation:m,onCancel:p,onOk:h,confirmLoading:f,requiredConfirmation:g}){let{Title:v,Text:b}=l.Typography,{token:y}=E.useToken(),[x,C]=(0,_.useState)("");return(0,_.useEffect)(()=>{e&&C("")},[e]),(0,t.jsx)(i.Modal,{title:s,open:e,onOk:h,onCancel:p,confirmLoading:f,okText:f?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!g&&x!==g||f},cancelButtonProps:{disabled:f},children:(0,t.jsxs)("div",{className:"space-y-4",children:[c&&(0,t.jsx)(r.Alert,{message:c,type:"warning"}),(0,t.jsx)(n.Card,{title:d,className:"mt-4",styles:{body:{padding:"16px"},header:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder}},style:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder},children:(0,t.jsx)(o.Descriptions,{column:1,size:"small",children:m&&m.map(({label:e,value:r,...n})=>(0,t.jsx)(o.Descriptions.Item,{label:(0,t.jsx)("span",{className:"font-semibold",children:e}),children:(0,t.jsx)(b,{...n,children:r??"-"})},e))})}),(0,t.jsx)("div",{children:(0,t.jsx)(b,{children:u})}),g&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,t.jsxs)(b,{className:"block text-base font-medium text-gray-700 dark:text-gray-300 mb-2",children:[(0,t.jsx)(b,{children:"Type "}),(0,t.jsx)(b,{strong:!0,type:"danger",children:g}),(0,t.jsx)(b,{children:" to confirm deletion:"})]}),(0,t.jsx)(a.Input,{value:x,onChange:e=>C(e.target.value),placeholder:g,className:"rounded-md",prefix:(0,t.jsx)(O.ExclamationCircleOutlined,{style:{color:y.colorError}}),autoFocus:!0})]})]})})}e.s(["default",()=>T],127952)},888288,e=>{"use strict";var t=e.i(271645);let r=(e,r)=>{let n=void 0!==r,[o,a]=(0,t.useState)(e);return[n?r:o,e=>{n||a(e)}]};e.s(["default",()=>r])},793130,e=>{"use strict";var t=e.i(290571),r=e.i(429427),n=e.i(371330),o=e.i(271645),a=e.i(394487),i=e.i(503269),l=e.i(214520),s=e.i(746725),c=e.i(914189),u=e.i(144279),d=e.i(294316),m=e.i(601893),p=e.i(140721),h=e.i(942803),f=e.i(233538),g=e.i(694421),v=e.i(700020),b=e.i(35889),y=e.i(998348),x=e.i(722678);let C=(0,o.createContext)(null);C.displayName="GroupContext";let w=o.Fragment,A=Object.assign((0,v.forwardRefWithAs)(function(e,t){var w;let A=(0,o.useId)(),S=(0,h.useProvidedId)(),E=(0,m.useDisabled)(),{id:O=S||`headlessui-switch-${A}`,disabled:_=E||!1,checked:T,defaultChecked:I,onChange:k,name:R,value:M,form:j,autoFocus:N=!1,...L}=e,P=(0,o.useContext)(C),[$,z]=(0,o.useState)(null),D=(0,o.useRef)(null),F=(0,d.useSyncRefs)(D,t,null===P?null:P.setSwitch,z),B=(0,l.useDefaultValue)(I),[V,H]=(0,i.useControllable)(T,k,null!=B&&B),G=(0,s.useDisposables)(),[U,W]=(0,o.useState)(!1),K=(0,c.useEvent)(()=>{W(!0),null==H||H(!V),G.nextFrame(()=>{W(!1)})}),q=(0,c.useEvent)(e=>{if((0,f.isDisabledReactIssue7711)(e.currentTarget))return e.preventDefault();e.preventDefault(),K()}),X=(0,c.useEvent)(e=>{e.key===y.Keys.Space?(e.preventDefault(),K()):e.key===y.Keys.Enter&&(0,g.attemptSubmit)(e.currentTarget)}),Z=(0,c.useEvent)(e=>e.preventDefault()),Q=(0,x.useLabelledBy)(),Y=(0,b.useDescribedBy)(),{isFocusVisible:J,focusProps:ee}=(0,r.useFocusRing)({autoFocus:N}),{isHovered:et,hoverProps:er}=(0,n.useHover)({isDisabled:_}),{pressed:en,pressProps:eo}=(0,a.useActivePress)({disabled:_}),ea=(0,o.useMemo)(()=>({checked:V,disabled:_,hover:et,focus:J,active:en,autofocus:N,changing:U}),[V,et,J,en,_,U,N]),ei=(0,v.mergeProps)({id:O,ref:F,role:"switch",type:(0,u.useResolveButtonType)(e,$),tabIndex:-1===e.tabIndex?0:null!=(w=e.tabIndex)?w:0,"aria-checked":V,"aria-labelledby":Q,"aria-describedby":Y,disabled:_||void 0,autoFocus:N,onClick:q,onKeyUp:X,onKeyPress:Z},ee,er,eo),el=(0,o.useCallback)(()=>{if(void 0!==B)return null==H?void 0:H(B)},[H,B]),es=(0,v.useRender)();return o.default.createElement(o.default.Fragment,null,null!=R&&o.default.createElement(p.FormFields,{disabled:_,data:{[R]:M||"on"},overrides:{type:"checkbox",checked:V},form:j,onReset:el}),es({ourProps:ei,theirProps:L,slot:ea,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[r,n]=(0,o.useState)(null),[a,i]=(0,x.useLabels)(),[l,s]=(0,b.useDescriptions)(),c=(0,o.useMemo)(()=>({switch:r,setSwitch:n}),[r,n]),u=(0,v.useRender)();return o.default.createElement(s,{name:"Switch.Description",value:l},o.default.createElement(i,{name:"Switch.Label",value:a,props:{htmlFor:null==(t=c.switch)?void 0:t.id,onClick(e){r&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},o.default.createElement(C.Provider,{value:c},u({ourProps:{},theirProps:e,slot:{},defaultTag:w,name:"Switch.Group"}))))},Label:x.Label,Description:b.Description});var S=e.i(888288),E=e.i(95779),O=e.i(444755),_=e.i(673706),T=e.i(829087);let I=(0,_.makeClassName)("Switch"),k=o.default.forwardRef((e,r)=>{let{checked:n,defaultChecked:a=!1,onChange:i,color:l,name:s,error:c,errorMessage:u,disabled:d,required:m,tooltip:p,id:h}=e,f=(0,t.__rest)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:l?(0,_.getColorClassNames)(l,E.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:l?(0,_.getColorClassNames)(l,E.colorPalette.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,b]=(0,S.default)(a,n),[y,x]=(0,o.useState)(!1),{tooltipProps:C,getReferenceProps:w}=(0,T.useTooltip)(300);return o.default.createElement("div",{className:"flex flex-row items-center justify-start"},o.default.createElement(T.default,Object.assign({text:p},C)),o.default.createElement("div",Object.assign({ref:(0,_.mergeRefs)([r,C.refs.setReference]),className:(0,O.tremorTwMerge)(I("root"),"flex flex-row relative h-5")},f,w),o.default.createElement("input",{type:"checkbox",className:(0,O.tremorTwMerge)(I("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:s,required:m,checked:v,onChange:e=>{e.preventDefault()}}),o.default.createElement(A,{checked:v,onChange:e=>{b(e),null==i||i(e)},disabled:d,className:(0,O.tremorTwMerge)(I("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:h},o.default.createElement("span",{className:(0,O.tremorTwMerge)(I("sr-only"),"sr-only")},"Switch ",v?"on":"off"),o.default.createElement("span",{"aria-hidden":"true",className:(0,O.tremorTwMerge)(I("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),o.default.createElement("span",{"aria-hidden":"true",className:(0,O.tremorTwMerge)(I("round"),v?(0,O.tremorTwMerge)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",y?(0,O.tremorTwMerge)("ring-2",g.ringColor):"")}))),c&&u?o.default.createElement("p",{className:(0,O.tremorTwMerge)(I("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});k.displayName="Switch",e.s(["Switch",()=>k],793130)},418371,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(916925);e.s(["ProviderLogo",0,({provider:e,className:o="w-4 h-4"})=>{let[a,i]=(0,r.useState)(!1),{logo:l}=(0,n.getProviderLogoAndName)(e);return a||!l?(0,t.jsx)("div",{className:`${o} rounded-full bg-gray-200 flex items-center justify-center text-xs`,children:e?.charAt(0)||"-"}):(0,t.jsx)("img",{src:l,alt:`${e} logo`,className:o,onError:()=>i(!0)})}])},368670,539677,e=>{"use strict";var t=e.i(764205),r=e.i(266027);let n=(0,e.i(243652).createQueryKeys)("modelCostMap");e.s(["useModelCostMap",0,()=>(0,r.useQuery)({queryKey:n.list({}),queryFn:async()=>await (0,t.modelCostMap)(),staleTime:6e4,gcTime:6e4})],368670),e.i(247167);var o=e.i(931067),a=e.i(271645);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M740 161c-61.8 0-112 50.2-112 112 0 50.1 33.1 92.6 78.5 106.9v95.9L320 602.4V318.1c44.2-15 76-56.9 76-106.1 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 49.2 31.8 91 76 106.1V706c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-27.8l423.5-138.7a50.52 50.52 0 0034.9-48.2V378.2c42.9-15.8 73.6-57 73.6-105.2 0-61.8-50.2-112-112-112zm-504 51a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm96 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm408-491a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"branches",theme:"outlined"};var l=e.i(9583),s=a.forwardRef(function(e,t){return a.createElement(l.default,(0,o.default)({},e,{ref:t,icon:i}))});e.s(["BranchesOutlined",0,s],539677)},664307,e=>{"use strict";var t=e.i(843476),r=e.i(135214),n=e.i(214541),o=e.i(271645),a=e.i(161059);e.s(["default",0,()=>{let{token:e,premiumUser:i}=(0,r.default)(),[l,s]=(0,o.useState)([]),{teams:c}=(0,n.default)();return(0,t.jsx)(a.default,{token:e,modelData:{data:[]},keys:l,setModelData:()=>{},premiumUser:i,teams:c})}])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2f29909dc244a7c0.js b/litellm/proxy/_experimental/out/_next/static/chunks/2f29909dc244a7c0.js
deleted file mode 100644
index 1b1f36356d..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/2f29909dc244a7c0.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,888288,e=>{"use strict";var t=e.i(271645);let r=(e,r)=>{let n=void 0!==r,[l,a]=(0,t.useState)(e);return[n?r:l,e=>{n||a(e)}]};e.s(["default",()=>r])},646563,e=>{"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},869216,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(908206),l=e.i(242064),a=e.i(517455),i=e.i(150073);let o={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},s=t.default.createContext({});var d=e.i(876556),c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r},u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let m=e=>{let{itemPrefixCls:n,component:l,span:a,className:i,style:o,labelStyle:d,contentStyle:c,bordered:u,label:m,content:g,colon:b,type:f,styles:p}=e,{classNames:h}=t.useContext(s),v=Object.assign(Object.assign({},d),null==p?void 0:p.label),y=Object.assign(Object.assign({},c),null==p?void 0:p.content);if(u)return t.createElement(l,{colSpan:a,style:o,className:(0,r.default)(i,{[`${n}-item-${f}`]:"label"===f||"content"===f,[null==h?void 0:h.label]:(null==h?void 0:h.label)&&"label"===f,[null==h?void 0:h.content]:(null==h?void 0:h.content)&&"content"===f})},null!=m&&t.createElement("span",{style:v},m),null!=g&&t.createElement("span",{style:y},g));return t.createElement(l,{colSpan:a,style:o,className:(0,r.default)(`${n}-item`,i)},t.createElement("div",{className:`${n}-item-container`},null!=m&&t.createElement("span",{style:v,className:(0,r.default)(`${n}-item-label`,null==h?void 0:h.label,{[`${n}-item-no-colon`]:!b})},m),null!=g&&t.createElement("span",{style:y,className:(0,r.default)(`${n}-item-content`,null==h?void 0:h.content)},g)))};function g(e,{colon:r,prefixCls:n,bordered:l},{component:a,type:i,showLabel:o,showContent:s,labelStyle:d,contentStyle:c,styles:u}){return e.map(({label:e,children:g,prefixCls:b=n,className:f,style:p,labelStyle:h,contentStyle:v,span:y=1,key:$,styles:x},O)=>"string"==typeof a?t.createElement(m,{key:`${i}-${$||O}`,className:f,style:p,styles:{label:Object.assign(Object.assign(Object.assign(Object.assign({},d),null==u?void 0:u.label),h),null==x?void 0:x.label),content:Object.assign(Object.assign(Object.assign(Object.assign({},c),null==u?void 0:u.content),v),null==x?void 0:x.content)},span:y,colon:r,component:a,itemPrefixCls:b,bordered:l,label:o?e:null,content:s?g:null,type:i}):[t.createElement(m,{key:`label-${$||O}`,className:f,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),null==u?void 0:u.label),p),h),null==x?void 0:x.label),span:1,colon:r,component:a[0],itemPrefixCls:b,bordered:l,label:e,type:"label"}),t.createElement(m,{key:`content-${$||O}`,className:f,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c),null==u?void 0:u.content),p),v),null==x?void 0:x.content),span:2*y-1,component:a[1],itemPrefixCls:b,bordered:l,content:g,type:"content"})])}let b=e=>{let r=t.useContext(s),{prefixCls:n,vertical:l,row:a,index:i,bordered:o}=e;return l?t.createElement(t.Fragment,null,t.createElement("tr",{key:`label-${i}`,className:`${n}-row`},g(a,e,Object.assign({component:"th",type:"label",showLabel:!0},r))),t.createElement("tr",{key:`content-${i}`,className:`${n}-row`},g(a,e,Object.assign({component:"td",type:"content",showContent:!0},r)))):t.createElement("tr",{key:i,className:`${n}-row`},g(a,e,Object.assign({component:o?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},r)))};e.i(296059);var f=e.i(915654),p=e.i(183293),h=e.i(246422),v=e.i(838378);let y=(0,h.genStyleHooks)("Descriptions",e=>(e=>{let{componentCls:t,extraColor:r,itemPaddingBottom:n,itemPaddingEnd:l,colonMarginRight:a,colonMarginLeft:i,titleMarginBottom:o}=e;return{[t]:Object.assign(Object.assign(Object.assign({},(0,p.resetComponent)(e)),(e=>{let{componentCls:t,labelBg:r}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${(0,f.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${(0,f.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,f.unit)(e.padding)} ${(0,f.unit)(e.paddingLG)}`,borderInlineEnd:`${(0,f.unit)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:r,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,f.unit)(e.paddingSM)} ${(0,f.unit)(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,f.unit)(e.paddingXS)} ${(0,f.unit)(e.padding)}`}}}}}})(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:o},[`${t}-title`]:Object.assign(Object.assign({},p.textEllipsis),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:r,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:n,paddingInlineEnd:l},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${(0,f.unit)(i)} ${(0,f.unit)(a)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}})((0,v.mergeToken)(e,{})),e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}));var $=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let x=e=>{let m,{prefixCls:g,title:f,extra:p,column:h,colon:v=!0,bordered:x,layout:O,children:S,className:j,rootClassName:w,style:E,size:C,labelStyle:T,contentStyle:k,styles:N,items:L,classNames:M}=e,P=$(e,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","styles","items","classNames"]),{getPrefixCls:R,direction:B,className:z,style:I,classNames:H,styles:F}=(0,l.useComponentConfig)("descriptions"),W=R("descriptions",g),A=(0,i.default)(),G=t.useMemo(()=>{var e;return"number"==typeof h?h:null!=(e=(0,n.matchScreen)(A,Object.assign(Object.assign({},o),h)))?e:3},[A,h]),D=(m=t.useMemo(()=>L||(0,d.default)(S).map(e=>Object.assign(Object.assign({},null==e?void 0:e.props),{key:e.key})),[L,S]),t.useMemo(()=>m.map(e=>{var{span:t}=e,r=c(e,["span"]);return"filled"===t?Object.assign(Object.assign({},r),{filled:!0}):Object.assign(Object.assign({},r),{span:"number"==typeof t?t:(0,n.matchScreen)(A,t)})}),[m,A])),X=(0,a.default)(C),V=((e,r)=>{let[n,l]=(0,t.useMemo)(()=>{let t,n,l,a;return t=[],n=[],l=!1,a=0,r.filter(e=>e).forEach(r=>{let{filled:i}=r,o=u(r,["filled"]);if(i){n.push(o),t.push(n),n=[],a=0;return}let s=e-a;(a+=r.span||1)>=e?(a>e?(l=!0,n.push(Object.assign(Object.assign({},o),{span:s}))):n.push(o),t.push(n),n=[],a=0):n.push(o)}),n.length>0&&t.push(n),[t=t.map(t=>{let r=t.reduce((e,t)=>e+(t.span||1),0);if(r({labelStyle:T,contentStyle:k,styles:{content:Object.assign(Object.assign({},F.content),null==N?void 0:N.content),label:Object.assign(Object.assign({},F.label),null==N?void 0:N.label)},classNames:{label:(0,r.default)(H.label,null==M?void 0:M.label),content:(0,r.default)(H.content,null==M?void 0:M.content)}}),[T,k,N,M,H,F]);return q(t.createElement(s.Provider,{value:U},t.createElement("div",Object.assign({className:(0,r.default)(W,z,H.root,null==M?void 0:M.root,{[`${W}-${X}`]:X&&"default"!==X,[`${W}-bordered`]:!!x,[`${W}-rtl`]:"rtl"===B},j,w,_,K),style:Object.assign(Object.assign(Object.assign(Object.assign({},I),F.root),null==N?void 0:N.root),E)},P),(f||p)&&t.createElement("div",{className:(0,r.default)(`${W}-header`,H.header,null==M?void 0:M.header),style:Object.assign(Object.assign({},F.header),null==N?void 0:N.header)},f&&t.createElement("div",{className:(0,r.default)(`${W}-title`,H.title,null==M?void 0:M.title),style:Object.assign(Object.assign({},F.title),null==N?void 0:N.title)},f),p&&t.createElement("div",{className:(0,r.default)(`${W}-extra`,H.extra,null==M?void 0:M.extra),style:Object.assign(Object.assign({},F.extra),null==N?void 0:N.extra)},p)),t.createElement("div",{className:`${W}-view`},t.createElement("table",null,t.createElement("tbody",null,V.map((e,r)=>t.createElement(b,{key:r,index:r,colon:v,prefixCls:W,vertical:"vertical"===O,bordered:x,row:e}))))))))};x.Item=({children:e})=>e,e.s(["Descriptions",0,x],869216)},270377,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["ExclamationCircleOutlined",0,a],270377)},175712,e=>{"use strict";e.i(247167);var t=e.i(271645),r=e.i(343794),n=e.i(529681),l=e.i(242064),a=e.i(517455),i=e.i(185793),o=e.i(721369),s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let d=e=>{var{prefixCls:n,className:a,hoverable:i=!0}=e,o=s(e,["prefixCls","className","hoverable"]);let{getPrefixCls:d}=t.useContext(l.ConfigContext),c=d("card",n),u=(0,r.default)(`${c}-grid`,a,{[`${c}-grid-hoverable`]:i});return t.createElement("div",Object.assign({},o,{className:u}))};e.i(296059);var c=e.i(915654),u=e.i(183293),m=e.i(246422),g=e.i(838378);let b=(0,m.genStyleHooks)("Card",e=>{let t=(0,g.mergeToken)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[(e=>{let{componentCls:t,cardShadow:r,cardHeadPadding:n,colorBorderSecondary:l,boxShadowTertiary:a,bodyPadding:i,extraColor:o}=e;return{[t]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:(e=>{let{antCls:t,componentCls:r,headerHeight:n,headerPadding:l,tabsMarginBottom:a}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:`0 ${(0,c.unit)(l)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)} 0 0`},(0,u.clearFix)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},u.textEllipsis),{[`
- > ${r}-typography,
- > ${r}-typography-edit-content
- `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:a,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})})(e),[`${t}-extra`]:{marginInlineStart:"auto",color:o,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:i,borderRadius:`0 0 ${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)}`},[`${t}-grid`]:(e=>{let{cardPaddingBase:t,colorBorderSecondary:r,cardShadow:n,lineWidth:l}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:`
- ${(0,c.unit)(l)} 0 0 0 ${r},
- 0 ${(0,c.unit)(l)} 0 0 ${r},
- ${(0,c.unit)(l)} ${(0,c.unit)(l)} 0 0 ${r},
- ${(0,c.unit)(l)} 0 0 0 ${r} inset,
- 0 ${(0,c.unit)(l)} 0 0 ${r} inset;
- `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}})(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:(e=>{let{componentCls:t,iconCls:r,actionsLiMargin:n,cardActionsIconSize:l,colorBorderSecondary:a,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${a}`,display:"flex",borderRadius:`0 0 ${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)}`},(0,u.clearFix)()),{"& > li":{margin:n,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${r}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,c.unit)(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${r}`]:{fontSize:l,lineHeight:(0,c.unit)(e.calc(l).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${a}`}}})})(e),[`${t}-meta`]:Object.assign(Object.assign({margin:`${(0,c.unit)(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},(0,u.clearFix)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},u.textEllipsis),"&-description":{color:e.colorTextDescription}})}),[`${t}-bordered`]:{border:`${(0,c.unit)(e.lineWidth)} ${e.lineType} ${l}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:r}},[`${t}-contain-grid`]:{borderRadius:`${(0,c.unit)(e.borderRadiusLG)} ${(0,c.unit)(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:n}}},[`${t}-type-inner`]:(e=>{let{componentCls:t,colorFillAlter:r,headerPadding:n,bodyPadding:l}=e;return{[`${t}-head`]:{padding:`0 ${(0,c.unit)(n)}`,background:r,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${(0,c.unit)(e.padding)} ${(0,c.unit)(l)}`}}})(e),[`${t}-loading`]:(e=>{let{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}})(e),[`${t}-rtl`]:{direction:"rtl"}}})(t),(e=>{let{componentCls:t,bodyPaddingSM:r,headerPaddingSM:n,headerHeightSM:l,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:l,padding:`0 ${(0,c.unit)(n)}`,fontSize:a,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:r}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}})(t)]},e=>{var t,r;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!=(t=e.bodyPadding)?t:e.paddingLG,headerPadding:null!=(r=e.headerPadding)?r:e.paddingLG}});var f=e.i(792812),p=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};let h=e=>{let{actionClasses:r,actions:n=[],actionStyle:l}=e;return t.createElement("ul",{className:r,style:l},n.map((e,r)=>{let l=`action-${r}`;return t.createElement("li",{style:{width:`${100/n.length}%`},key:l},t.createElement("span",null,e))}))},v=t.forwardRef((e,s)=>{let c,{prefixCls:u,className:m,rootClassName:g,style:v,extra:y,headStyle:$={},bodyStyle:x={},title:O,loading:S,bordered:j,variant:w,size:E,type:C,cover:T,actions:k,tabList:N,children:L,activeTabKey:M,defaultActiveTabKey:P,tabBarExtraContent:R,hoverable:B,tabProps:z={},classNames:I,styles:H}=e,F=p(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:W,direction:A,card:G}=t.useContext(l.ConfigContext),[D]=(0,f.default)("card",w,j),X=e=>{var t;return(0,r.default)(null==(t=null==G?void 0:G.classNames)?void 0:t[e],null==I?void 0:I[e])},V=e=>{var t;return Object.assign(Object.assign({},null==(t=null==G?void 0:G.styles)?void 0:t[e]),null==H?void 0:H[e])},q=t.useMemo(()=>{let e=!1;return t.Children.forEach(L,t=>{(null==t?void 0:t.type)===d&&(e=!0)}),e},[L]),_=W("card",u),[K,U,Z]=b(_),Q=t.createElement(i.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},L),J=void 0!==M,Y=Object.assign(Object.assign({},z),{[J?"activeKey":"defaultActiveKey"]:J?M:P,tabBarExtraContent:R}),ee=(0,a.default)(E),et=ee&&"default"!==ee?ee:"large",er=N?t.createElement(o.default,Object.assign({size:et},Y,{className:`${_}-head-tabs`,onChange:t=>{var r;null==(r=e.onTabChange)||r.call(e,t)},items:N.map(e=>{var{tab:t}=e;return Object.assign({label:t},p(e,["tab"]))})})):null;if(O||y||er){let e=(0,r.default)(`${_}-head`,X("header")),n=(0,r.default)(`${_}-head-title`,X("title")),l=(0,r.default)(`${_}-extra`,X("extra")),a=Object.assign(Object.assign({},$),V("header"));c=t.createElement("div",{className:e,style:a},t.createElement("div",{className:`${_}-head-wrapper`},O&&t.createElement("div",{className:n,style:V("title")},O),y&&t.createElement("div",{className:l,style:V("extra")},y)),er)}let en=(0,r.default)(`${_}-cover`,X("cover")),el=T?t.createElement("div",{className:en,style:V("cover")},T):null,ea=(0,r.default)(`${_}-body`,X("body")),ei=Object.assign(Object.assign({},x),V("body")),eo=t.createElement("div",{className:ea,style:ei},S?Q:L),es=(0,r.default)(`${_}-actions`,X("actions")),ed=(null==k?void 0:k.length)?t.createElement(h,{actionClasses:es,actionStyle:V("actions"),actions:k}):null,ec=(0,n.default)(F,["onTabChange"]),eu=(0,r.default)(_,null==G?void 0:G.className,{[`${_}-loading`]:S,[`${_}-bordered`]:"borderless"!==D,[`${_}-hoverable`]:B,[`${_}-contain-grid`]:q,[`${_}-contain-tabs`]:null==N?void 0:N.length,[`${_}-${ee}`]:ee,[`${_}-type-${C}`]:!!C,[`${_}-rtl`]:"rtl"===A},m,g,U,Z),em=Object.assign(Object.assign({},null==G?void 0:G.style),v);return K(t.createElement("div",Object.assign({ref:s},ec,{className:eu,style:em}),c,el,eo,ed))});var y=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,n=Object.getOwnPropertySymbols(e);lt.indexOf(n[l])&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(r[n[l]]=e[n[l]]);return r};v.Grid=d,v.Meta=e=>{let{prefixCls:n,className:a,avatar:i,title:o,description:s}=e,d=y(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:c}=t.useContext(l.ConfigContext),u=c("card",n),m=(0,r.default)(`${u}-meta`,a),g=i?t.createElement("div",{className:`${u}-meta-avatar`},i):null,b=o?t.createElement("div",{className:`${u}-meta-title`},o):null,f=s?t.createElement("div",{className:`${u}-meta-description`},s):null,p=b||f?t.createElement("div",{className:`${u}-meta-detail`},b,f):null;return t.createElement("div",Object.assign({},d,{className:m}),g,p)},e.s(["Card",0,v],175712)},127952,368869,e=>{"use strict";var t=e.i(843476),r=e.i(560445),n=e.i(175712),l=e.i(869216),a=e.i(311451),i=e.i(212931),o=e.i(898586);e.i(296059);var s=e.i(868297),d=e.i(732961),c=e.i(289882),u=e.i(170517),m=e.i(628882),g=e.i(320890),b=e.i(104458),f=e.i(722319),p=e.i(8398),h=e.i(279728);e.i(765846);var v=e.i(602716),y=e.i(328052);e.i(262370);var $=e.i(135551);let x=(e,t)=>new $.FastColor(e).setA(t).toRgbString(),O=(e,t)=>new $.FastColor(e).lighten(t).toHexString(),S=e=>{let t=(0,v.generate)(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},j=(e,t)=>{let r=e||"#000",n=t||"#fff";return{colorBgBase:r,colorTextBase:n,colorText:x(n,.85),colorTextSecondary:x(n,.65),colorTextTertiary:x(n,.45),colorTextQuaternary:x(n,.25),colorFill:x(n,.18),colorFillSecondary:x(n,.12),colorFillTertiary:x(n,.08),colorFillQuaternary:x(n,.04),colorBgSolid:x(n,.95),colorBgSolidHover:x(n,1),colorBgSolidActive:x(n,.9),colorBgElevated:O(r,12),colorBgContainer:O(r,8),colorBgLayout:O(r,0),colorBgSpotlight:O(r,26),colorBgBlur:x(n,.04),colorBorder:O(r,26),colorBorderSecondary:O(r,19)}},w={defaultSeed:g.defaultConfig.token,useToken:function(){let[e,t,r]=(0,b.useToken)();return{theme:e,token:t,hashId:r}},defaultAlgorithm:f.default,darkAlgorithm:(e,t)=>{let r=Object.keys(u.defaultPresetColors).map(t=>{let r=(0,v.generate)(e[t],{theme:"dark"});return Array.from({length:10},()=>1).reduce((e,n,l)=>(e[`${t}-${l+1}`]=r[l],e[`${t}${l+1}`]=r[l],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{}),n=null!=t?t:(0,f.default)(e),l=(0,y.default)(e,{generateColorPalettes:S,generateNeutralColorPalettes:j});return Object.assign(Object.assign(Object.assign(Object.assign({},n),r),l),{colorPrimaryBg:l.colorPrimaryBorder,colorPrimaryBgHover:l.colorPrimaryBorderHover})},compactAlgorithm:(e,t)=>{let r=null!=t?t:(0,f.default)(e),n=r.fontSizeSM,l=r.controlHeight-4;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),function(e){let{sizeUnit:t,sizeStep:r}=e,n=r-2;return{sizeXXL:t*(n+10),sizeXL:t*(n+6),sizeLG:t*(n+2),sizeMD:t*(n+2),sizeMS:t*(n+1),size:t*n,sizeSM:t*n,sizeXS:t*(n-1),sizeXXS:t*(n-1)}}(null!=t?t:e)),(0,h.default)(n)),{controlHeight:l}),(0,p.default)(Object.assign(Object.assign({},r),{controlHeight:l})))},getDesignToken:e=>{let t=(null==e?void 0:e.algorithm)?(0,s.createTheme)(e.algorithm):c.default,r=Object.assign(Object.assign({},u.default),null==e?void 0:e.token);return(0,d.getComputedToken)(r,{override:null==e?void 0:e.token},t,m.default)},defaultConfig:g.defaultConfig,_internalContext:g.DesignTokenContext};e.s(["theme",0,w],368869);var E=e.i(270377),C=e.i(271645);function T({isOpen:e,title:s,alertMessage:d,message:c,resourceInformationTitle:u,resourceInformation:m,onCancel:g,onOk:b,confirmLoading:f,requiredConfirmation:p}){let{Title:h,Text:v}=o.Typography,{token:y}=w.useToken(),[$,x]=(0,C.useState)("");return(0,C.useEffect)(()=>{e&&x("")},[e]),(0,t.jsx)(i.Modal,{title:s,open:e,onOk:b,onCancel:g,confirmLoading:f,okText:f?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!p&&$!==p||f},cancelButtonProps:{disabled:f},children:(0,t.jsxs)("div",{className:"space-y-4",children:[d&&(0,t.jsx)(r.Alert,{message:d,type:"warning"}),(0,t.jsx)(n.Card,{title:u,className:"mt-4",styles:{body:{padding:"16px"},header:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder}},style:{backgroundColor:y.colorErrorBg,borderColor:y.colorErrorBorder},children:(0,t.jsx)(l.Descriptions,{column:1,size:"small",children:m&&m.map(({label:e,value:r,...n})=>(0,t.jsx)(l.Descriptions.Item,{label:(0,t.jsx)("span",{className:"font-semibold",children:e}),children:(0,t.jsx)(v,{...n,children:r??"-"})},e))})}),(0,t.jsx)("div",{children:(0,t.jsx)(v,{children:c})}),p&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,t.jsxs)(v,{className:"block text-base font-medium text-gray-700 dark:text-gray-300 mb-2",children:[(0,t.jsx)(v,{children:"Type "}),(0,t.jsx)(v,{strong:!0,type:"danger",children:p}),(0,t.jsx)(v,{children:" to confirm deletion:"})]}),(0,t.jsx)(a.Input,{value:$,onChange:e=>x(e.target.value),placeholder:p,className:"rounded-md",prefix:(0,t.jsx)(E.ExclamationCircleOutlined,{style:{color:y.colorError}}),autoFocus:!0})]})]})})}e.s(["default",()=>T],127952)},530212,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.s(["ArrowLeftIcon",0,r],530212)},214541,e=>{"use strict";var t=e.i(271645),r=e.i(135214),n=e.i(270345);e.s(["default",0,()=>{let[e,l]=(0,t.useState)([]),{accessToken:a,userId:i,userRole:o}=(0,r.default)();return(0,t.useEffect)(()=>{(async()=>{l(await (0,n.fetchTeams)(a,i,o,null))})()},[a,i,o]),{teams:e,setTeams:l}}])},757440,e=>{"use strict";var t=e.i(290571),r=e.i(271645);let n=e=>{var n=(0,t.__rest)(e,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},n),r.default.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"}))};e.s(["default",()=>n])},446428,854056,e=>{"use strict";let t;var r=e.i(290571),n=e.i(271645);let l=e=>{var t=(0,r.__rest)(e,[]);return n.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),n.default.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"}))};e.s(["default",()=>l],446428);var a=e.i(746725),i=e.i(914189),o=e.i(553521),s=e.i(835696),d=e.i(941444),c=e.i(178677),u=e.i(294316),m=e.i(83733),g=e.i(233137),b=e.i(732607),f=e.i(397701),p=e.i(700020);function h(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:S)!==n.Fragment||1===n.default.Children.count(e.children)}let v=(0,n.createContext)(null);v.displayName="TransitionContext";var y=((t=y||{}).Visible="visible",t.Hidden="hidden",t);let $=(0,n.createContext)(null);function x(e){return"children"in e?x(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function O(e,t){let r=(0,d.useLatestValue)(e),l=(0,n.useRef)([]),s=(0,o.useIsMounted)(),c=(0,a.useDisposables)(),u=(0,i.useEvent)((e,t=p.RenderStrategy.Hidden)=>{let n=l.current.findIndex(({el:t})=>t===e);-1!==n&&((0,f.match)(t,{[p.RenderStrategy.Unmount](){l.current.splice(n,1)},[p.RenderStrategy.Hidden](){l.current[n].state="hidden"}}),c.microTask(()=>{var e;!x(l)&&s.current&&(null==(e=r.current)||e.call(r))}))}),m=(0,i.useEvent)(e=>{let t=l.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):l.current.push({el:e,state:"visible"}),()=>u(e,p.RenderStrategy.Unmount)}),g=(0,n.useRef)([]),b=(0,n.useRef)(Promise.resolve()),h=(0,n.useRef)({enter:[],leave:[]}),v=(0,i.useEvent)((e,r,n)=>{g.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(([t])=>t!==e)),null==t||t.chains.current[r].push([e,new Promise(e=>{g.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(h.current[r].map(([e,t])=>t)).then(()=>e())})]),"enter"===r?b.current=b.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),y=(0,i.useEvent)((e,t,r)=>{Promise.all(h.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=g.current.shift())||e()}).then(()=>r(t))});return(0,n.useMemo)(()=>({children:l,register:m,unregister:u,onStart:v,onStop:y,wait:b,chains:h}),[m,u,l,v,y,h,b])}$.displayName="NestingContext";let S=n.Fragment,j=p.RenderFeatures.RenderStrategy,w=(0,p.forwardRefWithAs)(function(e,t){let{show:r,appear:l=!1,unmount:a=!0,...o}=e,d=(0,n.useRef)(null),m=h(e),b=(0,u.useSyncRefs)(...m?[d,t]:null===t?[]:[t]);(0,c.useServerHandoffComplete)();let f=(0,g.useOpenClosed)();if(void 0===r&&null!==f&&(r=(f&g.State.Open)===g.State.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[y,S]=(0,n.useState)(r?"visible":"hidden"),w=O(()=>{r||S("hidden")}),[C,T]=(0,n.useState)(!0),k=(0,n.useRef)([r]);(0,s.useIsoMorphicEffect)(()=>{!1!==C&&k.current[k.current.length-1]!==r&&(k.current.push(r),T(!1))},[k,r]);let N=(0,n.useMemo)(()=>({show:r,appear:l,initial:C}),[r,l,C]);(0,s.useIsoMorphicEffect)(()=>{r?S("visible"):x(w)||null===d.current||S("hidden")},[r,w]);let L={unmount:a},M=(0,i.useEvent)(()=>{var t;C&&T(!1),null==(t=e.beforeEnter)||t.call(e)}),P=(0,i.useEvent)(()=>{var t;C&&T(!1),null==(t=e.beforeLeave)||t.call(e)}),R=(0,p.useRender)();return n.default.createElement($.Provider,{value:w},n.default.createElement(v.Provider,{value:N},R({ourProps:{...L,as:n.Fragment,children:n.default.createElement(E,{ref:b,...L,...o,beforeEnter:M,beforeLeave:P})},theirProps:{},defaultTag:n.Fragment,features:j,visible:"visible"===y,name:"Transition"})))}),E=(0,p.forwardRefWithAs)(function(e,t){var r,l;let{transition:a=!0,beforeEnter:o,afterEnter:d,beforeLeave:y,afterLeave:w,enter:E,enterFrom:C,enterTo:T,entered:k,leave:N,leaveFrom:L,leaveTo:M,...P}=e,[R,B]=(0,n.useState)(null),z=(0,n.useRef)(null),I=h(e),H=(0,u.useSyncRefs)(...I?[z,t,B]:null===t?[]:[t]),F=null==(r=P.unmount)||r?p.RenderStrategy.Unmount:p.RenderStrategy.Hidden,{show:W,appear:A,initial:G}=function(){let e=(0,n.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[D,X]=(0,n.useState)(W?"visible":"hidden"),V=function(){let e=(0,n.useContext)($);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:q,unregister:_}=V;(0,s.useIsoMorphicEffect)(()=>q(z),[q,z]),(0,s.useIsoMorphicEffect)(()=>{if(F===p.RenderStrategy.Hidden&&z.current)return W&&"visible"!==D?void X("visible"):(0,f.match)(D,{hidden:()=>_(z),visible:()=>q(z)})},[D,z,q,_,W,F]);let K=(0,c.useServerHandoffComplete)();(0,s.useIsoMorphicEffect)(()=>{if(I&&K&&"visible"===D&&null===z.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[z,D,K,I]);let U=G&&!A,Z=A&&W&&G,Q=(0,n.useRef)(!1),J=O(()=>{Q.current||(X("hidden"),_(z))},V),Y=(0,i.useEvent)(e=>{Q.current=!0,J.onStart(z,e?"enter":"leave",e=>{"enter"===e?null==o||o():"leave"===e&&(null==y||y())})}),ee=(0,i.useEvent)(e=>{let t=e?"enter":"leave";Q.current=!1,J.onStop(z,t,e=>{"enter"===e?null==d||d():"leave"===e&&(null==w||w())}),"leave"!==t||x(J)||(X("hidden"),_(z))});(0,n.useEffect)(()=>{I&&a||(Y(W),ee(W))},[W,I,a]);let et=!(!a||!I||!K||U),[,er]=(0,m.useTransition)(et,R,W,{start:Y,end:ee}),en=(0,p.compact)({ref:H,className:(null==(l=(0,b.classNames)(P.className,Z&&E,Z&&C,er.enter&&E,er.enter&&er.closed&&C,er.enter&&!er.closed&&T,er.leave&&N,er.leave&&!er.closed&&L,er.leave&&er.closed&&M,!er.transition&&W&&k))?void 0:l.trim())||void 0,...(0,m.transitionDataAttributes)(er)}),el=0;"visible"===D&&(el|=g.State.Open),"hidden"===D&&(el|=g.State.Closed),er.enter&&(el|=g.State.Opening),er.leave&&(el|=g.State.Closing);let ea=(0,p.useRender)();return n.default.createElement($.Provider,{value:J},n.default.createElement(g.OpenClosedProvider,{value:el},ea({ourProps:en,theirProps:P,defaultTag:S,features:j,visible:"visible"===D,name:"Transition.Child"})))}),C=(0,p.forwardRefWithAs)(function(e,t){let r=null!==(0,n.useContext)(v),l=null!==(0,g.useOpenClosed)();return n.default.createElement(n.default.Fragment,null,!r&&l?n.default.createElement(w,{ref:t,...e}):n.default.createElement(E,{ref:t,...e}))}),T=Object.assign(w,{Child:C,Root:w});e.s(["Transition",()=>T],854056)},206929,e=>{"use strict";var t=e.i(290571),r=e.i(757440),n=e.i(271645),l=e.i(446428),a=e.i(444755),i=e.i(673706),o=e.i(103471),s=e.i(495470),d=e.i(854056),c=e.i(888288);let u=(0,i.makeClassName)("Select"),m=n.default.forwardRef((e,i)=>{let{defaultValue:m="",value:g,onValueChange:b,placeholder:f="Select...",disabled:p=!1,icon:h,enableClear:v=!1,required:y,children:$,name:x,error:O=!1,errorMessage:S,className:j,id:w}=e,E=(0,t.__rest)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),C=(0,n.useRef)(null),T=n.Children.toArray($),[k,N]=(0,c.default)(m,g),L=(0,n.useMemo)(()=>{let e=n.default.Children.toArray($).filter(n.isValidElement);return(0,o.constructValueToNameMapping)(e)},[$]);return n.default.createElement("div",{className:(0,a.tremorTwMerge)("w-full min-w-[10rem] text-tremor-default",j)},n.default.createElement("div",{className:"relative"},n.default.createElement("select",{title:"select-hidden",required:y,className:(0,a.tremorTwMerge)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:k,onChange:e=>{e.preventDefault()},name:x,disabled:p,id:w,onFocus:()=>{let e=C.current;e&&e.focus()}},n.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},f),T.map(e=>{let t=e.props.value,r=e.props.children;return n.default.createElement("option",{className:"hidden",key:t,value:t},r)})),n.default.createElement(s.Listbox,Object.assign({as:"div",ref:i,defaultValue:k,value:k,onChange:e=>{null==b||b(e),N(e)},disabled:p,id:w},E),({value:e})=>{var t;return n.default.createElement(n.default.Fragment,null,n.default.createElement(s.ListboxButton,{ref:C,className:(0,a.tremorTwMerge)("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",h?"pl-10":"pl-3",(0,o.getSelectButtonColors)((0,o.hasValue)(e),p,O))},h&&n.default.createElement("span",{className:(0,a.tremorTwMerge)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},n.default.createElement(h,{className:(0,a.tremorTwMerge)(u("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),n.default.createElement("span",{className:"w-[90%] block truncate"},e&&null!=(t=L.get(e))?t:f),n.default.createElement("span",{className:(0,a.tremorTwMerge)("absolute inset-y-0 right-0 flex items-center mr-3")},n.default.createElement(r.default,{className:(0,a.tremorTwMerge)(u("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&k?n.default.createElement("button",{type:"button",className:(0,a.tremorTwMerge)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),N(""),null==b||b("")}},n.default.createElement(l.default,{className:(0,a.tremorTwMerge)(u("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,n.default.createElement(d.Transition,{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"},n.default.createElement(s.ListboxOptions,{anchor:"bottom start",className:(0,a.tremorTwMerge)("z-10 w-[var(--button-width)] divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]","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&&S?n.default.createElement("p",{className:(0,a.tremorTwMerge)("errorMessage","text-sm text-rose-500 mt-1")},S):null)});m.displayName="Select",e.s(["Select",()=>m],206929)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3397155a65b7d83c.js b/litellm/proxy/_experimental/out/_next/static/chunks/3397155a65b7d83c.js
deleted file mode 100644
index 9164f8f97c..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/3397155a65b7d83c.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,244451,e=>{"use strict";let t;e.i(247167);var r=e.i(271645),i=e.i(343794),n=e.i(242064),o=e.i(763731),a=e.i(174428);let l=80*Math.PI,s=e=>{let{dotClassName:t,style:n,hasCircleCls:o}=e;return r.createElement("circle",{className:(0,i.default)(`${t}-circle`,{[`${t}-circle-bg`]:o}),r:40,cx:50,cy:50,strokeWidth:20,style:n})},c=({percent:e,prefixCls:t})=>{let n=`${t}-dot`,o=`${n}-holder`,c=`${o}-hidden`,[u,d]=r.useState(!1);(0,a.default)(()=>{0!==e&&d(!0)},[0!==e]);let m=Math.max(Math.min(e,100),0);if(!u)return null;let p={strokeDashoffset:`${l/4}`,strokeDasharray:`${l*m/100} ${l*(100-m)/100}`};return r.createElement("span",{className:(0,i.default)(o,`${n}-progress`,m<=0&&c)},r.createElement("svg",{viewBox:"0 0 100 100",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m},r.createElement(s,{dotClassName:n,hasCircleCls:!0}),r.createElement(s,{dotClassName:n,style:p})))};function u(e){let{prefixCls:t,percent:n=0}=e,o=`${t}-dot`,a=`${o}-holder`,l=`${a}-hidden`;return r.createElement(r.Fragment,null,r.createElement("span",{className:(0,i.default)(a,n>0&&l)},r.createElement("span",{className:(0,i.default)(o,`${t}-dot-spin`)},[1,2,3,4].map(e=>r.createElement("i",{className:`${t}-dot-item`,key:e})))),r.createElement(c,{prefixCls:t,percent:n}))}function d(e){var t;let{prefixCls:n,indicator:a,percent:l}=e,s=`${n}-dot`;return a&&r.isValidElement(a)?(0,o.cloneElement)(a,{className:(0,i.default)(null==(t=a.props)?void 0:t.className,s),percent:l}):r.createElement(u,{prefixCls:n,percent:l})}e.i(296059);var m=e.i(694758),p=e.i(183293),f=e.i(246422),g=e.i(838378);let h=new m.Keyframes("antSpinMove",{to:{opacity:1}}),v=new m.Keyframes("antRotate",{to:{transform:"rotate(405deg)"}}),y=(0,f.genStyleHooks)("Spin",e=>(e=>{let{componentCls:t,calc:r}=e;return{[t]:Object.assign(Object.assign({},(0,p.resetComponent)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:r(r(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:r(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:r(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:r(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:r(r(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:r(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:r(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:r(r(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:r(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:r(e.dotSize).sub(r(e.marginXXS).div(2)).div(2).equal(),height:r(e.dotSize).sub(r(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:h,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:v,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(t=>`${t} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:r(r(e.dotSizeSM).sub(r(e.marginXXS).div(2))).div(2).equal(),height:r(r(e.dotSizeSM).sub(r(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:r(r(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:r(r(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}})}})((0,g.mergeToken)(e,{spinDotDefault:e.colorTextDescription})),e=>{let{controlHeightLG:t,controlHeight:r}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:r}}),b=[[30,.05],[70,.03],[96,.01]];var $=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);nt.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r};let S=e=>{var o;let{prefixCls:a,spinning:l=!0,delay:s=0,className:c,rootClassName:u,size:m="default",tip:p,wrapperClassName:f,style:g,children:h,fullscreen:v=!1,indicator:S,percent:x}=e,k=$(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:C,direction:w,className:E,style:O,indicator:z}=(0,n.useComponentConfig)("spin"),j=C("spin",a),[D,N,I]=y(j),[M,T]=r.useState(()=>l&&(!l||!s||!!Number.isNaN(Number(s)))),P=function(e,t){let[i,n]=r.useState(0),o=r.useRef(null),a="auto"===t;return r.useEffect(()=>(a&&e&&(n(0),o.current=setInterval(()=>{n(e=>{let t=100-e;for(let r=0;r{o.current&&(clearInterval(o.current),o.current=null)}),[a,e]),a?i:t}(M,x);r.useEffect(()=>{if(l){let e=function(e,t,r){var i,n=r||{},o=n.noTrailing,a=void 0!==o&&o,l=n.noLeading,s=void 0!==l&&l,c=n.debounceMode,u=void 0===c?void 0:c,d=!1,m=0;function p(){i&&clearTimeout(i)}function f(){for(var r=arguments.length,n=Array(r),o=0;oe?s?(m=Date.now(),a||(i=setTimeout(u?g:f,e))):f():!0!==a&&(i=setTimeout(u?g:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly;p(),d=!(void 0!==t&&t)},f}(s,()=>{T(!0)},{debounceMode:false});return e(),()=>{var t;null==(t=null==e?void 0:e.cancel)||t.call(e)}}T(!1)},[s,l]);let A=r.useMemo(()=>void 0!==h&&!v,[h,v]),X=(0,i.default)(j,E,{[`${j}-sm`]:"small"===m,[`${j}-lg`]:"large"===m,[`${j}-spinning`]:M,[`${j}-show-text`]:!!p,[`${j}-rtl`]:"rtl"===w},c,!v&&u,N,I),W=(0,i.default)(`${j}-container`,{[`${j}-blur`]:M}),L=null!=(o=null!=S?S:z)?o:t,R=Object.assign(Object.assign({},O),g),B=r.createElement("div",Object.assign({},k,{style:R,className:X,"aria-live":"polite","aria-busy":M}),r.createElement(d,{prefixCls:j,indicator:L,percent:P}),p&&(A||v)?r.createElement("div",{className:`${j}-text`},p):null);return D(A?r.createElement("div",Object.assign({},k,{className:(0,i.default)(`${j}-nested-loading`,f,N,I)}),M&&r.createElement("div",{key:"loading"},B),r.createElement("div",{className:W,key:"container"},h)):v?r.createElement("div",{className:(0,i.default)(`${j}-fullscreen`,{[`${j}-fullscreen-show`]:M},u,N,I)},B):B)};S.setDefaultIndicator=e=>{t=e},e.s(["default",0,S],244451)},482725,e=>{"use strict";var t=e.i(244451);e.s(["Spin",()=>t.default])},270377,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={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"};var n=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(n.default,(0,t.default)({},e,{ref:o,icon:i}))});e.s(["ExclamationCircleOutlined",0,o],270377)},955135,e=>{"use strict";var t=e.i(597440);e.s(["DeleteOutlined",()=>t.default])},309821,e=>{"use strict";e.i(247167);var t=e.i(271645);e.i(262370);var r=e.i(135551),i=e.i(201072),n=e.i(121229),o=e.i(726289),a=e.i(864517),l=e.i(343794),s=e.i(529681),c=e.i(242064),u=e.i(931067),d=e.i(209428),m=e.i(703923),p={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},f=function(){var e=(0,t.useRef)([]),r=(0,t.useRef)(null);return(0,t.useEffect)(function(){var t=Date.now(),i=!1;e.current.forEach(function(e){if(e){i=!0;var n=e.style;n.transitionDuration=".3s, .3s, .3s, .06s",r.current&&t-r.current<100&&(n.transitionDuration="0s, 0s")}}),i&&(r.current=Date.now())}),e.current},g=e.i(410160),h=e.i(392221),v=e.i(654310),y=0,b=(0,v.default)();let $=function(e){var r=t.useState(),i=(0,h.default)(r,2),n=i[0],o=i[1];return t.useEffect(function(){var e;o("rc_progress_".concat((b?(e=y,y+=1):e="TEST_OR_SSR",e)))},[]),e||n};var S=function(e){var r=e.bg,i=e.children;return t.createElement("div",{style:{width:"100%",height:"100%",background:r}},i)};function x(e,t){return Object.keys(e).map(function(r){var i=parseFloat(r),n="".concat(Math.floor(i*t),"%");return"".concat(e[r]," ").concat(n)})}var k=t.forwardRef(function(e,r){var i=e.prefixCls,n=e.color,o=e.gradientId,a=e.radius,l=e.style,s=e.ptg,c=e.strokeLinecap,u=e.strokeWidth,d=e.size,m=e.gapDegree,p=n&&"object"===(0,g.default)(n),f=d/2,h=t.createElement("circle",{className:"".concat(i,"-circle-path"),r:a,cx:f,cy:f,stroke:p?"#FFF":void 0,strokeLinecap:c,strokeWidth:u,opacity:+(0!==s),style:l,ref:r});if(!p)return h;var v="".concat(o,"-conic"),y=x(n,(360-m)/360),b=x(n,1),$="conic-gradient(from ".concat(m?"".concat(180+m/2,"deg"):"0deg",", ").concat(y.join(", "),")"),k="linear-gradient(to ".concat(m?"bottom":"top",", ").concat(b.join(", "),")");return t.createElement(t.Fragment,null,t.createElement("mask",{id:v},h),t.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(v,")")},t.createElement(S,{bg:k},t.createElement(S,{bg:$}))))}),C=function(e,t,r,i,n,o,a,l,s,c){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=(100-i)/100*t;return"round"===s&&100!==i&&(d+=c/2)>=t&&(d=t-.01),{stroke:"string"==typeof l?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(n+r/100*360*((360-o)/360)+(0===o?0:({bottom:0,top:180,left:90,right:-90})[a]),"deg)"),transformOrigin:"".concat(50,"px ").concat(50,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},w=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function E(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}let O=function(e){var r,i,n,o,a=(0,d.default)((0,d.default)({},p),e),s=a.id,c=a.prefixCls,h=a.steps,v=a.strokeWidth,y=a.trailWidth,b=a.gapDegree,S=void 0===b?0:b,x=a.gapPosition,O=a.trailColor,z=a.strokeLinecap,j=a.style,D=a.className,N=a.strokeColor,I=a.percent,M=(0,m.default)(a,w),T=$(s),P="".concat(T,"-gradient"),A=50-v/2,X=2*Math.PI*A,W=S>0?90+S/2:-90,L=(360-S)/360*X,R="object"===(0,g.default)(h)?h:{count:h,gap:2},B=R.count,q=R.gap,F=E(I),H=E(N),G=H.find(function(e){return e&&"object"===(0,g.default)(e)}),_=G&&"object"===(0,g.default)(G)?"butt":z,K=C(X,L,0,100,W,S,x,O,_,v),U=f();return t.createElement("svg",(0,u.default)({className:(0,l.default)("".concat(c,"-circle"),D),viewBox:"0 0 ".concat(100," ").concat(100),style:j,id:s,role:"presentation"},M),!B&&t.createElement("circle",{className:"".concat(c,"-circle-trail"),r:A,cx:50,cy:50,stroke:O,strokeLinecap:_,strokeWidth:y||v,style:K}),B?(r=Math.round(B*(F[0]/100)),i=100/B,n=0,Array(B).fill(null).map(function(e,o){var a=o<=r-1?H[0]:O,l=a&&"object"===(0,g.default)(a)?"url(#".concat(P,")"):void 0,s=C(X,L,n,i,W,S,x,a,"butt",v,q);return n+=(L-s.strokeDashoffset+q)*100/L,t.createElement("circle",{key:o,className:"".concat(c,"-circle-path"),r:A,cx:50,cy:50,stroke:l,strokeWidth:v,opacity:1,style:s,ref:function(e){U[o]=e}})})):(o=0,F.map(function(e,r){var i=H[r]||H[H.length-1],n=C(X,L,o,e,W,S,x,i,_,v);return o+=e,t.createElement(k,{key:r,color:i,ptg:e,radius:A,prefixCls:c,gradientId:P,style:n,strokeLinecap:_,strokeWidth:v,gapDegree:S,ref:function(e){U[r]=e},size:100})}).reverse()))};var z=e.i(491816);e.i(765846);var j=e.i(896091);function D(e){return!e||e<0?0:e>100?100:e}function N({success:e,successPercent:t}){let r=t;return e&&"progress"in e&&(r=e.progress),e&&"percent"in e&&(r=e.percent),r}let I=(e,t,r)=>{var i,n,o,a;let l=-1,s=-1;if("step"===t){let t=r.steps,i=r.strokeWidth;"string"==typeof e||void 0===e?(l="small"===e?2:14,s=null!=i?i:8):"number"==typeof e?[l,s]=[e,e]:[l=14,s=8]=Array.isArray(e)?e:[e.width,e.height],l*=t}else if("line"===t){let t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?s=t||("small"===e?6:8):"number"==typeof e?[l,s]=[e,e]:[l=-1,s=8]=Array.isArray(e)?e:[e.width,e.height]}else("circle"===t||"dashboard"===t)&&("string"==typeof e||void 0===e?[l,s]="small"===e?[60,60]:[120,120]:"number"==typeof e?[l,s]=[e,e]:Array.isArray(e)&&(l=null!=(n=null!=(i=e[0])?i:e[1])?n:120,s=null!=(a=null!=(o=e[0])?o:e[1])?a:120));return[l,s]},M=e=>{let{prefixCls:r,trailColor:i=null,strokeLinecap:n="round",gapPosition:o,gapDegree:a,width:s=120,type:c,children:u,success:d,size:m=s,steps:p}=e,[f,g]=I(m,"circle"),{strokeWidth:h}=e;void 0===h&&(h=Math.max(3/f*100,6));let v=t.useMemo(()=>a||0===a?a:"dashboard"===c?75:void 0,[a,c]),y=(({percent:e,success:t,successPercent:r})=>{let i=D(N({success:t,successPercent:r}));return[i,D(D(e)-i)]})(e),b="[object Object]"===Object.prototype.toString.call(e.strokeColor),$=(({success:e={},strokeColor:t})=>{let{strokeColor:r}=e;return[r||j.presetPrimaryColors.green,t||null]})({success:d,strokeColor:e.strokeColor}),S=(0,l.default)(`${r}-inner`,{[`${r}-circle-gradient`]:b}),x=t.createElement(O,{steps:p,percent:p?y[1]:y,strokeWidth:h,trailWidth:h,strokeColor:p?$[1]:$,strokeLinecap:n,trailColor:i,prefixCls:r,gapDegree:v,gapPosition:o||"dashboard"===c&&"bottom"||void 0}),k=f<=20,C=t.createElement("div",{className:S,style:{width:f,height:g,fontSize:.15*f+6}},x,!k&&u);return k?t.createElement(z.default,{title:u},C):C};e.i(296059);var T=e.i(694758),P=e.i(915654),A=e.i(183293),X=e.i(246422),W=e.i(838378);let L="--progress-line-stroke-color",R="--progress-percent",B=e=>{let t=e?"100%":"-100%";return new T.Keyframes(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},q=(0,X.genStyleHooks)("Progress",e=>{let t=e.calc(e.marginXXS).div(2).equal(),r=(0,W.mergeToken)(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,A.resetComponent)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${L})`]},height:"100%",width:`calc(1 / var(${R}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${(0,P.unit)(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:B(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:B(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}})(r),(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}})(r),(e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}})(r),(e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}})(r)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}));var F=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);nt.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r};let H=e=>{let{prefixCls:r,direction:i,percent:n,size:o,strokeWidth:a,strokeColor:s,strokeLinecap:c="round",children:u,trailColor:d=null,percentPosition:m,success:p}=e,{align:f,type:g}=m,h=s&&"string"!=typeof s?((e,t)=>{let{from:r=j.presetPrimaryColors.blue,to:i=j.presetPrimaryColors.blue,direction:n="rtl"===t?"to left":"to right"}=e,o=F(e,["from","to","direction"]);if(0!==Object.keys(o).length){let e,t=(e=[],Object.keys(o).forEach(t=>{let r=Number.parseFloat(t.replace(/%/g,""));Number.isNaN(r)||e.push({key:r,value:o[t]})}),(e=e.sort((e,t)=>e.key-t.key)).map(({key:e,value:t})=>`${t} ${e}%`).join(", ")),r=`linear-gradient(${n}, ${t})`;return{background:r,[L]:r}}let a=`linear-gradient(${n}, ${r}, ${i})`;return{background:a,[L]:a}})(s,i):{[L]:s,background:s},v="square"===c||"butt"===c?0:void 0,[y,b]=I(null!=o?o:[-1,a||("small"===o?6:8)],"line",{strokeWidth:a}),$=Object.assign(Object.assign({width:`${D(n)}%`,height:b,borderRadius:v},h),{[R]:D(n)/100}),S=N(e),x={width:`${D(S)}%`,height:b,borderRadius:v,backgroundColor:null==p?void 0:p.strokeColor},k=t.createElement("div",{className:`${r}-inner`,style:{backgroundColor:d||void 0,borderRadius:v}},t.createElement("div",{className:(0,l.default)(`${r}-bg`,`${r}-bg-${g}`),style:$},"inner"===g&&u),void 0!==S&&t.createElement("div",{className:`${r}-success-bg`,style:x})),C="outer"===g&&"start"===f,w="outer"===g&&"end"===f;return"outer"===g&&"center"===f?t.createElement("div",{className:`${r}-layout-bottom`},k,u):t.createElement("div",{className:`${r}-outer`,style:{width:y<0?"100%":y}},C&&u,k,w&&u)},G=e=>{let{size:r,steps:i,rounding:n=Math.round,percent:o=0,strokeWidth:a=8,strokeColor:s,trailColor:c=null,prefixCls:u,children:d}=e,m=n(o/100*i),[p,f]=I(null!=r?r:["small"===r?2:14,a],"step",{steps:i,strokeWidth:a}),g=p/i,h=Array.from({length:i});for(let e=0;et.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);nt.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r};let K=["normal","exception","active","success"],U=t.forwardRef((e,u)=>{let d,{prefixCls:m,className:p,rootClassName:f,steps:g,strokeColor:h,percent:v=0,size:y="default",showInfo:b=!0,type:$="line",status:S,format:x,style:k,percentPosition:C={}}=e,w=_(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:E="end",type:O="outer"}=C,z=Array.isArray(h)?h[0]:h,j="string"==typeof h||Array.isArray(h)?h:void 0,T=t.useMemo(()=>{if(z){let e="string"==typeof z?z:Object.values(z)[0];return new r.FastColor(e).isLight()}return!1},[h]),P=t.useMemo(()=>{var t,r;let i=N(e);return Number.parseInt(void 0!==i?null==(t=null!=i?i:0)?void 0:t.toString():null==(r=null!=v?v:0)?void 0:r.toString(),10)},[v,e.success,e.successPercent]),A=t.useMemo(()=>!K.includes(S)&&P>=100?"success":S||"normal",[S,P]),{getPrefixCls:X,direction:W,progress:L}=t.useContext(c.ConfigContext),R=X("progress",m),[B,F,U]=q(R),V="line"===$,Q=V&&!g,Y=t.useMemo(()=>{let r;if(!b)return null;let s=N(e),c=x||(e=>`${e}%`),u=V&&T&&"inner"===O;return"inner"===O||x||"exception"!==A&&"success"!==A?r=c(D(v),D(s)):"exception"===A?r=V?t.createElement(o.default,null):t.createElement(a.default,null):"success"===A&&(r=V?t.createElement(i.default,null):t.createElement(n.default,null)),t.createElement("span",{className:(0,l.default)(`${R}-text`,{[`${R}-text-bright`]:u,[`${R}-text-${E}`]:Q,[`${R}-text-${O}`]:Q}),title:"string"==typeof r?r:void 0},r)},[b,v,P,A,$,R,x]);"line"===$?d=g?t.createElement(G,Object.assign({},e,{strokeColor:j,prefixCls:R,steps:"object"==typeof g?g.count:g}),Y):t.createElement(H,Object.assign({},e,{strokeColor:z,prefixCls:R,direction:W,percentPosition:{align:E,type:O}}),Y):("circle"===$||"dashboard"===$)&&(d=t.createElement(M,Object.assign({},e,{strokeColor:z,prefixCls:R,progressStatus:A}),Y));let J=(0,l.default)(R,`${R}-status-${A}`,{[`${R}-${"dashboard"===$&&"circle"||$}`]:"line"!==$,[`${R}-inline-circle`]:"circle"===$&&I(y,"circle")[0]<=20,[`${R}-line`]:Q,[`${R}-line-align-${E}`]:Q,[`${R}-line-position-${O}`]:Q,[`${R}-steps`]:g,[`${R}-show-info`]:b,[`${R}-${y}`]:"string"==typeof y,[`${R}-rtl`]:"rtl"===W},null==L?void 0:L.className,p,f,F,U);return B(t.createElement("div",Object.assign({ref:u,style:Object.assign(Object.assign({},null==L?void 0:L.style),k),className:J,role:"progressbar","aria-valuenow":P,"aria-valuemin":0,"aria-valuemax":100},(0,s.default)(w,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),d))});e.s(["default",0,U],309821)},597440,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={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"};var n=e.i(9583),o=r.forwardRef(function(e,o){return r.createElement(n.default,(0,t.default)({},e,{ref:o,icon:i}))});e.s(["default",0,o],597440)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/341e7c75250f4f40.js b/litellm/proxy/_experimental/out/_next/static/chunks/341e7c75250f4f40.js
deleted file mode 100644
index 80bb268310..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/341e7c75250f4f40.js
+++ /dev/null
@@ -1,598 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,818581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return r}});let s=e.r(271645);function r(e,t){let a=(0,s.useRef)(null),r=(0,s.useRef)(null);return(0,s.useCallback)(s=>{if(null===s){let e=a.current;e&&(a.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(a.current=i(e,s)),t&&(r.current=i(t,s))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},62478,e=>{"use strict";var t=e.i(764205);let a=async e=>{if(!e)return null;try{return await (0,t.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}};e.s(["fetchProxySettings",0,a])},602073,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let s={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"};var r=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(r.default,(0,t.default)({},e,{ref:i,icon:s}))});e.s(["SafetyOutlined",0,i],602073)},190272,785913,e=>{"use strict";var t,a,s=((t={}).AUDIO_SPEECH="audio_speech",t.AUDIO_TRANSCRIPTION="audio_transcription",t.IMAGE_GENERATION="image_generation",t.VIDEO_GENERATION="video_generation",t.CHAT="chat",t.RESPONSES="responses",t.IMAGE_EDITS="image_edits",t.ANTHROPIC_MESSAGES="anthropic_messages",t.EMBEDDING="embedding",t),r=((a={}).IMAGE="image",a.VIDEO="video",a.CHAT="chat",a.RESPONSES="responses",a.IMAGE_EDITS="image_edits",a.ANTHROPIC_MESSAGES="anthropic_messages",a.EMBEDDINGS="embeddings",a.SPEECH="speech",a.TRANSCRIPTION="transcription",a.A2A_AGENTS="a2a_agents",a.MCP="mcp",a.REALTIME="realtime",a);let i={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"};e.s(["EndpointType",()=>r,"getEndpointType",0,e=>{if(console.log("getEndpointType:",e),Object.values(s).includes(e)){let t=i[e];return console.log("endpointType:",t),t}return"chat"}],785913),e.s(["generateCodeSnippet",0,e=>{let t,{apiKeySource:a,accessToken:s,apiKey:i,inputMessage:l,chatHistory:n,selectedTags:o,selectedVectorStores:c,selectedGuardrails:d,selectedPolicies:m,selectedMCPServers:p,mcpServers:u,mcpServerToolRestrictions:g,selectedVoice:x,endpointType:h,selectedModel:f,selectedSdk:_,proxySettings:b}=e,y="session"===a?s:i,v=window.location.origin,j=b?.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?v=j:b?.PROXY_BASE_URL&&(v=b.PROXY_BASE_URL);let A=l||"Your prompt here",N=A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),T=n.filter(e=>!e.isImage).map(({role:e,content:t})=>({role:e,content:t})),S={};o.length>0&&(S.tags=o),c.length>0&&(S.vector_stores=c),d.length>0&&(S.guardrails=d),m.length>0&&(S.policies=m);let C=f||"your-model-name",w="azure"===_?`import openai
-
-client = openai.AzureOpenAI(
- api_key="${y||"YOUR_LITELLM_API_KEY"}",
- azure_endpoint="${v}",
- api_version="2024-02-01"
-)`:`import openai
-
-client = openai.OpenAI(
- api_key="${y||"YOUR_LITELLM_API_KEY"}",
- base_url="${v}"
-)`;switch(h){case r.CHAT:{let e=Object.keys(S).length>0,a="";if(e){let e=JSON.stringify({metadata:S},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();a=`,
- extra_body=${e}`}let s=T.length>0?T:[{role:"user",content:A}];t=`
-import base64
-
-# Helper function to encode images to base64
-def encode_image(image_path):
- with open(image_path, "rb") as image_file:
- return base64.b64encode(image_file.read()).decode('utf-8')
-
-# Example with text only
-response = client.chat.completions.create(
- model="${C}",
- messages=${JSON.stringify(s,null,4)}${a}
-)
-
-print(response)
-
-# Example with image or PDF (uncomment and provide file path to use)
-# base64_file = encode_image("path/to/your/file.jpg") # or .pdf
-# response_with_file = client.chat.completions.create(
-# model="${C}",
-# messages=[
-# {
-# "role": "user",
-# "content": [
-# {
-# "type": "text",
-# "text": "${N}"
-# },
-# {
-# "type": "image_url",
-# "image_url": {
-# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}
-# }
-# }
-# ]
-# }
-# ]${a}
-# )
-# print(response_with_file)
-`;break}case r.RESPONSES:{let e=Object.keys(S).length>0,a="";if(e){let e=JSON.stringify({metadata:S},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();a=`,
- extra_body=${e}`}let s=T.length>0?T:[{role:"user",content:A}];t=`
-import base64
-
-# Helper function to encode images to base64
-def encode_image(image_path):
- with open(image_path, "rb") as image_file:
- return base64.b64encode(image_file.read()).decode('utf-8')
-
-# Example with text only
-response = client.responses.create(
- model="${C}",
- input=${JSON.stringify(s,null,4)}${a}
-)
-
-print(response.output_text)
-
-# Example with image or PDF (uncomment and provide file path to use)
-# base64_file = encode_image("path/to/your/file.jpg") # or .pdf
-# response_with_file = client.responses.create(
-# model="${C}",
-# input=[
-# {
-# "role": "user",
-# "content": [
-# {"type": "input_text", "text": "${N}"},
-# {
-# "type": "input_image",
-# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}
-# },
-# ],
-# }
-# ]${a}
-# )
-# print(response_with_file.output_text)
-`;break}case r.IMAGE:t="azure"===_?`
-# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.
-# This snippet uses 'client.images.generate' and will create a new image based on your prompt.
-# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.
-import os
-import requests
-import json
-import time
-from PIL import Image
-
-result = client.images.generate(
- model="${C}",
- prompt="${l}",
- n=1
-)
-
-json_response = json.loads(result.model_dump_json())
-
-# Set the directory for the stored image
-image_dir = os.path.join(os.curdir, 'images')
-
-# If the directory doesn't exist, create it
-if not os.path.isdir(image_dir):
- os.mkdir(image_dir)
-
-# Initialize the image path
-image_filename = f"generated_image_{int(time.time())}.png"
-image_path = os.path.join(image_dir, image_filename)
-
-try:
- # Retrieve the generated image
- if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):
- image_url = json_response["data"][0]["url"]
- generated_image = requests.get(image_url).content
- with open(image_path, "wb") as image_file:
- image_file.write(generated_image)
-
- print(f"Image saved to {image_path}")
- # Display the image
- image = Image.open(image_path)
- image.show()
- else:
- print("Could not find image URL in response.")
- print("Full response:", json_response)
-except Exception as e:
- print(f"An error occurred: {e}")
- print("Full response:", json_response)
-`:`
-import base64
-import os
-import time
-import json
-from PIL import Image
-import requests
-
-# Helper function to encode images to base64
-def encode_image(image_path):
- with open(image_path, "rb") as image_file:
- return base64.b64encode(image_file.read()).decode('utf-8')
-
-# Helper function to create a file (simplified for this example)
-def create_file(image_path):
- # In a real implementation, this would upload the file to OpenAI
- # For this example, we'll just return a placeholder ID
- return f"file_{os.path.basename(image_path).replace('.', '_')}"
-
-# The prompt entered by the user
-prompt = "${N}"
-
-# Encode images to base64
-base64_image1 = encode_image("body-lotion.png")
-base64_image2 = encode_image("soap.png")
-
-# Create file IDs
-file_id1 = create_file("body-lotion.png")
-file_id2 = create_file("incense-kit.png")
-
-response = client.responses.create(
- model="${C}",
- input=[
- {
- "role": "user",
- "content": [
- {"type": "input_text", "text": prompt},
- {
- "type": "input_image",
- "image_url": f"data:image/jpeg;base64,{base64_image1}",
- },
- {
- "type": "input_image",
- "image_url": f"data:image/jpeg;base64,{base64_image2}",
- },
- {
- "type": "input_image",
- "file_id": file_id1,
- },
- {
- "type": "input_image",
- "file_id": file_id2,
- }
- ],
- }
- ],
- tools=[{"type": "image_generation"}],
-)
-
-# Process the response
-image_generation_calls = [
- output
- for output in response.output
- if output.type == "image_generation_call"
-]
-
-image_data = [output.result for output in image_generation_calls]
-
-if image_data:
- image_base64 = image_data[0]
- image_filename = f"edited_image_{int(time.time())}.png"
- with open(image_filename, "wb") as f:
- f.write(base64.b64decode(image_base64))
- print(f"Image saved to {image_filename}")
-else:
- # If no image is generated, there might be a text response with an explanation
- text_response = [output.text for output in response.output if hasattr(output, 'text')]
- if text_response:
- print("No image generated. Model response:")
- print("\\n".join(text_response))
- else:
- print("No image data found in response.")
- print("Full response for debugging:")
- print(response)
-`;break;case r.IMAGE_EDITS:t="azure"===_?`
-import base64
-import os
-import time
-import json
-from PIL import Image
-import requests
-
-# Helper function to encode images to base64
-def encode_image(image_path):
- with open(image_path, "rb") as image_file:
- return base64.b64encode(image_file.read()).decode('utf-8')
-
-# The prompt entered by the user
-prompt = "${N}"
-
-# Encode images to base64
-base64_image1 = encode_image("body-lotion.png")
-base64_image2 = encode_image("soap.png")
-
-# Create file IDs
-file_id1 = create_file("body-lotion.png")
-file_id2 = create_file("incense-kit.png")
-
-response = client.responses.create(
- model="${C}",
- input=[
- {
- "role": "user",
- "content": [
- {"type": "input_text", "text": prompt},
- {
- "type": "input_image",
- "image_url": f"data:image/jpeg;base64,{base64_image1}",
- },
- {
- "type": "input_image",
- "image_url": f"data:image/jpeg;base64,{base64_image2}",
- },
- {
- "type": "input_image",
- "file_id": file_id1,
- },
- {
- "type": "input_image",
- "file_id": file_id2,
- }
- ],
- }
- ],
- tools=[{"type": "image_generation"}],
-)
-
-# Process the response
-image_generation_calls = [
- output
- for output in response.output
- if output.type == "image_generation_call"
-]
-
-image_data = [output.result for output in image_generation_calls]
-
-if image_data:
- image_base64 = image_data[0]
- image_filename = f"edited_image_{int(time.time())}.png"
- with open(image_filename, "wb") as f:
- f.write(base64.b64decode(image_base64))
- print(f"Image saved to {image_filename}")
-else:
- # If no image is generated, there might be a text response with an explanation
- text_response = [output.text for output in response.output if hasattr(output, 'text')]
- if text_response:
- print("No image generated. Model response:")
- print("\\n".join(text_response))
- else:
- print("No image data found in response.")
- print("Full response for debugging:")
- print(response)
-`:`
-import base64
-import os
-import time
-
-# Helper function to encode images to base64
-def encode_image(image_path):
- with open(image_path, "rb") as image_file:
- return base64.b64encode(image_file.read()).decode('utf-8')
-
-# Helper function to create a file (simplified for this example)
-def create_file(image_path):
- # In a real implementation, this would upload the file to OpenAI
- # For this example, we'll just return a placeholder ID
- return f"file_{os.path.basename(image_path).replace('.', '_')}"
-
-# The prompt entered by the user
-prompt = "${N}"
-
-# Encode images to base64
-base64_image1 = encode_image("body-lotion.png")
-base64_image2 = encode_image("soap.png")
-
-# Create file IDs
-file_id1 = create_file("body-lotion.png")
-file_id2 = create_file("incense-kit.png")
-
-response = client.responses.create(
- model="${C}",
- input=[
- {
- "role": "user",
- "content": [
- {"type": "input_text", "text": prompt},
- {
- "type": "input_image",
- "image_url": f"data:image/jpeg;base64,{base64_image1}",
- },
- {
- "type": "input_image",
- "image_url": f"data:image/jpeg;base64,{base64_image2}",
- },
- {
- "type": "input_image",
- "file_id": file_id1,
- },
- {
- "type": "input_image",
- "file_id": file_id2,
- }
- ],
- }
- ],
- tools=[{"type": "image_generation"}],
-)
-
-# Process the response
-image_generation_calls = [
- output
- for output in response.output
- if output.type == "image_generation_call"
-]
-
-image_data = [output.result for output in image_generation_calls]
-
-if image_data:
- image_base64 = image_data[0]
- image_filename = f"edited_image_{int(time.time())}.png"
- with open(image_filename, "wb") as f:
- f.write(base64.b64decode(image_base64))
- print(f"Image saved to {image_filename}")
-else:
- # If no image is generated, there might be a text response with an explanation
- text_response = [output.text for output in response.output if hasattr(output, 'text')]
- if text_response:
- print("No image generated. Model response:")
- print("\\n".join(text_response))
- else:
- print("No image data found in response.")
- print("Full response for debugging:")
- print(response)
-`;break;case r.EMBEDDINGS:t=`
-response = client.embeddings.create(
- input="${l||"Your string here"}",
- model="${C}",
- encoding_format="base64" # or "float"
-)
-
-print(response.data[0].embedding)
-`;break;case r.TRANSCRIPTION:t=`
-# Open the audio file
-audio_file = open("path/to/your/audio/file.mp3", "rb")
-
-# Make the transcription request
-response = client.audio.transcriptions.create(
- model="${C}",
- file=audio_file${l?`,
- prompt="${l.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:""}
-)
-
-print(response.text)
-`;break;case r.SPEECH:t=`
-# Make the text-to-speech request
-response = client.audio.speech.create(
- model="${C}",
- input="${l||"Your text to convert to speech here"}",
- voice="${x}" # Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer
-)
-
-# Save the audio to a file
-output_filename = "output_speech.mp3"
-response.stream_to_file(output_filename)
-print(f"Audio saved to {output_filename}")
-
-# Optional: Customize response format and speed
-# response = client.audio.speech.create(
-# model="${C}",
-# input="${l||"Your text to convert to speech here"}",
-# voice="alloy",
-# response_format="mp3", # Options: mp3, opus, aac, flac, wav, pcm
-# speed=1.0 # Range: 0.25 to 4.0
-# )
-# response.stream_to_file("output_speech.mp3")
-`;break;default:t="\n# Code generation for this endpoint is not implemented yet."}return`${w}
-${t}`}],190272)},652272,209261,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(447566),r=e.i(166406),i=e.i(492030),l=e.i(596239);let n=e=>"github"===e.source.source&&e.source.repo?`/plugin marketplace add ${e.source.repo}`:"url"===e.source.source&&e.source.url?`/plugin marketplace add ${e.source.url}`:`/plugin marketplace add ${e.name}`;e.s(["formatInstallCommand",0,n,"getCategoryBadgeColor",0,e=>{if(!e)return"gray";let t=e.toLowerCase();if(t.includes("development")||t.includes("dev"))return"blue";if(t.includes("productivity")||t.includes("workflow"))return"green";if(t.includes("learning")||t.includes("education"))return"purple";if(t.includes("security")||t.includes("safety"))return"red";if(t.includes("data")||t.includes("analytics"))return"orange";else if(t.includes("integration")||t.includes("api"))return"yellow";return"gray"},"isValidEmail",0,e=>!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),"isValidSemanticVersion",0,e=>!e||/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(e),"isValidUrl",0,e=>{if(!e)return!0;try{return new URL(e),!0}catch{return!1}},"parseKeywords",0,e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>""!==e):[],"validatePluginName",0,e=>!!e&&""!==e.trim()&&/^[a-z0-9-]+$/.test(e)],209261),e.s(["default",0,({skill:e,onBack:o})=>{let c,[d,m]=(0,a.useState)("overview"),[p,u]=(0,a.useState)(null),g=(e,t)=>{navigator.clipboard.writeText(e),u(t),setTimeout(()=>u(null),2e3)},x="github"===(c=e.source).source&&c.repo?`https://github.com/${c.repo}`:"git-subdir"===c.source&&c.url?c.path?`${c.url}/tree/main/${c.path}`:c.url:"url"===c.source&&c.url?c.url:null,h=n(e),f=[...e.category?[{property:"Category",value:e.category}]:[],...e.domain?[{property:"Domain",value:e.domain}]:[],...e.namespace?[{property:"Namespace",value:e.namespace}]:[],...e.version?[{property:"Version",value:e.version}]:[],...e.author?.name?[{property:"Author",value:e.author.name}]:[],...e.created_at?[{property:"Added",value:new Date(e.created_at).toLocaleDateString()}]:[]];return(0,t.jsxs)("div",{style:{padding:"24px 32px 24px 0"},children:[(0,t.jsxs)("div",{onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(s.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:"Skills"})]}),(0,t.jsxs)("div",{style:{marginBottom:8},children:[(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name}),e.description&&(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"8px 0 0 0",lineHeight:1.6},children:e.description})]}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28,marginTop:24},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:[{key:"overview",label:"Overview"},{key:"usage",label:"How to Use"}].map(e=>(0,t.jsx)("div",{onClick:()=>m(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Skill Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Metadata registered with this skill"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:160},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:f.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},a))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Status"}),(0,t.jsx)("span",{style:{fontSize:12,padding:"3px 10px",borderRadius:12,backgroundColor:e.enabled?"#e6f4ea":"#f1f3f4",color:e.enabled?"#137333":"#5f6368",fontWeight:500},children:e.enabled?"Public":"Draft"})]}),x&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Source"}),(0,t.jsxs)("a",{href:x,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,color:"#1a73e8",wordBreak:"break-all",display:"flex",alignItems:"center",gap:4},children:[x.replace("https://",""),(0,t.jsx)(l.LinkOutlined,{style:{fontSize:11,flexShrink:0}})]})]}),e.keywords&&e.keywords.length>0&&(0,t.jsxs)("div",{style:{marginBottom:24},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.keywords.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Skill ID"}),(0,t.jsx)("div",{style:{fontSize:12,fontFamily:"monospace",color:"#3c4043",wordBreak:"break-all"},children:e.id})]})]})]}),"usage"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"Using this skill"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:"Once your proxy is set as a marketplace, enable this skill in Claude Code with one command:"}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden",marginBottom:24},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"Run in Claude Code"}),(0,t.jsxs)("button",{onClick:()=>g(h,"install"),style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"install"===p?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["install"===p?(0,t.jsx)(i.CheckOutlined,{}):(0,t.jsx)(r.CopyOutlined,{}),"install"===p?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:14,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:h})]}),(0,t.jsxs)("p",{style:{fontSize:13,color:"#5f6368",lineHeight:1.6,margin:0},children:["Don't have the marketplace configured yet?"," ",(0,t.jsx)("span",{onClick:()=>m("setup"),style:{color:"#1a73e8",cursor:"pointer"},children:"See one-time setup →"})]})]}),"setup"===d&&(0,t.jsxs)("div",{style:{maxWidth:640},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 8px 0"},children:"One-time marketplace setup"}),(0,t.jsxs)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 24px 0",lineHeight:1.6},children:["Add this to ",(0,t.jsx)("code",{style:{fontSize:13,backgroundColor:"#f1f3f4",padding:"1px 6px",borderRadius:4},children:"~/.claude/settings.json"})," to point Claude Code at your proxy:"]}),(0,t.jsxs)("div",{style:{border:"1px solid #dadce0",borderRadius:8,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("span",{style:{fontSize:13,color:"#3c4043",fontWeight:500},children:"~/.claude/settings.json"}),(0,t.jsxs)("button",{onClick:()=>{g(JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2),"settings")},style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"settings"===p?"#137333":"#1a73e8",background:"none",border:"none",cursor:"pointer",padding:0},children:["settings"===p?(0,t.jsx)(i.CheckOutlined,{}):(0,t.jsx)(r.CopyOutlined,{}),"settings"===p?"Copied":"Copy"]})]}),(0,t.jsx)("pre",{style:{margin:0,padding:"14px 16px",fontSize:13,fontFamily:"monospace",color:"#202124",backgroundColor:"#fff"},children:JSON.stringify({extraKnownMarketplaces:{"my-org":{source:"url",url:`${window.location.origin}/claude-code/marketplace.json`}}},null,2)})]})]})]})}],652272)},115571,e=>{"use strict";let t="local-storage-change";function a(e){window.dispatchEvent(new CustomEvent(t,{detail:{key:e}}))}function s(e){try{return window.localStorage.getItem(e)}catch(t){return console.warn(`Error reading localStorage key "${e}":`,t),null}}function r(e,t){try{window.localStorage.setItem(e,t)}catch(t){console.warn(`Error setting localStorage key "${e}":`,t)}}function i(e){try{window.localStorage.removeItem(e)}catch(t){console.warn(`Error removing localStorage key "${e}":`,t)}}e.s(["LOCAL_STORAGE_EVENT",0,t,"emitLocalStorageChange",()=>a,"getLocalStorageItem",()=>s,"removeLocalStorageItem",()=>i,"setLocalStorageItem",()=>r])},596239,e=>{"use strict";e.i(247167);var t=e.i(931067),a=e.i(271645);let s={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"};var r=e.i(9583),i=a.forwardRef(function(e,i){return a.createElement(r.default,(0,t.default)({},e,{ref:i,icon:s}))});e.s(["LinkOutlined",0,i],596239)},928685,e=>{"use strict";var t=e.i(38953);e.s(["SearchOutlined",()=>t.default])},879664,e=>{"use strict";let t=(0,e.i(475254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",()=>t])},916925,e=>{"use strict";var t,a=((t={}).A2A_Agent="A2A Agent",t.AI21="Ai21",t.AI21_CHAT="Ai21 Chat",t.AIML="AI/ML API",t.AIOHTTP_OPENAI="Aiohttp Openai",t.Anthropic="Anthropic",t.ANTHROPIC_TEXT="Anthropic Text",t.AssemblyAI="AssemblyAI",t.AUTO_ROUTER="Auto Router",t.Bedrock="Amazon Bedrock",t.BedrockMantle="Amazon Bedrock Mantle",t.SageMaker="AWS SageMaker",t.Azure="Azure",t.Azure_AI_Studio="Azure AI Foundry (Studio)",t.AZURE_TEXT="Azure Text",t.BASETEN="Baseten",t.BYTEZ="Bytez",t.Cerebras="Cerebras",t.CLARIFAI="Clarifai",t.CLOUDFLARE="Cloudflare",t.CODESTRAL="Codestral",t.Cohere="Cohere",t.COHERE_CHAT="Cohere Chat",t.COMETAPI="Cometapi",t.COMPACTIFAI="Compactifai",t.Cursor="Cursor",t.Dashscope="Dashscope",t.Databricks="Databricks (Qwen API)",t.DATAROBOT="Datarobot",t.DeepInfra="DeepInfra",t.Deepgram="Deepgram",t.Deepseek="Deepseek",t.DOCKER_MODEL_RUNNER="Docker Model Runner",t.DOTPROMPT="Dotprompt",t.ElevenLabs="ElevenLabs",t.EMPOWER="Empower",t.FalAI="Fal AI",t.FEATHERLESS_AI="Featherless Ai",t.FireworksAI="Fireworks AI",t.FRIENDLIAI="Friendliai",t.GALADRIEL="Galadriel",t.GITHUB_COPILOT="Github Copilot",t.Google_AI_Studio="Google AI Studio",t.GradientAI="GradientAI",t.Groq="Groq",t.HEROKU="Heroku",t.Hosted_Vllm="vllm",t.HUGGINGFACE="Huggingface",t.HYPERBOLIC="Hyperbolic",t.Infinity="Infinity",t.JinaAI="Jina AI",t.LAMBDA_AI="Lambda Ai",t.LEMONADE="Lemonade",t.LLAMAFILE="Llamafile",t.LM_STUDIO="Lm Studio",t.LLAMA="Meta Llama",t.MARITALK="Maritalk",t.MiniMax="MiniMax",t.MistralAI="Mistral AI",t.MOONSHOT="Moonshot",t.MORPH="Morph",t.NEBIUS="Nebius",t.NLP_CLOUD="Nlp Cloud",t.NOVITA="Novita",t.NSCALE="Nscale",t.NVIDIA_NIM="Nvidia Nim",t.Ollama="Ollama",t.OLLAMA_CHAT="Ollama Chat",t.OOBABOOGA="Oobabooga",t.OpenAI="OpenAI",t.OPENAI_LIKE="Openai Like",t.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",t.OpenAI_Text="OpenAI Text Completion",t.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",t.Openrouter="Openrouter",t.Oracle="Oracle Cloud Infrastructure (OCI)",t.OVHCLOUD="Ovhcloud",t.Perplexity="Perplexity",t.PETALS="Petals",t.PG_VECTOR="Pg Vector",t.PREDIBASE="Predibase",t.RECRAFT="Recraft",t.REPLICATE="Replicate",t.RunwayML="RunwayML",t.SAGEMAKER_LEGACY="Sagemaker",t.Sambanova="Sambanova",t.SAP="SAP Generative AI Hub",t.Snowflake="Snowflake",t.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",t.TogetherAI="TogetherAI",t.TOPAZ="Topaz",t.Triton="Triton",t.V0="V0",t.VERCEL_AI_GATEWAY="Vercel Ai Gateway",t.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",t.VERTEX_AI_BETA="Vertex Ai Beta",t.VLLM="Vllm",t.VolcEngine="VolcEngine",t.Voyage="Voyage AI",t.WANDB="Wandb",t.WATSONX="Watsonx",t.WATSONX_TEXT="Watsonx Text",t.xAI="xAI",t.XINFERENCE="Xinference",t);let s={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference"},r="../ui/assets/logos/",i={"A2A Agent":`${r}a2a_agent.png`,Ai21:`${r}ai21.svg`,"Ai21 Chat":`${r}ai21.svg`,"AI/ML API":`${r}aiml_api.svg`,"Aiohttp Openai":`${r}openai_small.svg`,Anthropic:`${r}anthropic.svg`,"Anthropic Text":`${r}anthropic.svg`,AssemblyAI:`${r}assemblyai_small.png`,Azure:`${r}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${r}microsoft_azure.svg`,"Azure Text":`${r}microsoft_azure.svg`,Baseten:`${r}baseten.svg`,"Amazon Bedrock":`${r}bedrock.svg`,"Amazon Bedrock Mantle":`${r}bedrock.svg`,"AWS SageMaker":`${r}bedrock.svg`,Cerebras:`${r}cerebras.svg`,Cloudflare:`${r}cloudflare.svg`,Codestral:`${r}mistral.svg`,Cohere:`${r}cohere.svg`,"Cohere Chat":`${r}cohere.svg`,Cometapi:`${r}cometapi.svg`,Cursor:`${r}cursor.svg`,"Databricks (Qwen API)":`${r}databricks.svg`,Dashscope:`${r}dashscope.svg`,Deepseek:`${r}deepseek.svg`,Deepgram:`${r}deepgram.png`,DeepInfra:`${r}deepinfra.png`,ElevenLabs:`${r}elevenlabs.png`,"Fal AI":`${r}fal_ai.jpg`,"Featherless Ai":`${r}featherless.svg`,"Fireworks AI":`${r}fireworks.svg`,Friendliai:`${r}friendli.svg`,"Github Copilot":`${r}github_copilot.svg`,"Google AI Studio":`${r}google.svg`,GradientAI:`${r}gradientai.svg`,Groq:`${r}groq.svg`,vllm:`${r}vllm.png`,Huggingface:`${r}huggingface.svg`,Hyperbolic:`${r}hyperbolic.svg`,Infinity:`${r}infinity.png`,"Jina AI":`${r}jina.png`,"Lambda Ai":`${r}lambda.svg`,"Lm Studio":`${r}lmstudio.svg`,"Meta Llama":`${r}meta_llama.svg`,MiniMax:`${r}minimax.svg`,"Mistral AI":`${r}mistral.svg`,Moonshot:`${r}moonshot.svg`,Morph:`${r}morph.svg`,Nebius:`${r}nebius.svg`,Novita:`${r}novita.svg`,"Nvidia Nim":`${r}nvidia_nim.svg`,Ollama:`${r}ollama.svg`,"Ollama Chat":`${r}ollama.svg`,Oobabooga:`${r}openai_small.svg`,OpenAI:`${r}openai_small.svg`,"Openai Like":`${r}openai_small.svg`,"OpenAI Text Completion":`${r}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${r}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${r}openai_small.svg`,Openrouter:`${r}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${r}oracle.svg`,Perplexity:`${r}perplexity-ai.svg`,Recraft:`${r}recraft.svg`,Replicate:`${r}replicate.svg`,RunwayML:`${r}runwayml.png`,Sagemaker:`${r}bedrock.svg`,Sambanova:`${r}sambanova.svg`,"SAP Generative AI Hub":`${r}sap.png`,Snowflake:`${r}snowflake.svg`,"Text-Completion-Codestral":`${r}mistral.svg`,TogetherAI:`${r}togetherai.svg`,Topaz:`${r}topaz.svg`,Triton:`${r}nvidia_triton.png`,V0:`${r}v0.svg`,"Vercel Ai Gateway":`${r}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${r}google.svg`,"Vertex Ai Beta":`${r}google.svg`,Vllm:`${r}vllm.png`,VolcEngine:`${r}volcengine.png`,"Voyage AI":`${r}voyage.webp`,Watsonx:`${r}watsonx.svg`,"Watsonx Text":`${r}watsonx.svg`,xAI:`${r}xai.svg`,Xinference:`${r}xinference.svg`};e.s(["Providers",()=>a,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:i[e],displayName:e}}let t=Object.keys(s).find(t=>s[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let r=a[t];return{logo:i[r],displayName:r}},"getProviderModels",0,(e,t)=>{console.log(`Provider key: ${e}`);let a=s[e];console.log(`Provider mapped to: ${a}`);let r=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(([e,t])=>{if(null!==t&&"object"==typeof t&&"litellm_provider"in t){let s=t.litellm_provider;(s===a||"string"==typeof s&&s.includes(a))&&r.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"cohere_chat"===t.litellm_provider&&r.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(([e,t])=>{null!==t&&"object"==typeof t&&"litellm_provider"in t&&"sagemaker_chat"===t.litellm_provider&&r.push(e)}))),r},"providerLogoMap",0,i,"provider_map",0,s])},798496,e=>{"use strict";var t=e.i(843476),a=e.i(152990),s=e.i(682830),r=e.i(271645),i=e.i(269200),l=e.i(427612),n=e.i(64848),o=e.i(942232),c=e.i(496020),d=e.i(977572),m=e.i(94629),p=e.i(360820),u=e.i(871943);function g({data:e=[],columns:g,isLoading:x=!1,defaultSorting:h=[],pagination:f,onPaginationChange:_,enablePagination:b=!1,onRowClick:y}){let[v,j]=r.default.useState(h),[A]=r.default.useState("onChange"),[N,T]=r.default.useState({}),[S,C]=r.default.useState({}),w=(0,a.useReactTable)({data:e,columns:g,state:{sorting:v,columnSizing:N,columnVisibility:S,...b&&f?{pagination:f}:{}},columnResizeMode:A,onSortingChange:j,onColumnSizingChange:T,onColumnVisibilityChange:C,...b&&_?{onPaginationChange:_}:{},getCoreRowModel:(0,s.getCoreRowModel)(),getSortedRowModel:(0,s.getSortedRowModel)(),...b?{getPaginationRowModel:(0,s.getPaginationRowModel)()}:{},enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("div",{className:"relative min-w-full",children:(0,t.jsxs)(i.Table,{className:"[&_td]:py-2 [&_th]:py-2",style:{width:w.getTotalSize(),minWidth:"100%",tableLayout:"fixed"},children:[(0,t.jsx)(l.TableHead,{children:w.getHeaderGroups().map(e=>(0,t.jsx)(c.TableRow,{children:e.headers.map(e=>(0,t.jsxs)(n.TableHeaderCell,{className:`py-1 h-8 relative ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,a.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(p.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(u.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(m.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,t.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 ${e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200"}`})]},e.id))},e.id))}),(0,t.jsx)(o.TableBody,{children:x?(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:g.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"🚅 Loading models..."})})})}):w.getRowModel().rows.length>0?w.getRowModel().rows.map(e=>(0,t.jsx)(c.TableRow,{onClick:()=>y?.(e.original),className:y?"cursor-pointer hover:bg-gray-50":"",children:e.getVisibleCells().map(e=>(0,t.jsx)(d.TableCell,{className:`py-0.5 overflow-hidden ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""} ${e.column.columnDef.meta?.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.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:g.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No models found"})})})})})]})})})})}e.s(["ModelDataTable",()=>g])},737033,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(599724),r=e.i(928685),i=e.i(311451),l=e.i(199133),n=e.i(798496),o=e.i(389083),c=e.i(592968),d=e.i(166406),m=e.i(596239),p=e.i(652272);e.s(["default",0,({skills:e,isLoading:u,isAdmin:g,accessToken:x,publicPage:h=!1,onPublishSuccess:f})=>{let[_,b]=(0,a.useState)(""),[y,v]=(0,a.useState)(void 0),[j,A]=(0,a.useState)(null),N=e.length,T=(0,a.useMemo)(()=>[...new Set(e.map(e=>e.domain).filter(Boolean))],[e]),S=(0,a.useMemo)(()=>[...new Set(e.map(e=>e.namespace).filter(Boolean))],[e]),C=(0,a.useMemo)(()=>{let t=e;if(y&&(t=t.filter(e=>(e.domain||"General")===y)),_.trim()){let e=_.toLowerCase();t=t.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.domain?.toLowerCase().includes(e)||t.namespace?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))}return t},[e,_,y]);return j?(0,t.jsx)(p.default,{skill:j,onBack:()=>A(null),isAdmin:g,accessToken:x,onPublishClick:f}):u?(0,t.jsx)("div",{className:"text-center py-16 text-gray-400",children:"Loading skills..."}):(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Total Skills"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:N})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Namespaces"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:S.length})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Domains"}),(0,t.jsx)("div",{className:"text-2xl font-semibold text-gray-900",children:T.length})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("h3",{className:"text-sm font-semibold text-gray-700",children:["All ",h?"Public ":"","Skills"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Select,{placeholder:"All Domains",allowClear:!0,value:y,onChange:e=>v(e),style:{width:160},options:T.map(e=>({label:e,value:e}))}),(0,t.jsx)(i.Input,{prefix:(0,t.jsx)(r.SearchOutlined,{className:"text-gray-400"}),placeholder:"Search by name, namespace, or tag…",value:_,onChange:e=>b(e.target.value),style:{width:280},allowClear:!0})]})]}),(0,t.jsx)(n.ModelDataTable,{columns:((e,a,r=!1)=>[{header:"Skill Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:({row:r})=>{let i=r.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)("button",{type:"button",className:"font-medium text-sm cursor-pointer text-blue-600 hover:underline bg-transparent border-none p-0",onClick:()=>e(i),children:i.name}),(0,t.jsx)(c.Tooltip,{title:"Copy skill name",children:(0,t.jsx)(d.CopyOutlined,{onClick:()=>a(i.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),i.description&&(0,t.jsx)(s.Text,{className:"text-xs text-gray-500 line-clamp-1 md:hidden",children:i.description})]})}},{header:"Description",accessorKey:"description",enableSorting:!1,cell:({row:e})=>(0,t.jsx)(s.Text,{className:"text-xs line-clamp-2",children:e.original.description||"-"})},{header:"Category",accessorKey:"category",enableSorting:!0,cell:({row:e})=>{let a=e.original.category;return a?(0,t.jsx)(o.Badge,{color:"blue",size:"xs",children:a}):(0,t.jsx)(s.Text,{className:"text-xs text-gray-400",children:"-"})}},{header:"Domain",accessorKey:"domain",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(s.Text,{className:"text-xs",children:e.original.domain||"-"})},{header:"Source",accessorKey:"source",enableSorting:!1,cell:({row:e})=>{let a=e.original.source,r=null,i="-";return(a?.source==="github"&&a.repo?(r=`https://github.com/${a.repo}`,i=a.repo):a?.source==="git-subdir"&&a.url?i=(r=a.path?`${a.url}/tree/main/${a.path}`:a.url).replace("https://github.com/",""):a?.source==="url"&&a.url&&(r=a.url,i=a.url.replace(/^https?:\/\//,"")),r)?(0,t.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:underline truncate max-w-[180px]",title:i,children:[(0,t.jsx)("span",{className:"truncate",children:i}),(0,t.jsx)(m.LinkOutlined,{className:"shrink-0",style:{fontSize:10}})]}):(0,t.jsx)(s.Text,{className:"text-xs text-gray-400",children:"-"})}},{header:"Status",accessorKey:"enabled",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(o.Badge,{color:e.original.enabled?"green":"gray",size:"xs",children:e.original.enabled?"Public":"Draft"})}])(e=>A(e),e=>{navigator.clipboard.writeText(e)},h),data:C,isLoading:!1,defaultSorting:[{id:"name",desc:!1}]}),(0,t.jsx)("div",{className:"mt-3 text-center",children:(0,t.jsxs)(s.Text,{className:"text-sm text-gray-500",children:["Showing ",C.length," of ",N," skill",1!==N?"s":""]})})]})]})}],737033)},93826,174886,952571,e=>{"use strict";var t=e.i(271645);let a=t.forwardRef(function(e,a){return t.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:a},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});e.s(["SearchIcon",0,a],93826);var s=e.i(991124);e.s(["Copy",()=>s.default],174886);var r=e.i(879664);e.s(["Info",()=>r.default],952571)},976883,e=>{"use strict";var t=e.i(843476),a=e.i(275144),s=e.i(434626),r=e.i(93826),i=e.i(994388),l=e.i(304967),n=e.i(599724),o=e.i(629569),c=e.i(212931),d=e.i(199133),m=e.i(653496),p=e.i(262218),u=e.i(592968),g=e.i(174886),x=e.i(952571),h=e.i(271645),f=e.i(798496),_=e.i(727749),b=e.i(402874),y=e.i(764205),v=e.i(737033),j=e.i(190272),A=e.i(785913),N=e.i(916925);let{TabPane:T}=m.Tabs;e.s(["default",0,({accessToken:e,isEmbedded:S=!1})=>{let C,w,I,k,E,O,M,[L,$]=(0,h.useState)(null),[R,P]=(0,h.useState)(null),[z,D]=(0,h.useState)(null),[H,B]=(0,h.useState)("LiteLLM Gateway"),[G,F]=(0,h.useState)(null),[U,V]=(0,h.useState)(""),[K,W]=(0,h.useState)({}),[X,q]=(0,h.useState)(!0),[Y,J]=(0,h.useState)(!0),[Z,Q]=(0,h.useState)(!0),[ee,et]=(0,h.useState)(""),[ea,es]=(0,h.useState)(""),[er,ei]=(0,h.useState)(""),[el,en]=(0,h.useState)([]),[eo,ec]=(0,h.useState)([]),[ed,em]=(0,h.useState)([]),[ep,eu]=(0,h.useState)([]),[eg,ex]=(0,h.useState)([]),[eh,ef]=(0,h.useState)("I'm alive! ✓"),[e_,eb]=(0,h.useState)(!1),[ey,ev]=(0,h.useState)(!1),[ej,eA]=(0,h.useState)(!1),[eN,eT]=(0,h.useState)(null),[eS,eC]=(0,h.useState)(null),[ew,eI]=(0,h.useState)(null),[ek,eE]=(0,h.useState)({}),[eO,eM]=(0,h.useState)("models"),[eL,e$]=(0,h.useState)([]),[eR,eP]=(0,h.useState)(!1);(0,h.useEffect)(()=>{(async()=>{try{await (0,y.getUiConfig)()}catch(e){console.error("Failed to get UI config:",e)}let e=async()=>{try{q(!0);let e=await (0,y.modelHubPublicModelsCall)();console.log("ModelHubData:",e),$(Array.isArray(e)?e:[])}catch(e){console.error("There was an error fetching the public model data",e),ef("Service unavailable")}finally{q(!1)}},t=async()=>{try{J(!0);let e=await (0,y.agentHubPublicModelsCall)();console.log("AgentHubData:",e),P(Array.isArray(e)?e:[])}catch(e){console.error("There was an error fetching the public agent data",e)}finally{J(!1)}},a=async()=>{try{Q(!0);let e=await (0,y.mcpHubPublicServersCall)();console.log("MCPHubData:",e),D(Array.isArray(e)?e:[])}catch(e){console.error("There was an error fetching the public MCP server data",e)}finally{Q(!1)}},s=async()=>{try{eP(!0);let e=await (0,y.skillHubPublicCall)();e$(e.plugins??[])}catch(e){console.error("There was an error fetching the public skill data",e)}finally{eP(!1)}};(async()=>{let e=await (0,y.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),B(e.docs_title),F(e.custom_docs_description),V(e.litellm_version),W(e.useful_links||{})})(),e(),t(),a(),s()})()},[]),(0,h.useEffect)(()=>{},[ee,el,eo,ed]);let ez=(0,h.useMemo)(()=>{if(!L||!Array.isArray(L))return[];let e=L;if(ee.trim()){let t=ee.toLowerCase(),a=t.split(/\s+/),s=L.filter(e=>{let s=e.model_group.toLowerCase();return!!s.includes(t)||a.every(e=>s.includes(e))});s.length>0&&(e=s.sort((e,a)=>{let s=e.model_group.toLowerCase(),r=a.model_group.toLowerCase(),i=1e3*(s===t),l=1e3*(r===t),n=100*!!s.startsWith(t),o=100*!!r.startsWith(t),c=50*!!t.split(/\s+/).every(e=>s.includes(e)),d=50*!!t.split(/\s+/).every(e=>r.includes(e)),m=s.length;return l+o+d+(1e3-r.length)-(i+n+c+(1e3-m))}))}return e.filter(e=>{let t=0===el.length||el.some(t=>e.providers.includes(t)),a=0===eo.length||eo.includes(e.mode||""),s=0===ed.length||Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).some(([e])=>{let t=e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return ed.includes(t)});return t&&a&&s})},[L,ee,el,eo,ed]),eD=(0,h.useMemo)(()=>{if(!R||!Array.isArray(R))return[];let e=R;if(ea.trim()){let t=ea.toLowerCase(),a=t.split(/\s+/);e=(e=R.filter(e=>{let s=e.name.toLowerCase(),r=e.description.toLowerCase();return!!(s.includes(t)||r.includes(t))||a.every(e=>s.includes(e)||r.includes(e))})).sort((e,a)=>{let s=e.name.toLowerCase(),r=a.name.toLowerCase(),i=1e3*(s===t),l=1e3*(r===t),n=100*!!s.startsWith(t),o=100*!!r.startsWith(t),c=i+n+(1e3-s.length);return l+o+(1e3-r.length)-c})}return e.filter(e=>0===ep.length||e.skills?.some(e=>e.tags?.some(e=>ep.includes(e))))},[R,ea,ep]),eH=(0,h.useMemo)(()=>{if(!z||!Array.isArray(z))return[];let e=z;if(er.trim()){let t=er.toLowerCase(),a=t.split(/\s+/);e=(e=z.filter(e=>{let s=e.server_name.toLowerCase(),r=(e.mcp_info?.description||"").toLowerCase();return!!(s.includes(t)||r.includes(t))||a.every(e=>s.includes(e)||r.includes(e))})).sort((e,a)=>{let s=e.server_name.toLowerCase(),r=a.server_name.toLowerCase(),i=1e3*(s===t),l=1e3*(r===t),n=100*!!s.startsWith(t),o=100*!!r.startsWith(t),c=i+n+(1e3-s.length);return l+o+(1e3-r.length)-c})}return e.filter(e=>0===eg.length||eg.includes(e.transport))},[z,er,eg]),eB=e=>{navigator.clipboard.writeText(e),_.default.success("Copied to clipboard!")},eG=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eF=e=>`$${(1e6*e).toFixed(4)}`,eU=e=>e?e>=1e3?`${(e/1e3).toFixed(0)}K`:e.toString():"N/A";return(0,t.jsx)(a.ThemeProvider,{accessToken:e,children:(0,t.jsxs)("div",{className:S?"w-full":"min-h-screen bg-white",children:[!S&&(0,t.jsx)(b.default,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:eE,proxySettings:ek,accessToken:e||null,isPublicPage:!0,isDarkMode:!1,toggleDarkMode:()=>{}}),(0,t.jsxs)("div",{className:S?"w-full p-6":"w-full px-8 py-12",children:[S&&(0,t.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,t.jsx)("p",{className:"text-sm text-gray-700",children:"These are models, agents, and MCP servers your proxy admin has indicated are available in your company."})}),!S&&(0,t.jsxs)(l.Card,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,t.jsx)(o.Title,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,t.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:G||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,t.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"w-4 h-4 mr-2",children:"🔧"}),"Built with litellm: v",U]})})]}),K&&Object.keys(K).length>0&&(0,t.jsxs)(l.Card,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,t.jsx)(o.Title,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(K||{}).map(([e,t])=>({title:e,url:"string"==typeof t?t:t.url,index:"string"==typeof t?0:t.index??0})).sort((e,t)=>e.index-t.index).map(({title:e,url:a})=>(0,t.jsxs)("button",{onClick:()=>window.open(a,"_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,t.jsx)(s.ExternalLinkIcon,{className:"w-4 h-4"}),(0,t.jsx)(n.Text,{className:"text-sm font-medium",children:e})]},e))})]}),!S&&(0,t.jsxs)(l.Card,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,t.jsx)(o.Title,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,t.jsxs)(n.Text,{className:"text-green-600 font-medium text-sm",children:["Service status: ",eh]})})]}),(0,t.jsx)(l.Card,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:(0,t.jsxs)(m.Tabs,{activeKey:eO,onChange:eM,size:"large",className:"public-hub-tabs",children:[(0,t.jsxs)(T,{tab:"Model Hub",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,t.jsx)(o.Title,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,t.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,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,t.jsx)(u.Tooltip,{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,t.jsx)(x.Info,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.SearchIcon,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:ee,onChange:e=>et(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,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:el,onChange:e=>en(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:a}=(0,N.getProviderLogoAndName)(e.value);return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:a,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"capitalize",children:e.label})]})},children:L&&Array.isArray(L)&&(C=new Set,L.forEach(e=>{(e.providers??[]).forEach(e=>C.add(e))}),Array.from(C)).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:eo,onChange:e=>ec(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:L&&Array.isArray(L)&&(w=new Set,L.forEach(e=>{e.mode&&w.add(e.mode)}),Array.from(w)).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:ed,onChange:e=>em(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:L&&Array.isArray(L)&&(I=new Set,L.forEach(e=>{Object.entries(e).filter(([e,t])=>e.startsWith("supports_")&&!0===t).forEach(([e])=>{let t=e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");I.add(t)})}),Array.from(I).sort()).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]})]}),(0,t.jsx)(f.ModelDataTable,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:({row:e})=>(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(u.Tooltip,{title:e.original.model_group,children:(0,t.jsx)(i.Button,{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:()=>{eT(e.original),eb(!0)},children:e.original.model_group})})}),size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:({row:e})=>{let a=e.original.providers??[];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:a.map(e=>{let{logo:a}=(0,N.getProviderLogoAndName)(e);return(0,t.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[a&&(0,t.jsx)("img",{src:a,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:({row:e})=>{let a=e.original.mode;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:(e=>{switch(e?.toLowerCase()){case"chat":return"💬";case"rerank":return"🔄";case"embedding":return"📄";default:return"🤖"}})(a||"")}),(0,t.jsx)(n.Text,{children:a||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(n.Text,{className:"text-center",children:eU(e.original.max_input_tokens)}),size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(n.Text,{className:"text-center",children:eU(e.original.max_output_tokens)}),size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:({row:e})=>{let a=e.original.input_cost_per_token;return(0,t.jsx)(n.Text,{className:"text-center",children:a?eF(a):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:({row:e})=>{let a=e.original.output_cost_per_token;return(0,t.jsx)(n.Text,{className:"text-center",children:a?eF(a):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:({row:e})=>{let a=Object.entries(e.original).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>eG(e));return 0===a.length?(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"}):1===a.length?(0,t.jsx)("div",{className:"h-6 flex items-center",children:(0,t.jsx)(p.Tag,{color:"blue",className:"text-xs",children:a[0]})}):(0,t.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,t.jsx)(p.Tag,{color:"blue",className:"text-xs",children:a[0]}),(0,t.jsx)(u.Tooltip,{title:(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:"All Features:"}),a.map((e,a)=>(0,t.jsxs)("div",{className:"text-xs",children:["• ",e]},a))]}),trigger:"click",placement:"topLeft",children:(0,t.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",a.length-1]})})]})},size:120},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,cell:({row:e})=>{let a=e.original,s="healthy"===a.health_status?"green":"unhealthy"===a.health_status?"red":"default",r=a.health_response_time?`Response Time: ${Number(a.health_response_time).toFixed(2)}ms`:"N/A",i=a.health_checked_at?`Last Checked: ${new Date(a.health_checked_at).toLocaleString()}`:"N/A";return(0,t.jsx)(u.Tooltip,{title:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:r}),(0,t.jsx)("div",{children:i})]}),children:(0,t.jsx)(p.Tag,{color:s,children:(0,t.jsx)("span",{className:"capitalize",children:a.health_status??"Unknown"})},a.model_group)})},size:100},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:({row:e})=>{var a,s;let r,i=e.original;return(0,t.jsx)(n.Text,{className:"text-xs text-gray-600",children:(a=i.rpm,s=i.tpm,r=[],a&&r.push(`RPM: ${a.toLocaleString()}`),s&&r.push(`TPM: ${s.toLocaleString()}`),r.length>0?r.join(", "):"N/A")})},size:150}],data:ez,isLoading:X,defaultSorting:[{id:"model_group",desc:!1}]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsxs)(n.Text,{className:"text-sm text-gray-600",children:["Showing ",ez.length," of ",L?.length||0," models"]})})]},"models"),R&&Array.isArray(R)&&R.length>0&&(0,t.jsxs)(T,{tab:"Agent Hub",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,t.jsx)(o.Title,{className:"text-2xl font-semibold text-gray-900",children:"Available Agents"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium text-gray-700",children:"Search Agents:"}),(0,t.jsx)(u.Tooltip,{title:"Search agents by name or description",placement:"top",children:(0,t.jsx)(x.Info,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.SearchIcon,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",placeholder:"Search agent names or descriptions...",value:ea,onChange:e=>es(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,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Skills:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:ep,onChange:e=>eu(e),placeholder:"Select skills",className:"w-full",size:"large",allowClear:!0,children:R&&Array.isArray(R)&&(k=new Set,R.forEach(e=>{e.skills?.forEach(e=>{e.tags?.forEach(e=>k.add(e))})}),Array.from(k).sort()).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]})]}),(0,t.jsx)(f.ModelDataTable,{columns:[{header:"Agent Name",accessorKey:"name",enableSorting:!0,cell:({row:e})=>(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(u.Tooltip,{title:e.original.name,children:(0,t.jsx)(i.Button,{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:()=>{eC(e.original),ev(!0)},children:e.original.name})})}),size:150},{header:"Description",accessorKey:"description",enableSorting:!1,cell:({row:e})=>{let a=e.original.description??"",s=a.length>80?a.substring(0,80)+"...":a;return(0,t.jsx)(u.Tooltip,{title:a,children:(0,t.jsx)(n.Text,{className:"text-sm text-gray-700",children:s})})},size:250},{header:"Version",accessorKey:"version",enableSorting:!0,cell:({row:e})=>(0,t.jsx)(n.Text,{className:"text-sm",children:e.original.version}),size:80},{header:"Provider",accessorKey:"provider",enableSorting:!1,cell:({row:e})=>{let a=e.original.provider;return a?(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(n.Text,{className:"font-medium",children:a.organization})}):(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"})},size:120},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:({row:e})=>{let a=e.original.skills||[];return 0===a.length?(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"}):1===a.length?(0,t.jsx)("div",{className:"h-6 flex items-center",children:(0,t.jsx)(p.Tag,{color:"purple",className:"text-xs",children:a[0].name})}):(0,t.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,t.jsx)(p.Tag,{color:"purple",className:"text-xs",children:a[0].name}),(0,t.jsx)(u.Tooltip,{title:(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:"All Skills:"}),a.map((e,a)=>(0,t.jsxs)("div",{className:"text-xs",children:["• ",e.name]},a))]}),trigger:"click",placement:"topLeft",children:(0,t.jsxs)("span",{className:"text-xs text-purple-600 cursor-pointer hover:text-purple-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",a.length-1]})})]})},size:150},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:({row:e})=>{let a=Object.entries(e.original.capabilities||{}).filter(([e,t])=>!0===t).map(([e])=>e);return 0===a.length?(0,t.jsx)(n.Text,{className:"text-gray-400",children:"-"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:a.map(e=>(0,t.jsx)(p.Tag,{color:"green",className:"text-xs capitalize",children:e},e))})},size:150}],data:eD,isLoading:Y,defaultSorting:[{id:"name",desc:!1}]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsxs)(n.Text,{className:"text-sm text-gray-600",children:["Showing ",eD.length," of ",R?.length||0," agents"]})})]},"agents"),z&&Array.isArray(z)&&z.length>0&&(0,t.jsxs)(T,{tab:"MCP Hub",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,t.jsx)(o.Title,{className:"text-2xl font-semibold text-gray-900",children:"Available MCP Servers"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium text-gray-700",children:"Search MCP Servers:"}),(0,t.jsx)(u.Tooltip,{title:"Search MCP servers by name or description",placement:"top",children:(0,t.jsx)(x.Info,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(r.SearchIcon,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,t.jsx)("input",{type:"text",placeholder:"Search MCP server names or descriptions...",value:er,onChange:e=>ei(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,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-3 text-gray-700",children:"Transport:"}),(0,t.jsx)(d.Select,{mode:"multiple",value:eg,onChange:e=>ex(e),placeholder:"Select transport types",className:"w-full",size:"large",allowClear:!0,children:z&&Array.isArray(z)&&(E=new Set,z.forEach(e=>{e.transport&&E.add(e.transport)}),Array.from(E).sort()).map(e=>(0,t.jsx)(d.Select.Option,{value:e,children:e},e))})]})]}),(0,t.jsx)(f.ModelDataTable,{columns:[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,cell:({row:e})=>(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)(u.Tooltip,{title:e.original.server_name,children:(0,t.jsx)(i.Button,{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:()=>{eI(e.original),eA(!0)},children:e.original.server_name})})}),size:150},{header:"Description",accessorKey:"mcp_info.description",enableSorting:!1,cell:({row:e})=>{let a=String(e.original.mcp_info?.description??"-"),s=a.length>80?a.substring(0,80)+"...":a;return(0,t.jsx)(u.Tooltip,{title:a,children:(0,t.jsx)(n.Text,{className:"text-sm text-gray-700",children:s})})},size:250},{header:"URL",accessorKey:"url",enableSorting:!1,cell:({row:e})=>{let a=e.original.url??"",s=a.length>40?a.substring(0,40)+"...":a;return(0,t.jsx)(u.Tooltip,{title:a,children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Text,{className:"text-xs font-mono",children:s}),(0,t.jsx)(g.Copy,{onClick:()=>eB(a),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-3 h-3"})]})})},size:200},{header:"Transport",accessorKey:"transport",enableSorting:!0,cell:({row:e})=>{let a=e.original.transport;return(0,t.jsx)(p.Tag,{color:"blue",className:"text-xs uppercase",children:a})},size:100},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,cell:({row:e})=>{let a=e.original.auth_type;return(0,t.jsx)(p.Tag,{color:"none"===a?"gray":"green",className:"text-xs capitalize",children:a})},size:100}],data:eH,isLoading:Z,defaultSorting:[{id:"server_name",desc:!1}]}),(0,t.jsx)("div",{className:"mt-8 text-center",children:(0,t.jsxs)(n.Text,{className:"text-sm text-gray-600",children:["Showing ",eH.length," of ",z?.length||0," MCP servers"]})})]},"mcp"),(0,t.jsx)(T,{tab:"Skill Hub",children:(0,t.jsx)(v.default,{skills:eL,isLoading:eR,publicPage:!0})},"skills")]})})]}),(0,t.jsx)(c.Modal,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:eN?.model_group||"Model Details"}),eN&&(0,t.jsx)(u.Tooltip,{title:"Copy model name",children:(0,t.jsx)(g.Copy,{onClick:()=>eB(eN.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:e_,footer:null,onOk:()=>{eb(!1),eT(null)},onCancel:()=>{eb(!1),eT(null)},children:eN&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{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)(n.Text,{className:"font-medium",children:"Model Name:"}),(0,t.jsx)(n.Text,{children:eN.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(n.Text,{children:eN.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(eN.providers??[]).map(e=>{let{logo:a}=(0,N.getProviderLogoAndName)(e);return(0,t.jsx)(p.Tag,{color:"blue",children:(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[a&&(0,t.jsx)("img",{src:a,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),eN.model_group.includes("*")&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,t.jsx)(x.Info,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,t.jsxs)(n.Text,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the"," ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,t.jsxs)(n.Text,{className:"text-sm text-blue-800",children:["For example, with"," ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:eN.model_group}),", you can use any string (",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:eN.model_group.replaceAll("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{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)(n.Text,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(n.Text,{children:eN.max_input_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(n.Text,{children:eN.max_output_tokens?.toLocaleString()||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(n.Text,{children:eN.input_cost_per_token?eF(eN.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(n.Text,{children:eN.output_cost_per_token?eF(eN.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(O=Object.entries(eN).filter(([e,t])=>e.startsWith("supports_")&&!0===t).map(([e])=>e),M=["green","blue","purple","orange","red","yellow"],0===O.length?(0,t.jsx)(n.Text,{className:"text-gray-500",children:"No special capabilities listed"}):O.map((e,a)=>(0,t.jsx)(p.Tag,{color:M[a%M.length],children:eG(e)},e)))})]}),(eN.tpm||eN.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[eN.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(n.Text,{children:eN.tpm.toLocaleString()})]}),eN.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(n.Text,{children:eN.rpm.toLocaleString()})]})]})]}),eN.supported_openai_params&&eN.supported_openai_params.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eN.supported_openai_params.map(e=>(0,t.jsx)(p.Tag,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-sm",children:(0,j.generateCodeSnippet)({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:[],selectedPolicies:[],selectedMCPServers:[],endpointType:(0,A.getEndpointType)(eN.mode||"chat"),selectedModel:eN.model_group,selectedSdk:"openai"})})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB((0,j.generateCodeSnippet)({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:[],selectedPolicies:[],selectedMCPServers:[],endpointType:(0,A.getEndpointType)(eN.mode||"chat"),selectedModel:eN.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})}),(0,t.jsx)(c.Modal,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:eS?.name||"Agent Details"}),eS&&(0,t.jsx)(u.Tooltip,{title:"Copy agent name",children:(0,t.jsx)(g.Copy,{onClick:()=>eB(eS.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ey,footer:null,onOk:()=>{ev(!1),eC(null)},onCancel:()=>{ev(!1),eC(null)},children:eS&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Name:"}),(0,t.jsx)(n.Text,{children:eS.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Version:"}),(0,t.jsx)(n.Text,{children:eS.version})]}),(0,t.jsxs)("div",{className:"col-span-2",children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(n.Text,{children:eS.description})]}),eS.url&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"URL:"}),(0,t.jsx)("a",{href:eS.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all",children:eS.url})]})]})]}),eS.capabilities&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(eS.capabilities).filter(([e,t])=>!0===t).map(([e])=>(0,t.jsx)(p.Tag,{color:"green",className:"capitalize",children:e},e))})]}),eS.skills&&eS.skills.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,t.jsx)("div",{className:"space-y-4",children:eS.skills.map((e,a)=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,t.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium text-base",children:e.name}),(0,t.jsx)(n.Text,{className:"text-sm text-gray-600",children:e.description})]})}),e.tags&&e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(e=>(0,t.jsx)(p.Tag,{color:"purple",className:"text-xs",children:e},e))})]},a))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Input Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(eS.defaultInputModes??[]).map(e=>(0,t.jsx)(p.Tag,{color:"blue",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Output Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(eS.defaultOutputModes??[]).map(e=>(0,t.jsx)(p.Tag,{color:"blue",children:e},e))})]})]})]}),eS.documentationUrl&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Documentation"}),(0,t.jsxs)("a",{href:eS.documentationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 flex items-center space-x-2",children:[(0,t.jsx)(s.ExternalLinkIcon,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"View Documentation"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example (A2A Protocol)"}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 1: Retrieve Agent Card"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-xs",children:`base_url = '${eS.url}'
-
-resolver = A2ACardResolver(
- httpx_client=httpx_client,
- base_url=base_url,
- # agent_card_path uses default, extended_agent_card_path also uses default
-)
-
-# Fetch Public Agent Card and Initialize Client
-final_agent_card_to_use: AgentCard | None = None
-_public_card = (
- await resolver.get_agent_card()
-) # Fetches from default public path - \`/agents/{agent_id}/\`
-final_agent_card_to_use = _public_card
-
-if _public_card.supports_authenticated_extended_card:
- try:
- auth_headers_dict = {
- 'Authorization': 'Bearer dummy-token-for-extended-card'
- }
- _extended_card = await resolver.get_agent_card(
- relative_card_path=EXTENDED_AGENT_CARD_PATH,
- http_kwargs={'headers': auth_headers_dict},
- )
- final_agent_card_to_use = (
- _extended_card # Update to use the extended card
- )
- except Exception as e_extended:
- logger.warning(
- f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',
- exc_info=True,
- )`})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB(`from a2a.client import A2ACardResolver, A2AClient
-from a2a.types import (
- AgentCard,
- MessageSendParams,
- SendMessageRequest,
- SendStreamingMessageRequest,
-)
-from a2a.utils.constants import (
- AGENT_CARD_WELL_KNOWN_PATH,
- EXTENDED_AGENT_CARD_PATH,
-)
-
-base_url = '${eS.url}'
-
-resolver = A2ACardResolver(
- httpx_client=httpx_client,
- base_url=base_url,
- # agent_card_path uses default, extended_agent_card_path also uses default
-)
-
-# Fetch Public Agent Card and Initialize Client
-final_agent_card_to_use: AgentCard | None = None
-_public_card = (
- await resolver.get_agent_card()
-) # Fetches from default public path - \`/agents/{agent_id}/\`
-final_agent_card_to_use = _public_card
-
-if _public_card.supports_authenticated_extended_card:
- try:
- auth_headers_dict = {
- 'Authorization': 'Bearer dummy-token-for-extended-card'
- }
- _extended_card = await resolver.get_agent_card(
- relative_card_path=EXTENDED_AGENT_CARD_PATH,
- http_kwargs={'headers': auth_headers_dict},
- )
- final_agent_card_to_use = (
- _extended_card # Update to use the extended card
- )
- except Exception as e_extended:
- logger.warning(
- f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',
- exc_info=True,
- )`)},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 2: Call the Agent"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-xs",children:`client = A2AClient(
- httpx_client=httpx_client, agent_card=final_agent_card_to_use
-)
-
-send_message_payload: dict[str, Any] = {
- 'message': {
- 'role': 'user',
- 'parts': [
- {'kind': 'text', 'text': 'how much is 10 USD in INR?'}
- ],
- 'messageId': uuid4().hex,
- },
-}
-request = SendMessageRequest(
- id=str(uuid4()), params=MessageSendParams(**send_message_payload)
-)
-
-response = await client.send_message(request)
-print(response.model_dump(mode='json', exclude_none=True))`})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB(`client = A2AClient(
- httpx_client=httpx_client, agent_card=final_agent_card_to_use
-)
-
-send_message_payload: dict[str, Any] = {
- 'message': {
- 'role': 'user',
- 'parts': [
- {'kind': 'text', 'text': 'how much is 10 USD in INR?'}
- ],
- 'messageId': uuid4().hex,
- },
-}
-request = SendMessageRequest(
- id=str(uuid4()), params=MessageSendParams(**send_message_payload)
-)
-
-response = await client.send_message(request)
-print(response.model_dump(mode='json', exclude_none=True))`)},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})]})}),(0,t.jsx)(c.Modal,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{children:ew?.server_name||"MCP Server Details"}),ew&&(0,t.jsx)(u.Tooltip,{title:"Copy server name",children:(0,t.jsx)(g.Copy,{onClick:()=>eB(ew.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ej,footer:null,onOk:()=>{eA(!1),eI(null)},onCancel:()=>{eA(!1),eI(null)},children:ew&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Server Name:"}),(0,t.jsx)(n.Text,{children:ew.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Transport:"}),(0,t.jsx)(p.Tag,{color:"blue",children:ew.transport})]}),ew.alias&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Alias:"}),(0,t.jsx)(n.Text,{children:ew.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Auth Type:"}),(0,t.jsx)(p.Tag,{color:"none"===ew.auth_type?"gray":"green",children:ew.auth_type})]}),(0,t.jsxs)("div",{className:"col-span-2",children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"Description:"}),(0,t.jsx)(n.Text,{children:ew.mcp_info?.description||"-"})]}),(0,t.jsxs)("div",{className:"col-span-2",children:[(0,t.jsx)(n.Text,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("a",{href:ew.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all flex items-center space-x-2",children:[(0,t.jsx)("span",{children:ew.url}),(0,t.jsx)(s.ExternalLinkIcon,{className:"w-4 h-4"})]})]})]})]}),ew.mcp_info&&Object.keys(ew.mcp_info).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Additional Information"}),(0,t.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,t.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(ew.mcp_info,null,2)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Text,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,t.jsx)("pre",{className:"text-sm",children:`# Using MCP Server with Python FastMCP
-
-from fastmcp import Client
-import asyncio
-
-# Standard MCP configuration
-config = {
- "mcpServers": {
- "${ew.server_name}": {
- "url": "http://localhost:4000/${ew.server_name}/mcp",
- "headers": {
- "x-litellm-api-key": "Bearer sk-1234"
- }
- }
- }
-}
-
-# Create a client that connects to the server
-client = Client(config)
-
-async def main():
- async with client:
- # List available tools
- tools = await client.list_tools()
- print(f"Available tools: {[tool.name for tool in tools]}")
-
- # Call a tool
- response = await client.call_tool(
- name="tool_name",
- arguments={"arg": "value"}
- )
- print(f"Response: {response}")
-
-if __name__ == "__main__":
- asyncio.run(main())`})}),(0,t.jsx)("div",{className:"mt-2 text-right",children:(0,t.jsx)("button",{onClick:()=>{eB(`# Using MCP Server with Python FastMCP
-
-from fastmcp import Client
-import asyncio
-
-# Standard MCP configuration
-config = {
- "mcpServers": {
- "${ew.server_name}": {
- "url": "http://localhost:4000/${ew.server_name}/mcp",
- "headers": {
- "x-litellm-api-key": "Bearer sk-1234"
- }
- }
- }
-}
-
-# Create a client that connects to the server
-client = Client(config)
-
-async def main():
- async with client:
- # List available tools
- tools = await client.list_tools()
- print(f"Available tools: {[tool.name for tool in tools]}")
-
- # Call a tool
- response = await client.call_tool(
- name="tool_name",
- arguments={"arg": "value"}
- )
- print(f"Response: {response}")
-
-if __name__ == "__main__":
- asyncio.run(main())`)},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/34465d13a9152473.js b/litellm/proxy/_experimental/out/_next/static/chunks/34465d13a9152473.js
deleted file mode 100644
index c43f2b501e..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/34465d13a9152473.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,663435,152473,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(199133),n=e.i(898586),s=e.i(56456);let a={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class o{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...a,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function l(e,t){let[i,n]=(0,r.useState)(e),s=function(e,t){let[i]=(0,r.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new o(e,t))).filter(e=>"function"==typeof r[e]).reduce((e,t)=>{let i=r[t];return"function"==typeof i&&(e[t]=i.bind(r)),e},{})});return i.setOptions(t),i}(n,t);return[i,s.maybeExecute,s]}e.s(["useDebouncedState",()=>l],152473);var d=e.i(785242);let{Text:c}=n.Typography;e.s(["default",0,({value:e,onChange:n,onTeamSelect:a,disabled:o,organizationId:u,pageSize:h=20})=>{let[f,p]=(0,r.useState)(""),[m,g]=l("",{wait:300}),{data:y,fetchNextPage:x,hasNextPage:b,isFetchingNextPage:_,isLoading:v}=(0,d.useInfiniteTeams)(h,m||void 0,u),w=(0,r.useMemo)(()=>{if(!y?.pages)return[];let e=new Set,t=[];for(let r of y.pages)for(let i of r.teams)e.has(i.team_id)||(e.add(i.team_id),t.push(i));return t},[y]);return(0,t.jsx)(i.Select,{showSearch:!0,placeholder:"Search or select a team",value:e||void 0,onChange:e=>{n?.(e??""),a&&a(e?w.find(t=>t.team_id===e)??null:null)},disabled:o,allowClear:!0,filterOption:!1,onSearch:e=>{p(e),g(e)},searchValue:f,onPopupScroll:e=>{let t=e.currentTarget;(t.scrollTop+t.clientHeight)/t.scrollHeight>=.8&&b&&!_&&x()},loading:v,notFoundContent:v?(0,t.jsx)(s.LoadingOutlined,{spin:!0}):"No teams found","data-testid":"team-dropdown",popupRender:e=>(0,t.jsxs)(t.Fragment,{children:[e,_&&(0,t.jsx)("div",{style:{textAlign:"center",padding:8},children:(0,t.jsx)(s.LoadingOutlined,{spin:!0})})]}),children:w.map(e=>(0,t.jsxs)(i.Select.Option,{value:e.team_id,children:[(0,t.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,t.jsxs)(c,{type:"secondary",children:["(",e.team_id,")"]})]},e.team_id))})}],663435)},743151,(e,t,r)=>{"use strict";function i(e){return(i="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)}Object.defineProperty(r,"__esModule",{value:!0}),r.CopyToClipboard=void 0;var n=o(e.r(271645)),s=o(e.r(844343)),a=["text","onCopy","options","children"];function o(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function d(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),i=n.default.Children.only(t);return n.default.cloneElement(i,d(d({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r{"use strict";var i=e.r(743151).CopyToClipboard;i.CopyToClipboard=i,t.exports=i},107233,37727,e=>{"use strict";var t=e.i(603908);e.s(["Plus",()=>t.default],107233);var r=e.i(841947);e.s(["X",()=>r.default],37727)},361653,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t])},603908,e=>{"use strict";let t=(0,e.i(475254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["default",()=>t])},841947,e=>{"use strict";let t=(0,e.i(475254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",()=>t])},158392,419470,e=>{"use strict";var t=e.i(843476),r=e.i(311451);let i={ttl:3600,lowest_latency_buffer:0},n=({routingStrategyArgs:e})=>{let n={ttl:"Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Latency-Based Configuration"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Fine-tune latency-based routing behavior"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e||i).map(([e,i])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:e.replace(/_/g," ")}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:n[e]||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:"object"==typeof i?JSON.stringify(i,null,2):i?.toString(),className:"font-mono text-sm w-full"})]})},e))})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"})]})},s=({routerSettings:e,routerFieldsMetadata:i})=>(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Reliability & Retries"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure retry logic and failure handling"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(e).filter(([e,t])=>"fallbacks"!=e&&"context_window_fallbacks"!=e&&"routing_strategy_args"!=e&&"routing_strategy"!=e&&"enable_tag_filtering"!=e).map(([e,n])=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("label",{className:"block",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:i[e]?.ui_field_name||e}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:i[e]?.field_description||""}),(0,t.jsx)(r.Input,{name:e,defaultValue:null==n||"null"===n?"":"object"==typeof n?JSON.stringify(n,null,2):n?.toString()||"",placeholder:"—",className:"font-mono text-sm w-full"})]})},e))})]});var a=e.i(199133);let o=({selectedStrategy:e,availableStrategies:r,routingStrategyDescriptions:i,routerFieldsMetadata:n,onStrategyChange:s})=>(0,t.jsxs)("div",{className:"space-y-2 max-w-3xl",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:n.routing_strategy?.ui_field_name||"Routing Strategy"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:n.routing_strategy?.field_description||""})]}),(0,t.jsx)("div",{className:"routing-strategy-select max-w-3xl",children:(0,t.jsx)(a.Select,{value:e,onChange:s,style:{width:"100%"},size:"large",children:r.map(e=>(0,t.jsx)(a.Select.Option,{value:e,label:e,children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 py-1",children:[(0,t.jsx)("span",{className:"font-mono text-sm font-medium",children:e}),i[e]&&(0,t.jsx)("span",{className:"text-xs text-gray-500 font-normal",children:i[e]})]})},e))})})]});var l=e.i(790848);let d=({enabled:e,routerFieldsMetadata:r,onToggle:i})=>(0,t.jsx)("div",{className:"space-y-3 max-w-3xl",children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:r.enable_tag_filtering?.ui_field_name||"Enable Tag Filtering"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[r.enable_tag_filtering?.field_description||"",r.enable_tag_filtering?.link&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("a",{href:r.enable_tag_filtering.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Learn more"})]})]})]}),(0,t.jsx)(l.Switch,{checked:e,onChange:i,className:"ml-4"})]})});e.s(["default",0,({value:e,onChange:r,routerFieldsMetadata:i,availableRoutingStrategies:a,routingStrategyDescriptions:l})=>(0,t.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Routing Settings"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure how requests are routed to deployments"})]}),a.length>0&&(0,t.jsx)(o,{selectedStrategy:e.selectedStrategy||e.routerSettings.routing_strategy||null,availableStrategies:a,routingStrategyDescriptions:l,routerFieldsMetadata:i,onStrategyChange:t=>{r({...e,selectedStrategy:t})}}),(0,t.jsx)(d,{enabled:e.enableTagFiltering,routerFieldsMetadata:i,onToggle:t=>{r({...e,enableTagFiltering:t})}})]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),"latency-based-routing"===e.selectedStrategy&&(0,t.jsx)(n,{routingStrategyArgs:e.routerSettings.routing_strategy_args}),(0,t.jsx)(s,{routerSettings:e.routerSettings,routerFieldsMetadata:i})]})],158392);var c=e.i(994388),u=e.i(653496),h=e.i(107233),f=e.i(271645),p=e.i(888259),m=e.i(592968),g=e.i(361653),g=g;let y=(0,e.i(475254).default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var x=e.i(37727);function b({group:e,onChange:r,availableModels:i,maxFallbacks:n}){let s=i.filter(t=>t!==e.primaryModel),o=e.fallbackModels.length{let i=[...e.fallbackModels];i.includes(t)&&(i=i.filter(e=>e!==t)),r({...e,primaryModel:t,fallbackModels:i})},showSearch:!0,getPopupContainer:e=>e.parentElement||document.body,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),options:i.map(e=>({label:e,value:e}))}),!e.primaryModel&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-amber-600 text-xs bg-amber-50 p-2 rounded",children:[(0,t.jsx)(g.default,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Select a model to begin configuring fallbacks"})]})]}),(0,t.jsx)("div",{className:"flex items-center justify-center -my-4 z-10",children:(0,t.jsxs)("div",{className:"bg-indigo-50 text-indigo-500 px-4 py-1 rounded-full text-xs font-bold border border-indigo-100 flex items-center gap-2 shadow-sm",children:[(0,t.jsx)(y,{className:"w-4 h-4"}),"IF FAILS, TRY..."]})}),(0,t.jsxs)("div",{className:`transition-opacity duration-300 ${!e.primaryModel?"opacity-50 pointer-events-none":"opacity-100"}`,children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Fallback Chain ",(0,t.jsx)("span",{className:"text-red-500",children:"*"}),(0,t.jsxs)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:["(Max ",n," fallbacks at a time)"]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-200",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(a.Select,{mode:"multiple",className:"w-full",size:"large",placeholder:o?"Select fallback models to add...":`Maximum ${n} fallbacks reached`,value:e.fallbackModels,onChange:t=>{let i=t.slice(0,n);r({...e,fallbackModels:i})},disabled:!e.primaryModel,getPopupContainer:e=>e.parentElement||document.body,options:s.map(e=>({label:e,value:e})),optionRender:(r,i)=>{let n=e.fallbackModels.includes(r.value),s=n?e.fallbackModels.indexOf(r.value)+1:null;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[n&&null!==s&&(0,t.jsx)("span",{className:"flex items-center justify-center w-5 h-5 rounded bg-indigo-100 text-indigo-600 text-xs font-bold",children:s}),(0,t.jsx)("span",{children:r.label})]})},maxTagCount:"responsive",maxTagPlaceholder:e=>(0,t.jsx)(m.Tooltip,{styles:{root:{pointerEvents:"none"}},title:e.map(({value:e})=>e).join(", "),children:(0,t.jsxs)("span",{children:["+",e.length," more"]})}),showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase())}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1 ml-1",children:o?`Search and select multiple models. Selected models will appear below in order. (${e.fallbackModels.length}/${n} used)`:`Maximum ${n} fallbacks reached. Remove some to add more.`})]}),(0,t.jsx)("div",{className:"space-y-2 min-h-[100px]",children:0===e.fallbackModels.length?(0,t.jsxs)("div",{className:"h-32 border-2 border-dashed border-gray-300 rounded-lg flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)("span",{className:"text-sm",children:"No fallback models selected"}),(0,t.jsx)("span",{className:"text-xs mt-1",children:"Add models from the dropdown above"})]}):e.fallbackModels.map((i,n)=>(0,t.jsxs)("div",{className:"group flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200 hover:border-indigo-300 hover:shadow-sm transition-all",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded bg-gray-100 text-gray-400 group-hover:text-indigo-500 group-hover:bg-indigo-50",children:(0,t.jsx)("span",{className:"text-xs font-bold",children:n+1})}),(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"font-medium text-gray-800",children:i})})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t;return t=e.fallbackModels.filter((e,t)=>t!==n),void r({...e,fallbackModels:t})},className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-400 hover:text-red-500 p-1",children:(0,t.jsx)(x.X,{className:"w-4 h-4"})})]},`${i}-${n}`))})]})]})]})}function _({groups:e,onGroupsChange:r,availableModels:i,maxFallbacks:n=10,maxGroups:s=5}){let[a,o]=(0,f.useState)(e.length>0?e[0].id:"1");(0,f.useEffect)(()=>{e.length>0?e.some(e=>e.id===a)||o(e[0].id):o("1")},[e]);let l=()=>{if(e.length>=s)return;let t=Date.now().toString();r([...e,{id:t,primaryModel:null,fallbackModels:[]}]),o(t)},d=t=>{r(e.map(e=>e.id===t.id?t:e))},m=e.map((r,s)=>{let a=r.primaryModel?r.primaryModel:`Group ${s+1}`;return{key:r.id,label:a,closable:e.length>1,children:(0,t.jsx)(b,{group:r,onChange:d,availableModels:i,maxFallbacks:n})}});return 0===e.length?(0,t.jsxs)("div",{className:"text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300",children:[(0,t.jsx)("p",{className:"text-gray-500 mb-4",children:"No fallback groups configured"}),(0,t.jsx)(c.Button,{variant:"primary",onClick:l,icon:()=>(0,t.jsx)(h.Plus,{className:"w-4 h-4"}),children:"Create First Group"})]}):(0,t.jsx)(u.Tabs,{type:"editable-card",activeKey:a,onChange:o,onEdit:(t,i)=>{"add"===i?l():"remove"===i&&e.length>1&&(t=>{if(1===e.length)return p.default.warning("At least one group is required");let i=e.filter(e=>e.id!==t);r(i),a===t&&i.length>0&&o(i[i.length-1].id)})(t)},items:m,className:"fallback-tabs",tabBarStyle:{marginBottom:0},hideAdd:e.length>=s})}e.s(["FallbackSelectionForm",()=>_],419470)},992619,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(779241),n=e.i(599724),s=e.i(199133),a=e.i(983561),o=e.i(689020);e.s(["default",0,({accessToken:e,value:l,placeholder:d="Select a Model",onChange:c,disabled:u=!1,style:h,className:f,showLabel:p=!0,labelText:m="Select Model"})=>{let[g,y]=(0,r.useState)(l),[x,b]=(0,r.useState)(!1),[_,v]=(0,r.useState)([]),w=(0,r.useRef)(null);return(0,r.useEffect)(()=>{y(l)},[l]),(0,r.useEffect)(()=>{e&&(async()=>{try{let t=await (0,o.fetchAvailableModels)(e);console.log("Fetched models for selector:",t),t.length>0&&v(t)}catch(e){console.error("Error fetching model info:",e)}})()},[e]),(0,t.jsxs)("div",{children:[p&&(0,t.jsxs)(n.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(a.RobotOutlined,{className:"mr-2"})," ",m]}),(0,t.jsx)(s.Select,{value:g,placeholder:d,onChange:e=>{"custom"===e?(b(!0),y(void 0)):(b(!1),y(e),c&&c(e))},options:[...Array.from(new Set(_.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...h},showSearch:!0,className:`rounded-md ${f||""}`,disabled:u}),x&&(0,t.jsx)(i.TextInput,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{y(e),c&&c(e)},500)},disabled:u})]})}])},519756,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let i={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"};var n=e.i(9583),s=r.forwardRef(function(e,s){return r.createElement(n.default,(0,t.default)({},e,{ref:s,icon:i}))});e.s(["UploadOutlined",0,s],519756)},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},500330,e=>{"use strict";var t=e.i(727749);function r(e,t){let r=structuredClone(e);for(let[e,i]of Object.entries(t))e in r&&(r[e]=i);return r}let i=(e,t=0,r=!1,i=!0)=>{if(null==e||!Number.isFinite(e)||0===e&&!i)return"-";let n={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",n);let s=e<0?"-":"",a=Math.abs(e),o=a,l="";return a>=1e6?(o=a/1e6,l="M"):a>=1e3&&(o=a/1e3,l="K"),`${s}${o.toLocaleString("en-US",n)}${l}`},n=async(e,r="Copied to clipboard")=>{if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return s(e,r);try{return await navigator.clipboard.writeText(e),t.default.success(r),!0}catch(t){return console.error("Clipboard API failed: ",t),s(e,r)}},s=(e,r)=>{try{let i=document.createElement("textarea");i.value=e,i.style.position="fixed",i.style.left="-999999px",i.style.top="-999999px",i.setAttribute("readonly",""),document.body.appendChild(i),i.focus(),i.select();let n=document.execCommand("copy");if(document.body.removeChild(i),n)return t.default.success(r),!0;throw Error("execCommand failed")}catch(e){return t.default.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};e.s(["copyToClipboard",0,n,"formatNumberWithCommas",0,i,"getSpendString",0,(e,t=6)=>{if(null==e||!Number.isFinite(e)||0===e)return"-";let r=i(e,t,!1,!1);if(0===Number(r.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return`< $${e}`}return`$${r}`},"updateExistingKeys",()=>r])},409797,e=>{"use strict";var t=e.i(631171);e.s(["ChevronDownIcon",()=>t.default])},91739,e=>{"use strict";var t=e.i(544195);e.s(["Radio",()=>t.default])},988297,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.s(["PlusIcon",0,r],988297)},797672,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});e.s(["PencilIcon",0,r],797672)},500727,699857,696609,531516,e=>{"use strict";var t=e.i(266027),r=e.i(243652),i=e.i(764205),n=e.i(135214);let s=(0,r.createQueryKeys)("mcpServers");e.s(["useMCPServers",0,e=>{let{accessToken:r}=(0,n.default)();return(0,t.useQuery)({queryKey:s.list(e?{filters:{teamId:e}}:void 0),queryFn:async()=>await (0,i.fetchMCPServers)(r,e),enabled:!!r})}],500727);let a=(0,r.createQueryKeys)("mcpToolsets");e.s(["useMCPToolsets",0,()=>{let{accessToken:e}=(0,n.default)();return(0,t.useQuery)({queryKey:a.list(),queryFn:async()=>await (0,i.fetchMCPToolsets)(e),enabled:!!e})}],699857);var o=e.i(843476),l=e.i(271645),d=e.i(536916),c=e.i(599724),u=e.i(409797),h=e.i(246349),h=h;let f=/\b(delete|remove|destroy|purge|drop|erase|unlink)\b/i,p=/\b(create|add|insert|new|post|submit|register|make|generate|write|upload)\b/i,m=/\b(update|edit|modify|change|patch|put|set|rename|move|transform)\b/i,g=/\b(get|read|list|fetch|search|find|query|retrieve|show|view|check|describe|info)\b/i;function y(e,t=""){let r=e.toLowerCase();if(g.test(r))return"read";if(f.test(r))return"delete";if(m.test(r))return"update";if(p.test(r))return"create";if(t){let e=t.toLowerCase();if(g.test(e))return"read";if(f.test(e))return"delete";if(m.test(e))return"update";if(p.test(e))return"create"}return"unknown"}function x(e){let t={read:[],create:[],update:[],delete:[],unknown:[]};for(let r of e)t[y(r.name,r.description)].push(r);return t}let b={read:{label:"Read",description:"Safe operations — fetch, list, search. No side effects.",risk:"low"},create:{label:"Create",description:"Add new resources — insert, upload, register.",risk:"medium"},update:{label:"Update",description:"Modify existing resources — edit, patch, rename.",risk:"medium"},delete:{label:"Delete",description:"Destructive operations — remove, purge, destroy.",risk:"high"},unknown:{label:"Other",description:"Operations that could not be automatically classified.",risk:"unknown"}};e.s(["CRUD_GROUP_META",0,b,"classifyToolOp",()=>y,"groupToolsByCrud",()=>x],696609);let _=["read","create","update","delete","unknown"],v={low:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",high:"bg-red-100 text-red-800 font-semibold",unknown:"bg-gray-100 text-gray-700"},w={read:"border-green-200",create:"border-blue-200",update:"border-yellow-200",delete:"border-red-300",unknown:"border-gray-200"},k={read:"bg-green-50",create:"bg-blue-50",update:"bg-yellow-50",delete:"bg-red-50",unknown:"bg-gray-50"};e.s(["default",0,({tools:e,value:t,onChange:r,readOnly:i=!1,searchFilter:n=""})=>{let[s,a]=(0,l.useState)({read:!1,create:!1,update:!1,delete:!1,unknown:!0}),f=(0,l.useMemo)(()=>x(e),[e]),p=(0,l.useMemo)(()=>new Set(void 0===t?e.map(e=>e.name):t),[t,e]),m=e=>{if(i)return;let t=new Set(p);t.has(e)?t.delete(e):t.add(e),r(Array.from(t))};return 0===e.length?null:(0,o.jsx)("div",{className:"space-y-3",children:_.map(e=>{let t,l=f[e];if(0===l.length)return null;if(n){let e=n.toLowerCase();if(!l.some(t=>t.name.toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)))return null}let g=b[e],y=(t=f[e]).length>0&&t.every(e=>p.has(e.name)),x=(e=>{let t=f[e];if(0===t.length)return!1;let r=t.filter(e=>p.has(e.name)).length;return r>0&&r{a(t=>({...t,[e]:!t[e]}))},children:[_?(0,o.jsx)(h.default,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}):(0,o.jsx)(u.ChevronDownIcon,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}),(0,o.jsx)("span",{className:"font-semibold text-gray-900 text-sm",children:g.label}),(0,o.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-full ${v[g.risk]}`,children:"high"===g.risk?"High Risk":"medium"===g.risk?"Medium Risk":"low"===g.risk?"Safe":"Unclassified"}),(0,o.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:[l.filter(e=>p.has(e.name)).length,"/",l.length," allowed"]})]}),!i&&(0,o.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,o.jsx)(c.Text,{className:"text-xs text-gray-500",children:y?"All on":x?"Partial":"All off"}),(0,o.jsx)(d.Checkbox,{checked:y,indeterminate:x,onChange:t=>((e,t)=>{if(i)return;let n=new Set(p);for(let r of f[e])t?n.add(r.name):n.delete(r.name);r(Array.from(n))})(e,t.target.checked),onClick:e=>e.stopPropagation()})]})]}),!_&&(0,o.jsx)("div",{className:"px-4 pt-2 pb-1 text-xs text-gray-500 bg-white border-b border-gray-100",children:g.description}),!_&&(0,o.jsx)("div",{className:"bg-white divide-y divide-gray-50",children:l.filter(e=>!n||e.name.toLowerCase().includes(n.toLowerCase())||(e.description??"").toLowerCase().includes(n.toLowerCase())).map(e=>{let t,r=(t=e.name,p.has(t));return(0,o.jsxs)("div",{className:`flex items-start gap-3 px-4 py-2.5 transition-colors hover:bg-gray-50 ${!i?"cursor-pointer":""} ${r?"":"opacity-60"}`,onClick:()=>m(e.name),children:[(0,o.jsx)(d.Checkbox,{checked:r,onChange:()=>m(e.name),disabled:i,onClick:e=>e.stopPropagation()}),(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsx)(c.Text,{className:"font-medium text-gray-900 text-sm",children:e.name}),e.description&&(0,o.jsx)(c.Text,{className:"text-xs text-gray-500 mt-0.5 leading-snug",children:e.description})]}),(0,o.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded flex-shrink-0 ${r?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,children:r?"on":"off"})]},e.name)})})]},e)})})}],531516)},309426,e=>{"use strict";var t=e.i(290571),r=e.i(444755),i=e.i(673706),n=e.i(271645),s=e.i(46757);let a=(0,i.makeClassName)("Col"),o=n.default.forwardRef((e,i)=>{let o,l,d,c,{numColSpan:u=1,numColSpanSm:h,numColSpanMd:f,numColSpanLg:p,children:m,className:g}=e,y=(0,t.__rest)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),x=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return n.default.createElement("div",Object.assign({ref:i,className:(0,r.tremorTwMerge)(a("root"),(o=x(u,s.colSpan),l=x(h,s.colSpanSm),d=x(f,s.colSpanMd),c=x(p,s.colSpanLg),(0,r.tremorTwMerge)(o,l,d,c)),g)},y),m)});o.displayName="Col",e.s(["Col",()=>o],309426)},59935,(e,t,r)=>{var i;let n;e.e,i=function e(){var t,r="u">typeof self?self:"u">typeof window?window:void 0!==r?r:{},i=!r.document&&!!r.postMessage,n=r.IS_PAPA_WORKER||!1,s={},a=0,o={};function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new f(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview,n)r.postMessage({results:s,workerId:o.WORKER_ID,finished:i});else if(v(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=s=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!i||!v(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),i||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){v(this._config.error)?this._config.error(e):n&&this._config.error&&r.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function d(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),l.call(this,e),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),i||(t.onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var e,r,n=this._config.downloadRequestHeaders;for(r in n)t.setRequestHeader(r,n[r])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}i&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function c(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),l.call(this,e);var t,r,i="u">typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,i?((t=new FileReader).onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function u(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,r;if(!this._finished)return t=(e=this._config.chunkSize)?(r=t.substring(0,e),t.substring(e)):(r=t,""),this._finished=!t,this.parseChunk(r)}}function h(e){l.call(this,e=e||{});var t=[],r=!0,i=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=_(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=_(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=_(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=_(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function f(e){var t,r,i,n,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,d=0,c=0,u=!1,h=!1,f=[],g={data:[],errors:[],meta:{}};function y(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function x(){if(g&&i&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),i=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!y(e)})),_()){if(g)if(Array.isArray(g.data[0])){for(var t,r=0;_()&&r(e.dynamicTypingFunction&&void 0===e.dynamicTyping[t]&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping))?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&((e=>{if(s.test(e)&&-0x20000000000000<(e=parseFloat(e))&&e<0x20000000000000)return 1})(r)?parseFloat(r):a.test(r)?new Date(r):""===r?null:r):r)(o=e.header?n>=f.length?"__parsed_extra":f[n]:o,l=e.transform?e.transform(l,o):l);"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(l)):i[o]=l}return e.header&&(n>f.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+f.length+" fields but parsed "+n,c+r):ne.preview?r.abort():(g.data=g.data[0],n(g,l))))}),this.parse=function(n,s,a){var l=e.quoteChar||'"',l=(e.newline||(e.newline=this.guessLineEndings(n,l)),i=!1,e.delimiter?v(e.delimiter)&&(e.delimiter=e.delimiter(n),g.meta.delimiter=e.delimiter):((l=((t,r,i,n,s)=>{var a,l,d,c;s=s||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var u=0;u=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,r=e.newline,i=e.comments,n=e.step,s=e.preview,a=e.fastMode,l=null,d=!1,c=null==e.quoteChar?'"':e.quoteChar,u=c;if(void 0!==e.escapeChar&&(u=e.escapeChar),("string"!=typeof t||-1=s)return D(!0);break}j.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:k.length,index:h}),M++}}else if(i&&0===C.length&&o.substring(h,h+_)===i){if(-1===R)return D();h=R+b,R=o.indexOf(r,h),E=o.indexOf(t,h)}else if(-1!==E&&(E=s)return D(!0)}return A();function L(e){k.push(e),S=h}function F(e){return -1!==e&&(e=o.substring(M+1,e))&&""===e.trim()?e.length:0}function A(e){return g||(void 0===e&&(e=o.substring(h)),C.push(e),h=y,L(C),w&&z()),D()}function I(e){h=e,L(C),C=[],R=o.indexOf(r,h)}function D(i){if(e.header&&!m&&k.length&&!d){var n=k[0],s=Object.create(null),a=new Set(n);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||o.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(n=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(r=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(d=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=t.quoteChar),"boolean"==typeof t.header&&(i=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");c=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+a),t.escapeFormulae instanceof RegExp?u=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(u=/^[=+\-@\t\r].*$/)}})(),RegExp(p(a),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,d);if("object"==typeof e[0])return f(c||Object.keys(e[0]),e,d)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||c),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],d);throw Error("Unable to serialize unrecognized input");function f(e,t,r){var a="",o=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var r=0;r{"use strict";var t=e.i(184163);e.s(["DownloadOutlined",()=>t.default])},916940,e=>{"use strict";var t=e.i(843476),r=e.i(271645),i=e.i(199133),n=e.i(764205);e.s(["default",0,({onChange:e,value:s,className:a,accessToken:o,placeholder:l="Select vector stores",disabled:d=!1})=>{let[c,u]=(0,r.useState)([]),[h,f]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(o){f(!0);try{let e=await (0,n.vectorStoreListCall)(o);e.data&&u(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{f(!1)}}})()},[o]),(0,t.jsx)("div",{children:(0,t.jsx)(i.Select,{mode:"multiple",placeholder:l,onChange:e,value:s,loading:h,className:a,allowClear:!0,options:c.map(e=>({label:`${e.vector_store_name||e.vector_store_id} (${e.vector_store_id})`,value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})})}])},689020,e=>{"use strict";var t=e.i(764205);let r=async e=>{try{let r=await (0,t.modelHubCall)(e);if(console.log("model_info:",r),r?.data.length>0){let e=r.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,r])},599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),i=e.i(673706),n=e.i(271645);let s=n.default.forwardRef((e,s)=>{let{color:a,className:o,children:l}=e;return n.default.createElement("p",{ref:s,className:(0,r.tremorTwMerge)("text-tremor-default",a?(0,i.getColorClassNames)(a,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),o)},l)});s.displayName="Text",e.s(["default",()=>s],936325),e.s(["Text",()=>s],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),i=e.i(480731),n=e.i(95779),s=e.i(444755),a=e.i(673706);let o=(0,a.makeClassName)("Card"),l=r.default.forwardRef((e,l)=>{let{decoration:d="",decorationColor:c,children:u,className:h}=e,f=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:l,className:(0,s.tremorTwMerge)(o("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",c?(0,a.getColorClassNames)(c,n.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case i.HorizontalPositions.Left:return"border-l-4";case i.VerticalPositions.Top:return"border-t-4";case i.HorizontalPositions.Right:return"border-r-4";case i.VerticalPositions.Bottom:return"border-b-4";default:return""}})(d),h)},f),u)});l.displayName="Card",e.s(["Card",()=>l],304967)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),i=e.i(444755),n=e.i(673706),s=e.i(271645);let a=s.default.forwardRef((e,a)=>{let{color:o,children:l,className:d}=e,c=(0,t.__rest)(e,["color","children","className"]);return s.default.createElement("p",Object.assign({ref:a,className:(0,i.tremorTwMerge)("font-medium text-tremor-title",o?(0,n.getColorClassNames)(o,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",d)},c),l)});a.displayName="Title",e.s(["Title",()=>a],629569)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},246349,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",()=>t])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/355b9871de1cf382.js b/litellm/proxy/_experimental/out/_next/static/chunks/355b9871de1cf382.js
new file mode 100644
index 0000000000..52a9a2cc81
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/355b9871de1cf382.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,596239,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:s}))});e.s(["LinkOutlined",0,a],596239)},954616,e=>{"use strict";var t=e.i(271645),r=e.i(114272),s=e.i(540143),l=e.i(915823),a=e.i(619273),i=class extends l.Subscribable{#e;#t=void 0;#r;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#l()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,a.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.hashKey)(t.mutationKey)!==(0,a.hashKey)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#l(),this.#a()}mutate(e,t){return this.#s=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#l(){let e=this.#r?.state??(0,r.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){s.notifyManager.batch(()=>{if(this.#s&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(e){Promise.reject(e)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(e){Promise.reject(e)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},o=e.i(912598);function n(e,r){let l=(0,o.useQueryClient)(r),[n]=t.useState(()=>new i(l,e));t.useEffect(()=>{n.setOptions(e)},[n,e]);let c=t.useSyncExternalStore(t.useCallback(e=>n.subscribe(s.notifyManager.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),d=t.useCallback((e,t)=>{n.mutate(e,t).catch(a.noop)},[n]);if(c.error&&(0,a.shouldThrowError)(n.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:d,mutateAsync:c.mutate}}e.s(["useMutation",()=>n],954616)},178654,621192,e=>{"use strict";let t=e.i(211576).Col;e.s(["Col",0,t],178654);let r=e.i(264042).Row;e.s(["Row",0,r],621192)},599724,936325,e=>{"use strict";var t=e.i(95779),r=e.i(444755),s=e.i(673706),l=e.i(271645);let a=l.default.forwardRef((e,a)=>{let{color:i,className:o,children:n}=e;return l.default.createElement("p",{ref:a,className:(0,r.tremorTwMerge)("text-tremor-default",i?(0,s.getColorClassNames)(i,t.colorPalette.text).textColor:(0,r.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),o)},n)});a.displayName="Text",e.s(["default",()=>a],936325),e.s(["Text",()=>a],599724)},304967,e=>{"use strict";var t=e.i(290571),r=e.i(271645),s=e.i(480731),l=e.i(95779),a=e.i(444755),i=e.i(673706);let o=(0,i.makeClassName)("Card"),n=r.default.forwardRef((e,n)=>{let{decoration:c="",decorationColor:d,children:u,className:m}=e,h=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return r.default.createElement("div",Object.assign({ref:n,className:(0,a.tremorTwMerge)(o("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",d?(0,i.getColorClassNames)(d,l.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case s.HorizontalPositions.Left:return"border-l-4";case s.VerticalPositions.Top:return"border-t-4";case s.HorizontalPositions.Right:return"border-r-4";case s.VerticalPositions.Bottom:return"border-b-4";default:return""}})(c),m)},h),u)});n.displayName="Card",e.s(["Card",()=>n],304967)},629569,e=>{"use strict";var t=e.i(290571),r=e.i(95779),s=e.i(444755),l=e.i(673706),a=e.i(271645);let i=a.default.forwardRef((e,i)=>{let{color:o,children:n,className:c}=e,d=(0,t.__rest)(e,["color","children","className"]);return a.default.createElement("p",Object.assign({ref:i,className:(0,s.tremorTwMerge)("font-medium text-tremor-title",o?(0,l.getColorClassNames)(o,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},d),n)});i.displayName="Title",e.s(["Title",()=>i],629569)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:s}))});e.s(["ArrowLeftOutlined",0,a],447566)},492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},689020,e=>{"use strict";var t=e.i(764205);let r=async e=>{try{let r=await (0,t.modelHubCall)(e);if(console.log("model_info:",r),r?.data.length>0){let e=r.data.map(e=>({model_group:e.model_group,mode:e?.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};e.s(["fetchAvailableModels",0,r])},646563,e=>{"use strict";var t=e.i(959013);e.s(["PlusOutlined",()=>t.default])},211576,e=>{"use strict";var t=e.i(131757);e.s(["Col",()=>t.default])},992619,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(779241),l=e.i(599724),a=e.i(199133),i=e.i(983561),o=e.i(689020);e.s(["default",0,({accessToken:e,value:n,placeholder:c="Select a Model",onChange:d,disabled:u=!1,style:m,className:h,showLabel:g=!0,labelText:f="Select Model"})=>{let[p,x]=(0,r.useState)(n),[b,v]=(0,r.useState)(!1),[y,w]=(0,r.useState)([]),j=(0,r.useRef)(null);return(0,r.useEffect)(()=>{x(n)},[n]),(0,r.useEffect)(()=>{e&&(async()=>{try{let t=await (0,o.fetchAvailableModels)(e);console.log("Fetched models for selector:",t),t.length>0&&w(t)}catch(e){console.error("Error fetching model info:",e)}})()},[e]),(0,t.jsxs)("div",{children:[g&&(0,t.jsxs)(l.Text,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,t.jsx)(i.RobotOutlined,{className:"mr-2"})," ",f]}),(0,t.jsx)(a.Select,{value:p,placeholder:c,onChange:e=>{"custom"===e?(v(!0),x(void 0)):(v(!1),x(e),d&&d(e))},options:[...Array.from(new Set(y.map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%",...m},showSearch:!0,className:`rounded-md ${h||""}`,disabled:u}),b&&(0,t.jsx)(s.TextInput,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{x(e),d&&d(e)},500)},disabled:u})]})}])},530212,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.s(["ArrowLeftIcon",0,r],530212)},500330,e=>{"use strict";var t=e.i(727749);function r(e,t){let r=structuredClone(e);for(let[e,s]of Object.entries(t))e in r&&(r[e]=s);return r}let s=(e,t=0,r=!1,s=!0)=>{if(null==e||!Number.isFinite(e)||0===e&&!s)return"-";let l={minimumFractionDigits:t,maximumFractionDigits:t};if(!r)return e.toLocaleString("en-US",l);let a=e<0?"-":"",i=Math.abs(e),o=i,n="";return i>=1e6?(o=i/1e6,n="M"):i>=1e3&&(o=i/1e3,n="K"),`${a}${o.toLocaleString("en-US",l)}${n}`},l=async(e,r="Copied to clipboard")=>{if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return a(e,r);try{return await navigator.clipboard.writeText(e),t.default.success(r),!0}catch(t){return console.error("Clipboard API failed: ",t),a(e,r)}},a=(e,r)=>{try{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.left="-999999px",s.style.top="-999999px",s.setAttribute("readonly",""),document.body.appendChild(s),s.focus(),s.select();let l=document.execCommand("copy");if(document.body.removeChild(s),l)return t.default.success(r),!0;throw Error("execCommand failed")}catch(e){return t.default.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};e.s(["copyToClipboard",0,l,"formatNumberWithCommas",0,s,"getSpendString",0,(e,t=6)=>{if(null==e||!Number.isFinite(e)||0===e)return"-";let r=s(e,t,!1,!1);if(0===Number(r.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return`< $${e}`}return`$${r}`},"updateExistingKeys",()=>r])},350967,46757,e=>{"use strict";var t=e.i(290571),r=e.i(444755),s=e.i(673706),l=e.i(271645);let a={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},i={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},o={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},n={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},c={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},d={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},u={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},m={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};e.s(["colSpan",()=>c,"colSpanLg",()=>m,"colSpanMd",()=>u,"colSpanSm",()=>d,"gridCols",()=>a,"gridColsLg",()=>n,"gridColsMd",()=>o,"gridColsSm",()=>i],46757);let h=(0,s.makeClassName)("Grid"),g=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",f=l.default.forwardRef((e,s)=>{let{numItems:c=1,numItemsSm:d,numItemsMd:u,numItemsLg:m,children:f,className:p}=e,x=(0,t.__rest)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),b=g(c,a),v=g(d,i),y=g(u,o),w=g(m,n),j=(0,r.tremorTwMerge)(b,v,y,w);return l.default.createElement("div",Object.assign({ref:s,className:(0,r.tremorTwMerge)(h("root"),"grid",j,p)},x),f)});f.displayName="Grid",e.s(["Grid",()=>f],350967)},981339,e=>{"use strict";var t=e.i(185793);e.s(["Skeleton",()=>t.default])},149121,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(152990),l=e.i(682830),a=e.i(269200),i=e.i(427612),o=e.i(64848),n=e.i(942232),c=e.i(496020),d=e.i(977572);function u({data:e=[],columns:u,onRowClick:m,renderSubComponent:h,renderChildRows:g,getRowCanExpand:f,isLoading:p=!1,loadingMessage:x="🚅 Loading logs...",noDataMessage:b="No logs found",enableSorting:v=!1}){let y=!!(h||g)&&!!f,[w,j]=(0,r.useState)([]),C=(0,s.useReactTable)({data:e,columns:u,...v&&{state:{sorting:w},onSortingChange:j,enableSortingRemoval:!1},...y&&{getRowCanExpand:f},getRowId:(e,t)=>e?.request_id??String(t),getCoreRowModel:(0,l.getCoreRowModel)(),...v&&{getSortedRowModel:(0,l.getSortedRowModel)()},...y&&{getExpandedRowModel:(0,l.getExpandedRowModel)()}});return(0,t.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,t.jsxs)(a.Table,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,t.jsx)(i.TableHead,{children:C.getHeaderGroups().map(e=>(0,t.jsx)(c.TableRow,{children:e.headers.map(e=>{let r=v&&e.column.getCanSort(),l=e.column.getIsSorted();return(0,t.jsx)(o.TableHeaderCell,{className:`py-1 h-8 ${r?"cursor-pointer select-none hover:bg-gray-50":""}`,onClick:r?e.column.getToggleSortingHandler():void 0,children:e.isPlaceholder?null:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.flexRender)(e.column.columnDef.header,e.getContext()),r&&(0,t.jsx)("span",{className:"text-gray-400",children:"asc"===l?"↑":"desc"===l?"↓":"⇅"})]})},e.id)})},e.id))}),(0,t.jsx)(n.TableBody,{children:p?(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:x})})})}):C.getRowModel().rows.length>0?C.getRowModel().rows.map(e=>(0,t.jsxs)(r.Fragment,{children:[(0,t.jsx)(c.TableRow,{className:`h-8 ${m?"cursor-pointer hover:bg-gray-50":""}`,onClick:()=>m?.(e.original),children:e.getVisibleCells().map(e=>(0,t.jsx)(d.TableCell,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,s.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))}),y&&e.getIsExpanded()&&g&&g({row:e}),y&&e.getIsExpanded()&&h&&!g&&(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:h({row:e})})})})]},e.id)):(0,t.jsx)(c.TableRow,{children:(0,t.jsx)(d.TableCell,{colSpan:u.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:b})})})})})]})})}e.s(["DataTable",()=>u])},440987,e=>{"use strict";var t=e.i(903446);e.s(["SettingsIcon",()=>t.default])},848725,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function(e,r){return t.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:r},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))});e.s(["EyeIcon",0,r],848725)},292335,122520,165615,e=>{"use strict";let t={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",TOKEN:"token",BASIC:"basic",OAUTH2:"oauth2",AWS_SIGV4:"aws_sigv4"},r={SSE:"sse",HTTP:"http",STDIO:"stdio",OPENAPI:"openapi"};function s(e){if(e instanceof Error)return e.message;if(e&&"object"==typeof e){let t=e.detail;return"string"==typeof t?t:Array.isArray(t)?t.map(e=>e&&"object"==typeof e?"string"==typeof e.msg?e.msg:JSON.stringify(e):String(e)).join("; "):t&&"object"==typeof t&&"string"==typeof t.error?t.error:"string"==typeof e.message?e.message:JSON.stringify(e)}return String(e)}e.s(["AUTH_TYPE",0,t,"OAUTH_FLOW",0,{INTERACTIVE:"interactive",M2M:"m2m"},"TRANSPORT",0,r,"handleAuth",0,e=>null==e?t.NONE:e,"handleTransport",0,(e,t)=>null==e?r.SSE:t&&e!==r.STDIO?r.OPENAPI:e],292335),e.s(["extractErrorMessage",()=>s],122520);let l=e=>{let t=new Uint8Array(e),r="";return t.forEach(e=>r+=String.fromCharCode(e)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},a=async e=>{let t=new TextEncoder().encode(e);return l(await window.crypto.subtle.digest("SHA-256",t))};e.s(["generateCodeChallenge",0,a,"generateCodeVerifier",0,()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),l(e.buffer)}],165615)},995926,e=>{"use strict";var t=e.i(841947);e.s(["XIcon",()=>t.default])},750113,e=>{"use strict";var t=e.i(684024);e.s(["QuestionCircleOutlined",()=>t.default])},988846,e=>{"use strict";var t=e.i(54943);e.s(["SearchIcon",()=>t.default])},328196,e=>{"use strict";var t=e.i(361653);e.s(["AlertCircleIcon",()=>t.default])},302202,e=>{"use strict";let t=(0,e.i(475254).default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["ServerIcon",()=>t],302202)},54131,634831,438100,e=>{"use strict";var t=e.i(399219);e.s(["ChevronUpIcon",()=>t.default],54131);var r=e.i(546467);e.s(["ExternalLinkIcon",()=>r.default],634831);let s=(0,e.i(475254).default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);e.s(["KeyIcon",()=>s],438100)},546467,e=>{"use strict";let t=(0,e.i(475254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["default",()=>t])},54943,e=>{"use strict";let t=(0,e.i(475254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",()=>t])},987432,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:s}))});e.s(["SaveOutlined",0,a],987432)},245094,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:s}))});e.s(["CodeOutlined",0,a],245094)},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},245704,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:s}))});e.s(["CheckCircleOutlined",0,a],245704)},149192,e=>{"use strict";var t=e.i(864517);e.s(["CloseOutlined",()=>t.default])},903446,e=>{"use strict";let t=(0,e.i(475254).default)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["default",()=>t])},434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function r(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>r,"setSecureItem",()=>t])},458505,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let s={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"};var l=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(l.default,(0,t.default)({},e,{ref:a,icon:s}))});e.s(["DollarOutlined",0,a],458505)},611052,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(212931),l=e.i(311451),a=e.i(790848),i=e.i(888259),o=e.i(438957);e.i(247167);var n=e.i(931067);let c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};var d=e.i(9583),u=r.forwardRef(function(e,t){return r.createElement(d.default,(0,n.default)({},e,{ref:t,icon:c}))}),m=e.i(492030),h=e.i(266537),g=e.i(447566),f=e.i(149192),p=e.i(596239);e.s(["ByokCredentialModal",0,({server:e,open:n,onClose:c,onSuccess:d,accessToken:x})=>{let[b,v]=(0,r.useState)(1),[y,w]=(0,r.useState)(""),[j,C]=(0,r.useState)(!0),[k,N]=(0,r.useState)(!1),S=e.alias||e.server_name||"Service",M=S.charAt(0).toUpperCase(),R=()=>{v(1),w(""),C(!0),N(!1),c()},O=async()=>{if(!y.trim())return void i.default.error("Please enter your API key");N(!0);try{let t=await fetch(`/v1/mcp/server/${e.server_id}/user-credential`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${x}`},body:JSON.stringify({credential:y.trim(),save:j})});if(!t.ok){let e=await t.json();throw Error(e?.detail?.error||"Failed to save credential")}i.default.success(`Connected to ${S}`),d(e.server_id),R()}catch(e){i.default.error(e.message||"Failed to connect")}finally{N(!1)}};return(0,t.jsx)(s.Modal,{open:n,onCancel:R,footer:null,width:480,closeIcon:null,className:"byok-modal",children:(0,t.jsxs)("div",{className:"relative p-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[2===b?(0,t.jsxs)("button",{onClick:()=>v(1),className:"flex items-center gap-1 text-gray-500 hover:text-gray-800 text-sm",children:[(0,t.jsx)(g.ArrowLeftOutlined,{})," Back"]}):(0,t.jsx)("div",{}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("div",{className:`w-2 h-2 rounded-full ${1===b?"bg-blue-500":"bg-gray-300"}`}),(0,t.jsx)("div",{className:`w-2 h-2 rounded-full ${2===b?"bg-blue-500":"bg-gray-300"}`})]}),(0,t.jsx)("button",{onClick:R,className:"text-gray-400 hover:text-gray-600",children:(0,t.jsx)(f.CloseOutlined,{})})]}),1===b?(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-3 mb-6",children:[(0,t.jsx)("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-teal-400 to-cyan-600 flex items-center justify-center text-white font-bold text-xl shadow",children:"L"}),(0,t.jsx)(h.ArrowRightOutlined,{className:"text-gray-400 text-lg"}),(0,t.jsx)("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-800 flex items-center justify-center text-white font-bold text-xl shadow",children:M})]}),(0,t.jsxs)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:["Connect ",S]}),(0,t.jsxs)("p",{className:"text-gray-500 mb-6",children:["LiteLLM needs access to ",S," to complete your request."]}),(0,t.jsx)("div",{className:"bg-gray-50 rounded-xl p-4 text-left mb-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"text-gray-500",children:[(0,t.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M8 4v16M16 4v16",stroke:"currentColor",strokeWidth:"2"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold text-gray-800 mb-1",children:"How it works"}),(0,t.jsxs)("p",{className:"text-gray-500 text-sm",children:["LiteLLM acts as a secure bridge. Your requests are routed through our MCP client directly to"," ",S,"'s API."]})]})]})}),e.byok_description&&e.byok_description.length>0&&(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 text-left mb-6",children:[(0,t.jsxs)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-widest mb-3 flex items-center gap-2",children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"text-green-500",children:[(0,t.jsx)("path",{d:"M12 2L12 22M2 12L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2"})]}),"Requested Access"]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.byok_description.map((e,r)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,t.jsx)(m.CheckOutlined,{className:"text-green-500 flex-shrink-0"}),e]},r))})]}),(0,t.jsxs)("button",{onClick:()=>v(2),className:"w-full bg-gray-900 hover:bg-gray-700 text-white font-medium py-3 px-6 rounded-xl flex items-center justify-center gap-2 transition-colors",children:["Continue to Authentication ",(0,t.jsx)(h.ArrowRightOutlined,{})]}),(0,t.jsx)("button",{onClick:R,className:"mt-3 w-full text-gray-400 hover:text-gray-600 text-sm py-2",children:"Cancel"})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-blue-50 flex items-center justify-center mb-4",children:(0,t.jsx)(o.KeyOutlined,{className:"text-blue-400 text-xl"})}),(0,t.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Provide API Key"}),(0,t.jsxs)("p",{className:"text-gray-500 mb-6",children:["Enter your ",S," API key to authorize this connection."]}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("label",{className:"block text-sm font-semibold text-gray-800 mb-2",children:[S," API Key"]}),(0,t.jsx)(l.Input.Password,{placeholder:"Enter your API key",value:y,onChange:e=>w(e.target.value),size:"large",className:"rounded-lg"}),e.byok_api_key_help_url&&(0,t.jsxs)("a",{href:e.byok_api_key_help_url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 text-sm mt-2 flex items-center gap-1",children:["Where do I find my API key? ",(0,t.jsx)(p.LinkOutlined,{})]})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"text-gray-500",children:(0,t.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z",fill:"currentColor"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Save key for future use"})]}),(0,t.jsx)(a.Switch,{checked:j,onChange:C})]}),(0,t.jsxs)("div",{className:"bg-blue-50 rounded-xl p-4 flex items-start gap-3 mb-6",children:[(0,t.jsx)(u,{className:"text-blue-400 mt-0.5 flex-shrink-0"}),(0,t.jsx)("p",{className:"text-sm text-blue-700",children:"Your key is stored securely and transmitted over HTTPS. It is never shared with third parties."})]}),(0,t.jsxs)("button",{onClick:O,disabled:k,className:"w-full bg-blue-500 hover:bg-blue-600 disabled:opacity-60 text-white font-medium py-3 px-6 rounded-xl flex items-center justify-center gap-2 transition-colors",children:[(0,t.jsx)(u,{})," Connect & Authorize"]})]})]})})}],611052)},338468,e=>{"use strict";var t=e.i(843476);e.i(111790);var r=e.i(280881),s=e.i(135214);e.s(["default",0,()=>{let{accessToken:e,userRole:l,userId:a}=(0,s.default)();return(0,t.jsx)(r.MCPServers,{accessToken:e,userRole:l,userID:a})}])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/35e1b31334447d6e.js b/litellm/proxy/_experimental/out/_next/static/chunks/35e1b31334447d6e.js
deleted file mode 100644
index c7b53f37dd..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/35e1b31334447d6e.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84899,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={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"},s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["SendOutlined",0,r],84899)},362024,e=>{"use strict";var t=e.i(988122);e.s(["Collapse",()=>t.default])},755151,e=>{"use strict";var t=e.i(247153);e.s(["DownOutlined",()=>t.default])},240647,e=>{"use strict";var t=e.i(286612);e.s(["RightOutlined",()=>t.default])},245704,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={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"};var s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["CheckCircleOutlined",0,r],245704)},518617,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};var s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["CloseCircleOutlined",0,r],518617)},782273,793916,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M625.9 115c-5.9 0-11.9 1.6-17.4 5.3L254 352H90c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h164l354.5 231.7c5.5 3.6 11.6 5.3 17.4 5.3 16.7 0 32.1-13.3 32.1-32.1V147.1c0-18.8-15.4-32.1-32.1-32.1zM586 803L293.4 611.7l-18-11.7H146V424h129.4l17.9-11.7L586 221v582zm348-327H806c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16h128c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16zm-41.9 261.8l-110.3-63.7a15.9 15.9 0 00-21.7 5.9l-19.9 34.5c-4.4 7.6-1.8 17.4 5.8 21.8L856.3 800a15.9 15.9 0 0021.7-5.9l19.9-34.5c4.4-7.6 1.7-17.4-5.8-21.8zM760 344a15.9 15.9 0 0021.7 5.9L892 286.2c7.6-4.4 10.2-14.2 5.8-21.8L878 230a15.9 15.9 0 00-21.7-5.9L746 287.8a15.99 15.99 0 00-5.8 21.8L760 344z"}}]},name:"sound",theme:"outlined"};var s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["SoundOutlined",0,r],782273);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}}]},name:"audio",theme:"outlined"};var l=o.forwardRef(function(e,n){return o.createElement(s.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["AudioOutlined",0,l],793916)},458505,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={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"};var s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["DollarOutlined",0,r],458505)},219470,812618,e=>{"use strict";e.s(["coy",0,{'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}],219470),e.i(247167);var t=e.i(931067),o=e.i(271645);let n={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"};var s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["BulbOutlined",0,r],812618)},132104,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"};var s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["ArrowUpOutlined",0,r],132104)},447593,989022,e=>{"use strict";e.i(247167);var t=e.i(931067),o=e.i(271645),n={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"},s=e.i(9583),r=o.forwardRef(function(e,r){return o.createElement(s.default,(0,t.default)({},e,{ref:r,icon:n}))});e.s(["ClearOutlined",0,r],447593);var i=e.i(843476),l=e.i(592968),a=e.i(637235);let c={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"};var d=o.forwardRef(function(e,n){return o.createElement(s.default,(0,t.default)({},e,{ref:n,icon:c}))});let p={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"};var u=o.forwardRef(function(e,n){return o.createElement(s.default,(0,t.default)({},e,{ref:n,icon:p}))}),m=e.i(872934),f=e.i(812618),h=e.i(366308),g=e.i(458505);e.s(["default",0,({timeToFirstToken:e,totalLatency:t,usage:o,toolName:n})=>e||t||o?(0,i.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==e&&(0,i.jsx)(l.Tooltip,{title:"Time to first token",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(a.ClockCircleOutlined,{className:"mr-1"}),(0,i.jsxs)("span",{children:["TTFT: ",(e/1e3).toFixed(2),"s"]})]})}),void 0!==t&&(0,i.jsx)(l.Tooltip,{title:"Total latency",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(a.ClockCircleOutlined,{className:"mr-1"}),(0,i.jsxs)("span",{children:["Total Latency: ",(t/1e3).toFixed(2),"s"]})]})}),o?.promptTokens!==void 0&&(0,i.jsx)(l.Tooltip,{title:"Prompt tokens",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(u,{className:"mr-1"}),(0,i.jsxs)("span",{children:["In: ",o.promptTokens]})]})}),o?.completionTokens!==void 0&&(0,i.jsx)(l.Tooltip,{title:"Completion tokens",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(m.ExportOutlined,{className:"mr-1"}),(0,i.jsxs)("span",{children:["Out: ",o.completionTokens]})]})}),o?.reasoningTokens!==void 0&&(0,i.jsx)(l.Tooltip,{title:"Reasoning tokens",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(f.BulbOutlined,{className:"mr-1"}),(0,i.jsxs)("span",{children:["Reasoning: ",o.reasoningTokens]})]})}),o?.totalTokens!==void 0&&(0,i.jsx)(l.Tooltip,{title:"Total tokens",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(d,{className:"mr-1"}),(0,i.jsxs)("span",{children:["Total: ",o.totalTokens]})]})}),o?.cost!==void 0&&(0,i.jsx)(l.Tooltip,{title:"Cost",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(g.DollarOutlined,{className:"mr-1"}),(0,i.jsxs)("span",{children:["$",o.cost.toFixed(6)]})]})}),n&&(0,i.jsx)(l.Tooltip,{title:"Tool used",children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(h.ToolOutlined,{className:"mr-1"}),(0,i.jsxs)("span",{children:["Tool: ",n]})]})})]}):null],989022)},434166,e=>{"use strict";function t(e,t){window.sessionStorage.setItem(e,btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))))}function o(e){try{let t=window.sessionStorage.getItem(e);if(null===t)return null;return decodeURIComponent(atob(t).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""))}catch{return null}}e.s(["getSecureItem",()=>o,"setSecureItem",()=>t])},516015,(e,t,o)=>{},898547,(e,t,o)=>{var n=e.i(247167);e.r(516015);var s=e.r(271645),r=s&&"object"==typeof s&&"default"in s?s:{default:s},i=void 0!==n.default&&n.default.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},a=function(){function e(e){var t=void 0===e?{}:e,o=t.name,n=void 0===o?"stylesheet":o,s=t.optimizeForSpeed,r=void 0===s?i:s;c(l(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var a="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=a?a.getAttribute("content"):null}var t,o=e.prototype;return o.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},o.isOptimizeForSpeed=function(){return this._optimizeForSpeed},o.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,o){return"number"==typeof o?e._serverSheet.cssRules[o]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),o},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},o.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;ttypeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!o.cssRules[e])return e;o.deleteRule(e);try{o.insertRule(t,e)}catch(n){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),o.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},o.deleteRule=function(e){if("u"typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},o.cssRules=function(){var e=this;return"u">>0},p={};function u(e,t){if(!t)return"jsx-"+e;var o=String(t),n=e+o;return p[n]||(p[n]="jsx-"+d(e+"-"+o)),p[n]}function m(e,t){"u"typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var o=this.getIdAndRules(e),n=o.styleId,s=o.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var r=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=r,this._instancesCounts[n]=1},t.remove=function(e){var t=this,o=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(o in this._instancesCounts,"styleId: `"+o+"` not found"),this._instancesCounts[o]-=1,this._instancesCounts[o]<1){var n=this._fromServer&&this._fromServer[o];n?(n.parentNode.removeChild(n),delete this._fromServer[o]):(this._indices[o].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[o]),delete this._instancesCounts[o]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],o=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return o[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,o;return t=this.cssRules(),void 0===(o=e)&&(o={}),t.map(function(e){var t=e[0],n=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:o.nonce?o.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,o=e.dynamic,n=e.id;if(o){var s=u(n,o);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return m(s,e)}):[m(s,t)]}}return{styleId:u(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),h=s.createContext(null);function g(){return new f}function _(){return s.useContext(h)}h.displayName="StyleSheetContext";var b=r.default.useInsertionEffect||r.default.useLayoutEffect,v="u">typeof window?g():void 0;function x(e){var t=v||_();return t&&("u"{t.exports=e.r(898547).style},254530,452598,e=>{"use strict";e.i(247167);var t=e.i(356449),o=e.i(764205);async function n(e,n,s,r,i,l,a,c,d,p,u,m,f,h,g,_,b,v,x,y,S,j,w,k,z){console.log=function(){},console.log("isLocal:",!1);let C=y||(0,o.getProxyBaseUrl)(),R={};i&&i.length>0&&(R["x-litellm-tags"]=i.join(","));let T=new t.default.OpenAI({apiKey:r,baseURL:C,dangerouslyAllowBrowser:!0,defaultHeaders:R});try{let t,o=Date.now(),r=!1,i={},y=!1,C=[];for await(let x of(h&&h.length>0&&(h.includes("__all__")?C.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):h.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=z?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;C.push({type:"mcp",server_label:n,server_url:`litellm_proxy/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=S?.find(t=>t.server_id===e),o=t?.alias||t?.server_name||e,n=j?.[e]||[];C.push({type:"mcp",server_label:"litellm",server_url:`litellm_proxy/mcp/${o}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),await T.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:p,messages:e,...u?{vector_store_ids:u}:{},...m?{guardrails:m}:{},...f?{policies:f}:{},...C.length>0?{tools:C,tool_choice:"auto"}:{},...void 0!==b?{temperature:b}:{},...void 0!==v?{max_tokens:v}:{},...k?{mock_testing_fallbacks:!0}:{}},{signal:l}))){console.log("Stream chunk:",x);let e=x.choices[0]?.delta;if(console.log("Delta content:",x.choices[0]?.delta?.content),console.log("Delta reasoning content:",e?.reasoning_content),!r&&(x.choices[0]?.delta?.content||e&&e.reasoning_content)&&(r=!0,t=Date.now()-o,console.log("First token received! Time:",t,"ms"),c?(console.log("Calling onTimingData with:",t),c(t)):console.log("onTimingData callback is not defined!")),x.choices[0]?.delta?.content){let e=x.choices[0].delta.content;n(e,x.model)}if(e&&e.image&&g&&(console.log("Image generated:",e.image),g(e.image.url,x.model)),e&&e.reasoning_content){let t=e.reasoning_content;a&&a(t)}if(e&&e.provider_specific_fields?.search_results&&_&&(console.log("Search results found:",e.provider_specific_fields.search_results),_(e.provider_specific_fields.search_results)),e&&e.provider_specific_fields){let t=e.provider_specific_fields;if(t.mcp_list_tools&&!i.mcp_list_tools&&(i.mcp_list_tools=t.mcp_list_tools,w&&!y)){y=!0;let e={type:"response.output_item.done",item_id:"mcp_list_tools",item:{type:"mcp_list_tools",tools:t.mcp_list_tools.map(e=>({name:e.function?.name||e.name||"",description:e.function?.description||e.description||"",input_schema:e.function?.parameters||e.input_schema||{}}))},timestamp:Date.now()};w(e),console.log("MCP list_tools event sent:",e)}t.mcp_tool_calls&&(i.mcp_tool_calls=t.mcp_tool_calls),t.mcp_call_results&&(i.mcp_call_results=t.mcp_call_results),(t.mcp_list_tools||t.mcp_tool_calls||t.mcp_call_results)&&console.log("MCP metadata found in chunk:",{mcp_list_tools:t.mcp_list_tools?"present":"absent",mcp_tool_calls:t.mcp_tool_calls?"present":"absent",mcp_call_results:t.mcp_call_results?"present":"absent"})}if(x.usage&&d){console.log("Usage data found:",x.usage);let e={completionTokens:x.usage.completion_tokens,promptTokens:x.usage.prompt_tokens,totalTokens:x.usage.total_tokens};x.usage.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=x.usage.completion_tokens_details.reasoning_tokens),void 0!==x.usage.cost&&null!==x.usage.cost&&(e.cost=parseFloat(x.usage.cost)),d(e)}}w&&(i.mcp_tool_calls||i.mcp_call_results)&&i.mcp_tool_calls&&i.mcp_tool_calls.length>0&&i.mcp_tool_calls.forEach((e,t)=>{let o=e.function?.name||e.name||"",n=e.function?.arguments||e.arguments||"{}",s=i.mcp_call_results?.find(t=>t.tool_call_id===e.id||t.tool_call_id===e.call_id)||i.mcp_call_results?.[t],r={type:"response.output_item.done",item:{type:"mcp_call",name:o,arguments:"string"==typeof n?n:JSON.stringify(n),output:s?.result?"string"==typeof s.result?s.result:JSON.stringify(s.result):void 0},item_id:e.id||e.call_id,timestamp:Date.now()};w(r),console.log("MCP call event sent:",r)});let R=Date.now();x&&x(R-o)}catch(e){throw l?.aborted&&console.log("Chat completion request was cancelled"),e}}e.s(["makeOpenAIChatCompletionRequest",()=>n],254530);var s=e.i(727749);async function r(e,n,i,l,a=[],c,d,p,u,m,f,h,g,_,b,v,x,y,S,j,w,k,z){if(!l)throw Error("Virtual Key is required");if(!i||""===i.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let C=j||(0,o.getProxyBaseUrl)(),R={};a&&a.length>0&&(R["x-litellm-tags"]=a.join(","));let T=new t.default.OpenAI({apiKey:l,baseURL:C,dangerouslyAllowBrowser:!0,defaultHeaders:R});try{let t=Date.now(),o=!1,s=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),r=[];_&&_.length>0&&(_.includes("__all__")?r.push({type:"mcp",server_label:"litellm",server_url:`${C}/mcp`,require_approval:"never"}):_.forEach(e=>{if(e.startsWith("toolset:")){let t=e.slice(8),o=z?.find(e=>e.toolset_id===t),n=o?.toolset_name||t;r.push({type:"mcp",server_label:n,server_url:`${C}/mcp/${encodeURIComponent(n)}`,require_approval:"never"})}else{let t=w?.find(t=>t.server_id===e),o=t?.server_name||e,n=k?.[e]||[];r.push({type:"mcp",server_label:o,server_url:`${C}/mcp/${encodeURIComponent(o)}`,require_approval:"never",...n.length>0?{allowed_tools:n}:{}})}})),y&&r.push({type:"code_interpreter",container:{type:"auto"}});let l=await T.responses.create({model:i,input:s,stream:!0,litellm_trace_id:m,...b?{previous_response_id:b}:{},...f?{vector_store_ids:f}:{},...h?{guardrails:h}:{},...g?{policies:g}:{},...r.length>0?{tools:r,tool_choice:"auto"}:{}},{signal:c}),a="",j={code:"",containerId:""};for await(let e of l)if(console.log("Response event:",e),"object"==typeof e&&null!==e){if((e.type?.startsWith("response.mcp_")||"response.output_item.done"===e.type&&(e.item?.type==="mcp_list_tools"||e.item?.type==="mcp_call"))&&(console.log("MCP event received:",e),x)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||e.item?.id,item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};x(t)}"response.output_item.done"===e.type&&e.item?.type==="mcp_call"&&e.item?.name&&(a=e.item.name,console.log("MCP tool used:",a)),M=j;var M,N=j="response.output_item.done"===e.type&&e.item?.type==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):M;if("response.output_item.done"===e.type&&e.item?.type==="message"&&e.item?.content&&S){for(let t of e.item.content)if("output_text"===t.type&&t.annotations){let e=t.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||N.code)&&S({code:N.code,containerId:N.containerId,annotations:e})}}if("response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let s=e.delta;if(console.log("Text delta",s),s.length>0&&(n("assistant",s,i),!o)){o=!0;let e=Date.now()-t;console.log("First token received! Time:",e,"ms"),p&&p(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&d&&d(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,o=t.usage;if(console.log("Usage data:",o),console.log("Response completed event:",t),t.id&&v&&(console.log("Response ID for session management:",t.id),v(t.id)),o&&u){console.log("Usage data:",o);let e={completionTokens:o.output_tokens,promptTokens:o.input_tokens,totalTokens:o.total_tokens};o.completion_tokens_details?.reasoning_tokens&&(e.reasoningTokens=o.completion_tokens_details.reasoning_tokens),u(e,a)}}}return l}catch(e){throw c?.aborted?console.log("Responses API request was cancelled"):s.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIResponsesRequest",()=>r],452598)},355343,e=>{"use strict";var t=e.i(843476),o=e.i(437902),n=e.i(898586),s=e.i(362024);let{Text:r}=n.Typography,{Panel:i}=s.Collapse;e.s(["default",0,({events:e,className:n})=>{if(console.log("MCPEventsDisplay: Received events:",e),!e||0===e.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let r=e.find(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0),l=e.filter(e=>"response.output_item.done"===e.type&&e.item?.type==="mcp_call");return(console.log("MCPEventsDisplay: toolsEvent:",r),console.log("MCPEventsDisplay: mcpCallEvents:",l),r||0!==l.length)?(0,t.jsxs)("div",{className:`jsx-32b14b04f420f3ac mcp-events-display ${n||""}`,children:[(0,t.jsx)(o.default,{id:"32b14b04f420f3ac",children:".openai-mcp-tools.jsx-32b14b04f420f3ac{margin:0;padding:0;position:relative}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac,.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{color:#9ca3af!important;background:0 0!important;border:none!important;min-height:20px!important;padding:0 0 0 20px!important;font-size:14px!important;font-weight:400!important;line-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{color:#6b7280!important;background:0 0!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{background:0 0!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{color:#9ca3af!important;justify-content:center!important;align-items:center!important;width:16px!important;height:16px!important;font-size:10px!important;display:flex!important;position:absolute!important;top:2px!important;left:2px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{opacity:.8;background-color:#f3f4f6;width:.5px;position:absolute;top:18px;bottom:0;left:9px}.tool-item.jsx-32b14b04f420f3ac{color:#4b5563;z-index:1;background:#fff;margin:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:18px;position:relative}.mcp-section.jsx-32b14b04f420f3ac{z-index:1;background:#fff;margin-bottom:12px;position:relative}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{color:#6b7280;margin-bottom:4px;font-size:13px;font-weight:500}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid #f3f4f6;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;word-wrap:break-word;margin:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mcp-approved.jsx-32b14b04f420f3ac{color:#6b7280;align-items:center;font-size:13px;display:flex}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:700}.mcp-response-content.jsx-32b14b04f420f3ac{color:#374151;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,SF Mono,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5}"}),(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,t.jsxs)(s.Collapse,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:r?["list-tools"]:l.map((e,t)=>`mcp-call-${t}`),children:[r&&(0,t.jsx)(i,{header:"List tools",children:(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:r.item?.tools?.map((e,o)=>(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},o))})},"list-tools"),l.map((e,o)=>(0,t.jsx)(i,{header:e.item?.name||"Tool call",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:e.item?.arguments&&(0,t.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,t.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),e.item?.output&&(0,t.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,t.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},`mcp-call-${o}`))]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)}])},966988,e=>{"use strict";var t=e.i(843476),o=e.i(271645),n=e.i(464571),s=e.i(918789),r=e.i(650056),i=e.i(219470),l=e.i(755151),a=e.i(240647),c=e.i(812618);e.s(["default",0,({reasoningContent:e})=>{let[d,p]=(0,o.useState)(!0);return e?(0,t.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,t.jsxs)(n.Button,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>p(!d),icon:(0,t.jsx)(c.BulbOutlined,{}),children:[d?"Hide reasoning":"Show reasoning",d?(0,t.jsx)(l.DownOutlined,{className:"ml-1"}):(0,t.jsx)(a.RightOutlined,{className:"ml-1"})]}),d&&(0,t.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,t.jsx)(s.default,{components:{code({node:e,inline:o,className:n,children:s,...l}){let a=/language-(\w+)/.exec(n||"");return!o&&a?(0,t.jsx)(r.Prism,{style:i.coy,language:a[1],PreTag:"div",className:"rounded-md my-2",...l,children:String(s).replace(/\n$/,"")}):(0,t.jsx)("code",{className:`${n} px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono`,...l,children:s})}},children:e})})]}):null}])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/738efbc0d941f9d2.js b/litellm/proxy/_experimental/out/_next/static/chunks/37e77c06e99eb8ff.js
similarity index 87%
rename from litellm/proxy/_experimental/out/_next/static/chunks/738efbc0d941f9d2.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/37e77c06e99eb8ff.js
index 7b09407519..3a5400c407 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/738efbc0d941f9d2.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/37e77c06e99eb8ff.js
@@ -1 +1 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,326373,e=>{"use strict";var t=e.i(21539);e.s(["Dropdown",()=>t.default])},100486,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CrownOutlined",0,a],100486)},44121,186515,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["MenuFoldOutlined",0,a],44121);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"};var l=r.forwardRef(function(e,n){return r.createElement(o.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["MenuUnfoldOutlined",0,l],186515)},295320,283713,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M704 446H320c-4.4 0-8 3.6-8 8v402c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8V454c0-4.4-3.6-8-8-8zm-328 64h272v117H376V510zm272 290H376V683h272v117z"}},{tag:"path",attrs:{d:"M424 748a32 32 0 1064 0 32 32 0 10-64 0zm0-178a32 32 0 1064 0 32 32 0 10-64 0z"}},{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}}]},name:"cloud-server",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CloudServerOutlined",0,a],295320);var i=e.i(764205),l=e.i(612256);let s="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,l.useUIConfig)(),t=e?.is_control_plane??!1,n=e?.workers??[],[o,a]=(0,r.useState)(()=>localStorage.getItem(s));(0,r.useEffect)(()=>{if(!o||0===n.length)return;let e=n.find(e=>e.worker_id===o);e&&(0,i.switchToWorkerUrl)(e.url)},[o,n]);let c=n.find(e=>e.worker_id===o)??null,u=(0,r.useCallback)(e=>{let t=n.find(t=>t.worker_id===e);t&&(a(e),localStorage.setItem(s,e),(0,i.switchToWorkerUrl)(t.url))},[n]);return{isControlPlane:t,workers:n,selectedWorkerId:o,selectedWorker:c,selectWorker:u,disconnectFromWorker:(0,r.useCallback)(()=>{a(null),localStorage.removeItem(s),(0,i.switchToWorkerUrl)(null)},[])}}],283713)},371401,e=>{"use strict";var t=e.i(115571),r=e.i(271645);function n(e){let r=t=>{"disableUsageIndicator"===t.key&&e()},n=t=>{let{key:r}=t.detail;"disableUsageIndicator"===r&&e()};return window.addEventListener("storage",r),window.addEventListener(t.LOCAL_STORAGE_EVENT,n),()=>{window.removeEventListener("storage",r),window.removeEventListener(t.LOCAL_STORAGE_EVENT,n)}}function o(){return"true"===(0,t.getLocalStorageItem)("disableUsageIndicator")}function a(){return(0,r.useSyncExternalStore)(n,o)}e.s(["useDisableUsageIndicator",()=>a])},275144,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(764205);let o=(0,r.createContext)(void 0);e.s(["ThemeProvider",0,({children:e,accessToken:a})=>{let[i,l]=(0,r.useState)(null),[s,c]=(0,r.useState)(null);return(0,r.useEffect)(()=>{(async()=>{try{let e=(0,n.getProxyBaseUrl)(),t=e?`${e}/get/ui_theme_settings`:"/get/ui_theme_settings",r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){let e=await r.json();e.values?.logo_url&&l(e.values.logo_url),e.values?.favicon_url&&c(e.values.favicon_url)}}catch(e){console.warn("Failed to load theme settings from backend:",e)}})()},[]),(0,r.useEffect)(()=>{if(s){let e=document.querySelectorAll("link[rel*='icon']");if(e.length>0)e.forEach(e=>{e.href=s});else{let e=document.createElement("link");e.rel="icon",e.href=s,document.head.appendChild(e)}}},[s]),(0,t.jsx)(o.Provider,{value:{logoUrl:i,setLogoUrl:l,faviconUrl:s,setFaviconUrl:c},children:e})},"useTheme",0,()=>{let e=(0,r.useContext)(o);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e}])},998183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,i(e));else t.set(r,i(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},195057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(151836)._(e.r(998183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",l=e.hash||"",s=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),s&&"object"==typeof s&&(s=String(a.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),o=o.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${o}${u}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},718967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return x},NormalizeError:function(){return y},PageNotFoundError:function(){return w},SP:function(){return m},ST:function(){return p},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return j}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>l.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function g(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,p=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class w extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x 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 j(e){return JSON.stringify({message:e.message,stack:e.stack})}},573668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(718967),o=e.r(652817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},284508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},522016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return w}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(151836),i=e.r(843476),l=a._(e.r(271645)),s=e.r(195057),c=e.r(8372),u=e.r(818581),d=e.r(718967),f=e.r(405550);e.r(233525);let h=e.r(91949),g=e.r(573668),m=e.r(509396);function p(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,o,a,[s,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,l.useRef)(null),{href:x,as:b,children:j,prefetch:S=null,passHref:E,replace:L,shallow:_,scroll:C,onClick:k,onMouseEnter:T,onTouchStart:P,legacyBehavior:O=!1,onNavigate:I,ref:N,unstable_dynamicOnHover:B,...R}=t;n=j,O&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let U=l.default.useContext(c.AppRouterContext),z=!1!==S,A=!1!==S?null===(r=S)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,{href:M,as:D}=l.default.useMemo(()=>{let e=p(x);return{href:e,as:b?p(b):e}},[x,b]);if(O){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=l.default.Children.only(n)}let $=O?o&&"object"==typeof o&&o.ref:N,F=l.default.useCallback(e=>(null!==U&&(w.current=(0,h.mountLinkInstance)(e,M,U,A,z,v)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[z,M,U,A,v]),H={ref:(0,u.useMergedRef)(F,$),onClick(t){O||"function"!=typeof k||k(t),O&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,a,i,s){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(699781);l.default.startTransition(()=>{d(n||r,a?"replace":"push",i??!0,o.current)})}}(t,M,D,w,L,C,I)},onMouseEnter(e){O||"function"!=typeof T||T(e),O&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&z&&(0,h.onNavigationIntent)(e.currentTarget,!0===B)},onTouchStart:function(e){O||"function"!=typeof P||P(e),O&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&z&&(0,h.onNavigationIntent)(e.currentTarget,!0===B)}};return(0,d.isAbsoluteUrl)(D)?H.href=D:O&&!E&&("a"!==o.type||"href"in o.props)||(H.href=(0,f.addBasePath)(D)),a=O?l.default.cloneElement(o,H):(0,i.jsx)("a",{...R,...H,children:n}),(0,i.jsx)(y.Provider,{value:s,children:a})}e.r(284508);let y=(0,l.createContext)(h.IDLE_LINK_STATUS),w=()=>(0,l.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},402874,521323,636772,e=>{"use strict";var t=e.i(843476),r=e.i(764205),n=e.i(266027);let o=(0,e.i(243652).createQueryKeys)("healthReadiness"),a=async()=>{let e=(0,r.getProxyBaseUrl)(),t=await fetch(`${e}/health/readiness`);if(!t.ok)throw Error(`Failed to fetch health readiness: ${t.statusText}`);return t.json()},i=()=>(0,n.useQuery)({queryKey:o.detail("readiness"),queryFn:a,staleTime:3e5});e.s(["useHealthReadiness",0,i],521323);var l=e.i(115571),s=e.i(271645);function c(e){let t=t=>{"disableBouncingIcon"===t.key&&e()},r=t=>{let{key:r}=t.detail;"disableBouncingIcon"===r&&e()};return window.addEventListener("storage",t),window.addEventListener(l.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l.LOCAL_STORAGE_EVENT,r)}}function u(){return"true"===(0,l.getLocalStorageItem)("disableBouncingIcon")}function d(){return(0,s.useSyncExternalStore)(c,u)}var f=e.i(275144),h=e.i(268004),g=e.i(321836),m=e.i(62478),p=e.i(44121),v=e.i(186515);e.i(247167);var y=e.i(931067),w=e.i(9583),x=e.i(464571),b=e.i(790848),j=e.i(262218),S=e.i(522016);function E(e){let t=t=>{"disableBlogPosts"===t.key&&e()},r=t=>{let{key:r}=t.detail;"disableBlogPosts"===r&&e()};return window.addEventListener("storage",t),window.addEventListener(l.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l.LOCAL_STORAGE_EVENT,r)}}function L(){return"true"===(0,l.getLocalStorageItem)("disableBlogPosts")}function _(){return(0,s.useSyncExternalStore)(E,L)}async function C(){let e=(0,r.getProxyBaseUrl)(),t=await fetch(`${e}/public/litellm_blog_posts`);if(!t.ok)throw Error(`Failed to fetch blog posts: ${t.statusText}`);return t.json()}var k=e.i(56456),T=e.i(326373),P=e.i(770914),O=e.i(898586);let{Text:I,Title:N,Paragraph:B}=O.Typography,R=()=>{let e,r=_(),{data:o,isLoading:a,isError:i,refetch:l}=(0,n.useQuery)({queryKey:["blogPosts"],queryFn:C,staleTime:36e5,retry:1,retryDelay:0});return r?null:(e=a?[{key:"loading",label:(0,t.jsx)(k.LoadingOutlined,{}),disabled:!0}]:i?[{key:"error",label:(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(I,{type:"danger",children:"Failed to load posts"}),(0,t.jsx)(x.Button,{size:"small",onClick:()=>l(),children:"Retry"})]}),disabled:!0}]:o&&0!==o.posts.length?[...o.posts.slice(0,5).map(e=>({key:e.url,label:(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",width:380},children:[(0,t.jsx)(N,{level:5,style:{marginBottom:2},children:e.title}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:11},children:new Date(e.date+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),(0,t.jsx)(B,{ellipsis:{rows:2},children:e.description})]})})),{type:"divider"},{key:"view-all",label:(0,t.jsx)("a",{href:"https://docs.litellm.ai/blog",target:"_blank",rel:"noopener noreferrer",children:"View all posts"})}]:[{key:"empty",label:(0,t.jsx)(I,{type:"secondary",children:"No posts available"}),disabled:!0}],(0,t.jsx)(T.Dropdown,{menu:{items:e},trigger:["hover"],placement:"bottomRight",children:(0,t.jsx)(x.Button,{type:"text",children:"Blog"})}))};function U(e){let t=t=>{"disableShowPrompts"===t.key&&e()},r=t=>{let{key:r}=t.detail;"disableShowPrompts"===r&&e()};return window.addEventListener("storage",t),window.addEventListener(l.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l.LOCAL_STORAGE_EVENT,r)}}function z(){return"true"===(0,l.getLocalStorageItem)("disableShowPrompts")}function A(){return(0,s.useSyncExternalStore)(U,z)}e.s(["useDisableShowPrompts",()=>A],636772);let M={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"};var D=s.forwardRef(function(e,t){return s.createElement(w.default,(0,y.default)({},e,{ref:t,icon:M}))});let $={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M409.4 128c-42.4 0-76.7 34.4-76.7 76.8 0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5h76.7v-76.8c0-42.3-34.3-76.7-76.7-76.8zm0 204.8H204.7c-42.4 0-76.7 34.4-76.7 76.8s34.4 76.8 76.7 76.8h204.6c42.4 0 76.7-34.4 76.7-76.8.1-42.4-34.3-76.8-76.6-76.8zM614 486.4c42.4 0 76.8-34.4 76.7-76.8V204.8c0-42.4-34.3-76.8-76.7-76.8-42.4 0-76.7 34.4-76.7 76.8v204.8c0 42.5 34.3 76.8 76.7 76.8zm281.4-76.8c0-42.4-34.4-76.8-76.7-76.8S742 367.2 742 409.6v76.8h76.7c42.3 0 76.7-34.4 76.7-76.8zm-76.8 128H614c-42.4 0-76.7 34.4-76.7 76.8 0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5h204.6c42.4 0 76.7-34.4 76.7-76.8.1-42.4-34.3-76.7-76.7-76.8zM614 742.4h-76.7v76.8c0 42.4 34.4 76.8 76.7 76.8 42.4 0 76.8-34.4 76.7-76.8.1-42.4-34.3-76.7-76.7-76.8zM409.4 537.6c-42.4 0-76.7 34.4-76.7 76.8v204.8c0 42.4 34.4 76.8 76.7 76.8 42.4 0 76.8-34.4 76.7-76.8V614.4c0-20.3-8.1-39.9-22.4-54.3a76.92 76.92 0 00-54.3-22.5zM128 614.4c0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5c42.4 0 76.8-34.4 76.7-76.8v-76.8h-76.7c-42.3 0-76.7 34.4-76.7 76.8z"}}]},name:"slack",theme:"outlined"};var F=s.forwardRef(function(e,t){return s.createElement(w.default,(0,y.default)({},e,{ref:t,icon:$}))});let H=()=>A()?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Button,{href:"https://www.litellm.ai/support",target:"_blank",rel:"noopener noreferrer",icon:(0,t.jsx)(F,{}),className:"shadow-md shadow-indigo-500/20 hover:shadow-indigo-500/50 transition-shadow",children:"Join Slack"}),(0,t.jsx)(x.Button,{href:"https://github.com/BerriAI/litellm",target:"_blank",rel:"noopener noreferrer",className:"shadow-md shadow-indigo-500/20 hover:shadow-indigo-500/50 transition-shadow",icon:(0,t.jsx)(D,{}),children:"Star us on GitHub"})]});var V=e.i(135214),G=e.i(371401),K=e.i(100486),W=e.i(755151);let q={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"};var Q=s.forwardRef(function(e,t){return s.createElement(w.default,(0,y.default)({},e,{ref:t,icon:q}))}),X=e.i(948401),J=e.i(602073),Z=e.i(771674),Y=e.i(312361),ee=e.i(592968);let{Text:et}=O.Typography,er=({onLogout:e})=>{let{userId:r,userEmail:n,userRole:o,premiumUser:a}=(0,V.default)(),i=A(),c=(0,G.useDisableUsageIndicator)(),u=_(),f=d(),[h,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{g("true"===(0,l.getLocalStorageItem)("disableShowNewBadge"))},[]);let m=[{key:"logout",label:(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(Q,{}),"Logout"]}),onClick:e}];return(0,t.jsx)(T.Dropdown,{menu:{items:m},popupRender:e=>(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-lg",children:[(0,t.jsxs)(P.Space,{direction:"vertical",size:"small",style:{width:"100%",padding:"12px"},children:[(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(X.MailOutlined,{}),(0,t.jsx)(et,{type:"secondary",children:n||"-"})]}),a?(0,t.jsx)(j.Tag,{icon:(0,t.jsx)(K.CrownOutlined,{}),color:"gold",children:"Premium"}):(0,t.jsx)(ee.Tooltip,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,t.jsx)(j.Tag,{icon:(0,t.jsx)(K.CrownOutlined,{}),children:"Standard"})})]}),(0,t.jsx)(Y.Divider,{style:{margin:"8px 0"}}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(Z.UserOutlined,{}),(0,t.jsx)(et,{type:"secondary",children:"User ID"})]}),(0,t.jsx)(et,{copyable:!0,ellipsis:!0,style:{maxWidth:"150px"},title:r||"-",children:r||"-"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(J.SafetyOutlined,{}),(0,t.jsx)(et,{type:"secondary",children:"Role"})]}),(0,t.jsx)(et,{children:o})]}),(0,t.jsx)(Y.Divider,{style:{margin:"8px 0"}}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide New Feature Indicators"}),(0,t.jsx)(b.Switch,{size:"small",checked:h,onChange:e=>{g(e),e?(0,l.setLocalStorageItem)("disableShowNewBadge","true"):(0,l.removeLocalStorageItem)("disableShowNewBadge"),(0,l.emitLocalStorageChange)("disableShowNewBadge")},"aria-label":"Toggle hide new feature indicators"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide All Prompts"}),(0,t.jsx)(b.Switch,{size:"small",checked:i,onChange:e=>{e?(0,l.setLocalStorageItem)("disableShowPrompts","true"):(0,l.removeLocalStorageItem)("disableShowPrompts"),(0,l.emitLocalStorageChange)("disableShowPrompts")},"aria-label":"Toggle hide all prompts"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide Usage Indicator"}),(0,t.jsx)(b.Switch,{size:"small",checked:c,onChange:e=>{e?(0,l.setLocalStorageItem)("disableUsageIndicator","true"):(0,l.removeLocalStorageItem)("disableUsageIndicator"),(0,l.emitLocalStorageChange)("disableUsageIndicator")},"aria-label":"Toggle hide usage indicator"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide Blog Posts"}),(0,t.jsx)(b.Switch,{size:"small",checked:u,onChange:e=>{e?(0,l.setLocalStorageItem)("disableBlogPosts","true"):(0,l.removeLocalStorageItem)("disableBlogPosts"),(0,l.emitLocalStorageChange)("disableBlogPosts")},"aria-label":"Toggle hide blog posts"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide Bouncing Icon"}),(0,t.jsx)(b.Switch,{size:"small",checked:f,onChange:e=>{e?(0,l.setLocalStorageItem)("disableBouncingIcon","true"):(0,l.removeLocalStorageItem)("disableBouncingIcon"),(0,l.emitLocalStorageChange)("disableBouncingIcon")},"aria-label":"Toggle hide bouncing icon"})]})]}),(0,t.jsx)(Y.Divider,{style:{margin:0}}),s.default.cloneElement(e,{style:{boxShadow:"none"}})]}),children:(0,t.jsx)(x.Button,{type:"text",children:(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(Z.UserOutlined,{}),(0,t.jsx)(et,{children:"User"}),(0,t.jsx)(W.DownOutlined,{})]})})})};var en=e.i(199133),eo=e.i(295320),ea=e.i(283713);let ei=({onWorkerSwitch:e})=>{let{isControlPlane:r,selectedWorker:n,workers:o}=(0,ea.useWorker)();return r&&n?(0,t.jsx)(en.Select,{showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),value:n.worker_id,style:{minWidth:180},suffixIcon:(0,t.jsx)(eo.CloudServerOutlined,{}),options:o.map(e=>({label:e.name,value:e.worker_id,disabled:e.worker_id===n.worker_id})),onChange:t=>{e(t)}}):null};e.s(["default",0,({userID:e,userEmail:n,userRole:o,premiumUser:a,proxySettings:l,setProxySettings:c,accessToken:u,isPublicPage:y=!1,sidebarCollapsed:w=!1,onToggleSidebar:b,isDarkMode:E,toggleDarkMode:L})=>{let _=(0,r.getProxyBaseUrl)(),[C,k]=(0,s.useState)(""),{logoUrl:T}=(0,f.useTheme)(),{data:P}=i(),O=P?.litellm_version,I=d(),N=T||`${_}/get_image`;return(0,s.useEffect)(()=>{(async()=>{if(u){let e=await (0,m.fetchProxySettings)(u);console.log("response from fetchProxySettings",e),e&&c(e)}})()},[u]),(0,s.useEffect)(()=>{k(l?.PROXY_LOGOUT_URL||"")},[l]),(0,t.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"flex items-center h-14 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[b&&(0,t.jsx)("button",{onClick:b,className:"flex items-center justify-center w-10 h-10 mr-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors",title:w?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("span",{className:"text-lg",children:w?(0,t.jsx)(v.MenuUnfoldOutlined,{}):(0,t.jsx)(p.MenuFoldOutlined,{})})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(S.default,{href:_||"/",className:"flex items-center",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"h-10 max-w-48 flex items-center justify-center overflow-hidden",children:(0,t.jsx)("img",{src:N,alt:"LiteLLM Brand",className:"max-w-full max-h-full w-auto h-auto object-contain"})})})}),O&&(0,t.jsxs)("div",{className:"relative",children:[!I&&(0,t.jsx)("span",{className:"absolute -top-1 -left-2 text-lg animate-bounce",style:{animationDuration:"2s"},title:"Thanks for using LiteLLM!",children:"🌑"}),(0,t.jsx)(j.Tag,{className:"relative text-xs font-medium cursor-pointer z-10",children:(0,t.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0",children:["v",O]})})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,t.jsx)(ei,{onWorkerSwitch:e=>{(0,h.clearTokenCookies)(),(0,g.clearStoredReturnUrl)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=`/ui/login?worker=${encodeURIComponent(e)}`}}),(0,t.jsx)(H,{}),!1,(0,t.jsx)(x.Button,{type:"text",href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,t.jsx)(R,{}),!y&&(0,t.jsx)(er,{onLogout:()=>{(0,h.clearTokenCookies)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=C}})]})]})})})}],402874)}]);
\ No newline at end of file
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,326373,e=>{"use strict";var t=e.i(21539);e.s(["Dropdown",()=>t.default])},100486,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={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"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CrownOutlined",0,a],100486)},295320,283713,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M704 446H320c-4.4 0-8 3.6-8 8v402c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8V454c0-4.4-3.6-8-8-8zm-328 64h272v117H376V510zm272 290H376V683h272v117z"}},{tag:"path",attrs:{d:"M424 748a32 32 0 1064 0 32 32 0 10-64 0zm0-178a32 32 0 1064 0 32 32 0 10-64 0z"}},{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}}]},name:"cloud-server",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["CloudServerOutlined",0,a],295320);var i=e.i(764205),l=e.i(612256);let s="litellm_selected_worker_id";e.s(["useWorker",0,()=>{let{data:e}=(0,l.useUIConfig)(),t=e?.is_control_plane??!1,n=e?.workers??[],[o,a]=(0,r.useState)(()=>localStorage.getItem(s));(0,r.useEffect)(()=>{if(!o||0===n.length)return;let e=n.find(e=>e.worker_id===o);e&&(0,i.switchToWorkerUrl)(e.url)},[o,n]);let c=n.find(e=>e.worker_id===o)??null,u=(0,r.useCallback)(e=>{let t=n.find(t=>t.worker_id===e);t&&(a(e),localStorage.setItem(s,e),(0,i.switchToWorkerUrl)(t.url))},[n]);return{isControlPlane:t,workers:n,selectedWorkerId:o,selectedWorker:c,selectWorker:u,disconnectFromWorker:(0,r.useCallback)(()=>{a(null),localStorage.removeItem(s),(0,i.switchToWorkerUrl)(null)},[])}}],283713)},44121,186515,e=>{"use strict";e.i(247167);var t=e.i(931067),r=e.i(271645);let n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"};var o=e.i(9583),a=r.forwardRef(function(e,a){return r.createElement(o.default,(0,t.default)({},e,{ref:a,icon:n}))});e.s(["MenuFoldOutlined",0,a],44121);let i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"};var l=r.forwardRef(function(e,n){return r.createElement(o.default,(0,t.default)({},e,{ref:n,icon:i}))});e.s(["MenuUnfoldOutlined",0,l],186515)},371401,e=>{"use strict";var t=e.i(115571),r=e.i(271645);function n(e){let r=t=>{"disableUsageIndicator"===t.key&&e()},n=t=>{let{key:r}=t.detail;"disableUsageIndicator"===r&&e()};return window.addEventListener("storage",r),window.addEventListener(t.LOCAL_STORAGE_EVENT,n),()=>{window.removeEventListener("storage",r),window.removeEventListener(t.LOCAL_STORAGE_EVENT,n)}}function o(){return"true"===(0,t.getLocalStorageItem)("disableUsageIndicator")}function a(){return(0,r.useSyncExternalStore)(n,o)}e.s(["useDisableUsageIndicator",()=>a])},275144,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(764205);let o=(0,r.createContext)(void 0);e.s(["ThemeProvider",0,({children:e,accessToken:a})=>{let[i,l]=(0,r.useState)(null),[s,c]=(0,r.useState)(null);return(0,r.useEffect)(()=>{(async()=>{try{let e=(0,n.getProxyBaseUrl)(),t=e?`${e}/get/ui_theme_settings`:"/get/ui_theme_settings",r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(r.ok){let e=await r.json();e.values?.logo_url&&l(e.values.logo_url),e.values?.favicon_url&&c(e.values.favicon_url)}}catch(e){console.warn("Failed to load theme settings from backend:",e)}})()},[]),(0,r.useEffect)(()=>{if(s){let e=document.querySelectorAll("link[rel*='icon']");if(e.length>0)e.forEach(e=>{e.href=s});else{let e=document.createElement("link");e.rel="icon",e.href=s,document.head.appendChild(e)}}},[s]),(0,t.jsx)(o.Provider,{value:{logoUrl:i,setLogoUrl:l,faviconUrl:s,setFaviconUrl:c},children:e})},"useTheme",0,()=>{let e=(0,r.useContext)(o);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e}])},998183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return s},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,i(e));else t.set(r,i(n));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},195057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return s}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(151836)._(e.r(998183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",l=e.hash||"",s=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),s&&"object"==typeof s&&(s=String(a.urlQueryToSearchParams(s)));let u=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),u&&"?"!==u[0]&&(u="?"+u),o=o.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${o}${u}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},718967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return x},NormalizeError:function(){return y},PageNotFoundError:function(){return w},SP:function(){return m},ST:function(){return p},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return j}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>l.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function g(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await g(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,p=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class w extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x 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 j(e){return JSON.stringify({message:e.message,stack:e.stack})}},573668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(718967),o=e.r(652817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},284508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},522016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return w}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(151836),i=e.r(843476),l=a._(e.r(271645)),s=e.r(195057),c=e.r(8372),u=e.r(818581),d=e.r(718967),f=e.r(405550);e.r(233525);let h=e.r(91949),g=e.r(573668),m=e.r(509396);function p(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function v(t){var r;let n,o,a,[s,v]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,l.useRef)(null),{href:x,as:b,children:j,prefetch:S=null,passHref:E,replace:L,shallow:_,scroll:C,onClick:k,onMouseEnter:T,onTouchStart:P,legacyBehavior:O=!1,onNavigate:I,ref:N,unstable_dynamicOnHover:B,...R}=t;n=j,O&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let U=l.default.useContext(c.AppRouterContext),z=!1!==S,A=!1!==S?null===(r=S)||"auto"===r?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,{href:M,as:D}=l.default.useMemo(()=>{let e=p(x);return{href:e,as:b?p(b):e}},[x,b]);if(O){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=l.default.Children.only(n)}let $=O?o&&"object"==typeof o&&o.ref:N,F=l.default.useCallback(e=>(null!==U&&(w.current=(0,h.mountLinkInstance)(e,M,U,A,z,v)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[z,M,U,A,v]),H={ref:(0,u.useMergedRef)(F,$),onClick(t){O||"function"!=typeof k||k(t),O&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,a,i,s){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(699781);l.default.startTransition(()=>{d(n||r,a?"replace":"push",i??!0,o.current)})}}(t,M,D,w,L,C,I)},onMouseEnter(e){O||"function"!=typeof T||T(e),O&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&z&&(0,h.onNavigationIntent)(e.currentTarget,!0===B)},onTouchStart:function(e){O||"function"!=typeof P||P(e),O&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&z&&(0,h.onNavigationIntent)(e.currentTarget,!0===B)}};return(0,d.isAbsoluteUrl)(D)?H.href=D:O&&!E&&("a"!==o.type||"href"in o.props)||(H.href=(0,f.addBasePath)(D)),a=O?l.default.cloneElement(o,H):(0,i.jsx)("a",{...R,...H,children:n}),(0,i.jsx)(y.Provider,{value:s,children:a})}e.r(284508);let y=(0,l.createContext)(h.IDLE_LINK_STATUS),w=()=>(0,l.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},402874,521323,636772,e=>{"use strict";var t=e.i(843476),r=e.i(764205),n=e.i(266027);let o=(0,e.i(243652).createQueryKeys)("healthReadiness"),a=async()=>{let e=(0,r.getProxyBaseUrl)(),t=await fetch(`${e}/health/readiness`);if(!t.ok)throw Error(`Failed to fetch health readiness: ${t.statusText}`);return t.json()},i=()=>(0,n.useQuery)({queryKey:o.detail("readiness"),queryFn:a,staleTime:3e5});e.s(["useHealthReadiness",0,i],521323);var l=e.i(115571),s=e.i(271645);function c(e){let t=t=>{"disableBouncingIcon"===t.key&&e()},r=t=>{let{key:r}=t.detail;"disableBouncingIcon"===r&&e()};return window.addEventListener("storage",t),window.addEventListener(l.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l.LOCAL_STORAGE_EVENT,r)}}function u(){return"true"===(0,l.getLocalStorageItem)("disableBouncingIcon")}function d(){return(0,s.useSyncExternalStore)(c,u)}var f=e.i(275144),h=e.i(268004),g=e.i(321836),m=e.i(62478),p=e.i(44121),v=e.i(186515);e.i(247167);var y=e.i(931067),w=e.i(9583),x=e.i(464571),b=e.i(790848),j=e.i(262218),S=e.i(522016);function E(e){let t=t=>{"disableBlogPosts"===t.key&&e()},r=t=>{let{key:r}=t.detail;"disableBlogPosts"===r&&e()};return window.addEventListener("storage",t),window.addEventListener(l.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l.LOCAL_STORAGE_EVENT,r)}}function L(){return"true"===(0,l.getLocalStorageItem)("disableBlogPosts")}function _(){return(0,s.useSyncExternalStore)(E,L)}async function C(){let e=(0,r.getProxyBaseUrl)(),t=await fetch(`${e}/public/litellm_blog_posts`);if(!t.ok)throw Error(`Failed to fetch blog posts: ${t.statusText}`);return t.json()}var k=e.i(56456),T=e.i(326373),P=e.i(770914),O=e.i(898586);let{Text:I,Title:N,Paragraph:B}=O.Typography,R=()=>{let e,r=_(),{data:o,isLoading:a,isError:i,refetch:l}=(0,n.useQuery)({queryKey:["blogPosts"],queryFn:C,staleTime:36e5,retry:1,retryDelay:0});return r?null:(e=a?[{key:"loading",label:(0,t.jsx)(k.LoadingOutlined,{}),disabled:!0}]:i?[{key:"error",label:(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(I,{type:"danger",children:"Failed to load posts"}),(0,t.jsx)(x.Button,{size:"small",onClick:()=>l(),children:"Retry"})]}),disabled:!0}]:o&&0!==o.posts.length?[...o.posts.slice(0,5).map(e=>({key:e.url,label:(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",width:380},children:[(0,t.jsx)(N,{level:5,style:{marginBottom:2},children:e.title}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:11},children:new Date(e.date+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),(0,t.jsx)(B,{ellipsis:{rows:2},children:e.description})]})})),{type:"divider"},{key:"view-all",label:(0,t.jsx)("a",{href:"https://docs.litellm.ai/blog",target:"_blank",rel:"noopener noreferrer",children:"View all posts"})}]:[{key:"empty",label:(0,t.jsx)(I,{type:"secondary",children:"No posts available"}),disabled:!0}],(0,t.jsx)(T.Dropdown,{menu:{items:e},trigger:["hover"],placement:"bottomRight",children:(0,t.jsx)(x.Button,{type:"text",children:"Blog"})}))};function U(e){let t=t=>{"disableShowPrompts"===t.key&&e()},r=t=>{let{key:r}=t.detail;"disableShowPrompts"===r&&e()};return window.addEventListener("storage",t),window.addEventListener(l.LOCAL_STORAGE_EVENT,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l.LOCAL_STORAGE_EVENT,r)}}function z(){return"true"===(0,l.getLocalStorageItem)("disableShowPrompts")}function A(){return(0,s.useSyncExternalStore)(U,z)}e.s(["useDisableShowPrompts",()=>A],636772);let M={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"};var D=s.forwardRef(function(e,t){return s.createElement(w.default,(0,y.default)({},e,{ref:t,icon:M}))});let $={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M409.4 128c-42.4 0-76.7 34.4-76.7 76.8 0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5h76.7v-76.8c0-42.3-34.3-76.7-76.7-76.8zm0 204.8H204.7c-42.4 0-76.7 34.4-76.7 76.8s34.4 76.8 76.7 76.8h204.6c42.4 0 76.7-34.4 76.7-76.8.1-42.4-34.3-76.8-76.6-76.8zM614 486.4c42.4 0 76.8-34.4 76.7-76.8V204.8c0-42.4-34.3-76.8-76.7-76.8-42.4 0-76.7 34.4-76.7 76.8v204.8c0 42.5 34.3 76.8 76.7 76.8zm281.4-76.8c0-42.4-34.4-76.8-76.7-76.8S742 367.2 742 409.6v76.8h76.7c42.3 0 76.7-34.4 76.7-76.8zm-76.8 128H614c-42.4 0-76.7 34.4-76.7 76.8 0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5h204.6c42.4 0 76.7-34.4 76.7-76.8.1-42.4-34.3-76.7-76.7-76.8zM614 742.4h-76.7v76.8c0 42.4 34.4 76.8 76.7 76.8 42.4 0 76.8-34.4 76.7-76.8.1-42.4-34.3-76.7-76.7-76.8zM409.4 537.6c-42.4 0-76.7 34.4-76.7 76.8v204.8c0 42.4 34.4 76.8 76.7 76.8 42.4 0 76.8-34.4 76.7-76.8V614.4c0-20.3-8.1-39.9-22.4-54.3a76.92 76.92 0 00-54.3-22.5zM128 614.4c0 20.3 8.1 39.9 22.4 54.3a76.74 76.74 0 0054.3 22.5c42.4 0 76.8-34.4 76.7-76.8v-76.8h-76.7c-42.3 0-76.7 34.4-76.7 76.8z"}}]},name:"slack",theme:"outlined"};var F=s.forwardRef(function(e,t){return s.createElement(w.default,(0,y.default)({},e,{ref:t,icon:$}))});let H=()=>A()?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Button,{href:"https://www.litellm.ai/support",target:"_blank",rel:"noopener noreferrer",icon:(0,t.jsx)(F,{}),className:"shadow-md shadow-indigo-500/20 hover:shadow-indigo-500/50 transition-shadow",children:"Join Slack"}),(0,t.jsx)(x.Button,{href:"https://github.com/BerriAI/litellm",target:"_blank",rel:"noopener noreferrer",className:"shadow-md shadow-indigo-500/20 hover:shadow-indigo-500/50 transition-shadow",icon:(0,t.jsx)(D,{}),children:"Star us on GitHub"})]});var V=e.i(135214),G=e.i(371401),K=e.i(100486),W=e.i(755151);let q={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"};var Q=s.forwardRef(function(e,t){return s.createElement(w.default,(0,y.default)({},e,{ref:t,icon:q}))}),X=e.i(948401),J=e.i(602073),Z=e.i(771674),Y=e.i(312361),ee=e.i(592968);let{Text:et}=O.Typography,er=({onLogout:e})=>{let{userId:r,userEmail:n,userRole:o,premiumUser:a}=(0,V.default)(),i=A(),c=(0,G.useDisableUsageIndicator)(),u=_(),f=d(),[h,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{g("true"===(0,l.getLocalStorageItem)("disableShowNewBadge"))},[]);let m=[{key:"logout",label:(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(Q,{}),"Logout"]}),onClick:e}];return(0,t.jsx)(T.Dropdown,{menu:{items:m},popupRender:e=>(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-lg",children:[(0,t.jsxs)(P.Space,{direction:"vertical",size:"small",style:{width:"100%",padding:"12px"},children:[(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(X.MailOutlined,{}),(0,t.jsx)(et,{type:"secondary",children:n||"-"})]}),a?(0,t.jsx)(j.Tag,{icon:(0,t.jsx)(K.CrownOutlined,{}),color:"gold",children:"Premium"}):(0,t.jsx)(ee.Tooltip,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,t.jsx)(j.Tag,{icon:(0,t.jsx)(K.CrownOutlined,{}),children:"Standard"})})]}),(0,t.jsx)(Y.Divider,{style:{margin:"8px 0"}}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(Z.UserOutlined,{}),(0,t.jsx)(et,{type:"secondary",children:"User ID"})]}),(0,t.jsx)(et,{copyable:!0,ellipsis:!0,style:{maxWidth:"150px"},title:r||"-",children:r||"-"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(J.SafetyOutlined,{}),(0,t.jsx)(et,{type:"secondary",children:"Role"})]}),(0,t.jsx)(et,{children:o})]}),(0,t.jsx)(Y.Divider,{style:{margin:"8px 0"}}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide New Feature Indicators"}),(0,t.jsx)(b.Switch,{size:"small",checked:h,onChange:e=>{g(e),e?(0,l.setLocalStorageItem)("disableShowNewBadge","true"):(0,l.removeLocalStorageItem)("disableShowNewBadge"),(0,l.emitLocalStorageChange)("disableShowNewBadge")},"aria-label":"Toggle hide new feature indicators"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide All Prompts"}),(0,t.jsx)(b.Switch,{size:"small",checked:i,onChange:e=>{e?(0,l.setLocalStorageItem)("disableShowPrompts","true"):(0,l.removeLocalStorageItem)("disableShowPrompts"),(0,l.emitLocalStorageChange)("disableShowPrompts")},"aria-label":"Toggle hide all prompts"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide Usage Indicator"}),(0,t.jsx)(b.Switch,{size:"small",checked:c,onChange:e=>{e?(0,l.setLocalStorageItem)("disableUsageIndicator","true"):(0,l.removeLocalStorageItem)("disableUsageIndicator"),(0,l.emitLocalStorageChange)("disableUsageIndicator")},"aria-label":"Toggle hide usage indicator"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide Blog Posts"}),(0,t.jsx)(b.Switch,{size:"small",checked:u,onChange:e=>{e?(0,l.setLocalStorageItem)("disableBlogPosts","true"):(0,l.removeLocalStorageItem)("disableBlogPosts"),(0,l.emitLocalStorageChange)("disableBlogPosts")},"aria-label":"Toggle hide blog posts"})]}),(0,t.jsxs)(P.Space,{style:{width:"100%",justifyContent:"space-between"},children:[(0,t.jsx)(et,{type:"secondary",children:"Hide Bouncing Icon"}),(0,t.jsx)(b.Switch,{size:"small",checked:f,onChange:e=>{e?(0,l.setLocalStorageItem)("disableBouncingIcon","true"):(0,l.removeLocalStorageItem)("disableBouncingIcon"),(0,l.emitLocalStorageChange)("disableBouncingIcon")},"aria-label":"Toggle hide bouncing icon"})]})]}),(0,t.jsx)(Y.Divider,{style:{margin:0}}),s.default.cloneElement(e,{style:{boxShadow:"none"}})]}),children:(0,t.jsx)(x.Button,{type:"text",children:(0,t.jsxs)(P.Space,{children:[(0,t.jsx)(Z.UserOutlined,{}),(0,t.jsx)(et,{children:"User"}),(0,t.jsx)(W.DownOutlined,{})]})})})};var en=e.i(199133),eo=e.i(295320),ea=e.i(283713);let ei=({onWorkerSwitch:e})=>{let{isControlPlane:r,selectedWorker:n,workers:o}=(0,ea.useWorker)();return r&&n?(0,t.jsx)(en.Select,{showSearch:!0,filterOption:(e,t)=>(t?.label??"").toLowerCase().includes(e.toLowerCase()),value:n.worker_id,style:{minWidth:180},suffixIcon:(0,t.jsx)(eo.CloudServerOutlined,{}),options:o.map(e=>({label:e.name,value:e.worker_id,disabled:e.worker_id===n.worker_id})),onChange:t=>{e(t)}}):null};e.s(["default",0,({userID:e,userEmail:n,userRole:o,premiumUser:a,proxySettings:l,setProxySettings:c,accessToken:u,isPublicPage:y=!1,sidebarCollapsed:w=!1,onToggleSidebar:b,isDarkMode:E,toggleDarkMode:L})=>{let _=(0,r.getProxyBaseUrl)(),[C,k]=(0,s.useState)(""),{logoUrl:T}=(0,f.useTheme)(),{data:P}=i(),O=P?.litellm_version,I=d(),N=T||`${_}/get_image`;return(0,s.useEffect)(()=>{(async()=>{if(u){let e=await (0,m.fetchProxySettings)(u);console.log("response from fetchProxySettings",e),e&&c(e)}})()},[u]),(0,s.useEffect)(()=>{k(l?.PROXY_LOGOUT_URL||"")},[l]),(0,t.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"flex items-center h-14 px-4",children:[(0,t.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[b&&(0,t.jsx)("button",{onClick:b,className:"flex items-center justify-center w-10 h-10 mr-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors",title:w?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("span",{className:"text-lg",children:w?(0,t.jsx)(v.MenuUnfoldOutlined,{}):(0,t.jsx)(p.MenuFoldOutlined,{})})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(S.default,{href:_||"/",className:"flex items-center",children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:"h-10 max-w-48 flex items-center justify-center overflow-hidden",children:(0,t.jsx)("img",{src:N,alt:"LiteLLM Brand",className:"max-w-full max-h-full w-auto h-auto object-contain"})})})}),O&&(0,t.jsxs)("div",{className:"relative",children:[!I&&(0,t.jsx)("span",{className:"absolute -top-1 -left-2 text-lg animate-bounce",style:{animationDuration:"2s"},title:"Thanks for using LiteLLM!",children:"🌑"}),(0,t.jsx)(j.Tag,{className:"relative text-xs font-medium cursor-pointer z-10",children:(0,t.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0",children:["v",O]})})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,t.jsx)(ei,{onWorkerSwitch:e=>{(0,h.clearTokenCookies)(),(0,g.clearStoredReturnUrl)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=`/ui/login?worker=${encodeURIComponent(e)}`}}),(0,t.jsx)(H,{}),!1,(0,t.jsx)(x.Button,{type:"text",href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",children:"Docs"}),(0,t.jsx)(R,{}),!y&&(0,t.jsx)(er,{onLogout:()=>{(0,h.clearTokenCookies)(),localStorage.removeItem("litellm_selected_worker_id"),localStorage.removeItem("litellm_worker_url"),window.location.href=C}})]})]})})})}],402874)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/37e7834517e667e4.js b/litellm/proxy/_experimental/out/_next/static/chunks/37e7834517e667e4.js
deleted file mode 100644
index 0d83a7b6c2..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/37e7834517e667e4.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,916925,e=>{"use strict";var r,a=((r={}).A2A_Agent="A2A Agent",r.AI21="Ai21",r.AI21_CHAT="Ai21 Chat",r.AIML="AI/ML API",r.AIOHTTP_OPENAI="Aiohttp Openai",r.Anthropic="Anthropic",r.ANTHROPIC_TEXT="Anthropic Text",r.AssemblyAI="AssemblyAI",r.AUTO_ROUTER="Auto Router",r.Bedrock="Amazon Bedrock",r.BedrockMantle="Amazon Bedrock Mantle",r.SageMaker="AWS SageMaker",r.Azure="Azure",r.Azure_AI_Studio="Azure AI Foundry (Studio)",r.AZURE_TEXT="Azure Text",r.BASETEN="Baseten",r.BYTEZ="Bytez",r.Cerebras="Cerebras",r.CLARIFAI="Clarifai",r.CLOUDFLARE="Cloudflare",r.CODESTRAL="Codestral",r.Cohere="Cohere",r.COHERE_CHAT="Cohere Chat",r.COMETAPI="Cometapi",r.COMPACTIFAI="Compactifai",r.Cursor="Cursor",r.Dashscope="Dashscope",r.Databricks="Databricks (Qwen API)",r.DATAROBOT="Datarobot",r.DeepInfra="DeepInfra",r.Deepgram="Deepgram",r.Deepseek="Deepseek",r.DOCKER_MODEL_RUNNER="Docker Model Runner",r.DOTPROMPT="Dotprompt",r.ElevenLabs="ElevenLabs",r.EMPOWER="Empower",r.FalAI="Fal AI",r.FEATHERLESS_AI="Featherless Ai",r.FireworksAI="Fireworks AI",r.FRIENDLIAI="Friendliai",r.GALADRIEL="Galadriel",r.GITHUB_COPILOT="Github Copilot",r.Google_AI_Studio="Google AI Studio",r.GradientAI="GradientAI",r.Groq="Groq",r.HEROKU="Heroku",r.Hosted_Vllm="vllm",r.HUGGINGFACE="Huggingface",r.HYPERBOLIC="Hyperbolic",r.Infinity="Infinity",r.JinaAI="Jina AI",r.LAMBDA_AI="Lambda Ai",r.LEMONADE="Lemonade",r.LLAMAFILE="Llamafile",r.LM_STUDIO="Lm Studio",r.LLAMA="Meta Llama",r.MARITALK="Maritalk",r.MiniMax="MiniMax",r.MistralAI="Mistral AI",r.MOONSHOT="Moonshot",r.MORPH="Morph",r.NEBIUS="Nebius",r.NLP_CLOUD="Nlp Cloud",r.NOVITA="Novita",r.NSCALE="Nscale",r.NVIDIA_NIM="Nvidia Nim",r.Ollama="Ollama",r.OLLAMA_CHAT="Ollama Chat",r.OOBABOOGA="Oobabooga",r.OpenAI="OpenAI",r.OPENAI_LIKE="Openai Like",r.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",r.OpenAI_Text="OpenAI Text Completion",r.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",r.Openrouter="Openrouter",r.Oracle="Oracle Cloud Infrastructure (OCI)",r.OVHCLOUD="Ovhcloud",r.Perplexity="Perplexity",r.PETALS="Petals",r.PG_VECTOR="Pg Vector",r.PREDIBASE="Predibase",r.RECRAFT="Recraft",r.REPLICATE="Replicate",r.RunwayML="RunwayML",r.SAGEMAKER_LEGACY="Sagemaker",r.Sambanova="Sambanova",r.SAP="SAP Generative AI Hub",r.Snowflake="Snowflake",r.TEXT_COMPLETION_CODESTRAL="Text-Completion-Codestral",r.TogetherAI="TogetherAI",r.TOPAZ="Topaz",r.Triton="Triton",r.V0="V0",r.VERCEL_AI_GATEWAY="Vercel Ai Gateway",r.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",r.VERTEX_AI_BETA="Vertex Ai Beta",r.VLLM="Vllm",r.VolcEngine="VolcEngine",r.Voyage="Voyage AI",r.WANDB="Wandb",r.WATSONX="Watsonx",r.WATSONX_TEXT="Watsonx Text",r.xAI="xAI",r.XINFERENCE="Xinference",r);let t={A2A_Agent:"a2a_agent",AI21:"ai21",AI21_CHAT:"ai21_chat",AIML:"aiml",AIOHTTP_OPENAI:"aiohttp_openai",Anthropic:"anthropic",ANTHROPIC_TEXT:"anthropic_text",AssemblyAI:"assemblyai",AUTO_ROUTER:"auto_router",Azure:"azure",Azure_AI_Studio:"azure_ai",AZURE_TEXT:"azure_text",BASETEN:"baseten",Bedrock:"bedrock",BedrockMantle:"bedrock_mantle",BYTEZ:"bytez",Cerebras:"cerebras",CLARIFAI:"clarifai",CLOUDFLARE:"cloudflare",CODESTRAL:"codestral",Cohere:"cohere",COHERE_CHAT:"cohere_chat",COMETAPI:"cometapi",COMPACTIFAI:"compactifai",Cursor:"cursor",Dashscope:"dashscope",Databricks:"databricks",DATAROBOT:"datarobot",DeepInfra:"deepinfra",Deepgram:"deepgram",Deepseek:"deepseek",DOCKER_MODEL_RUNNER:"docker_model_runner",DOTPROMPT:"dotprompt",ElevenLabs:"elevenlabs",EMPOWER:"empower",FalAI:"fal_ai",FEATHERLESS_AI:"featherless_ai",FireworksAI:"fireworks_ai",FRIENDLIAI:"friendliai",GALADRIEL:"galadriel",GITHUB_COPILOT:"github_copilot",Google_AI_Studio:"gemini",GradientAI:"gradient_ai",Groq:"groq",HEROKU:"heroku",Hosted_Vllm:"hosted_vllm",HUGGINGFACE:"huggingface",HYPERBOLIC:"hyperbolic",Infinity:"infinity",JinaAI:"jina_ai",LAMBDA_AI:"lambda_ai",LEMONADE:"lemonade",LLAMAFILE:"llamafile",LLAMA:"meta_llama",LM_STUDIO:"lm_studio",MARITALK:"maritalk",MiniMax:"minimax",MistralAI:"mistral",MOONSHOT:"moonshot",MORPH:"morph",NEBIUS:"nebius",NLP_CLOUD:"nlp_cloud",NOVITA:"novita",NSCALE:"nscale",NVIDIA_NIM:"nvidia_nim",Ollama:"ollama",OLLAMA_CHAT:"ollama_chat",OOBABOOGA:"oobabooga",OpenAI:"openai",OPENAI_LIKE:"openai_like",OpenAI_Compatible:"openai",OpenAI_Text:"text-completion-openai",OpenAI_Text_Compatible:"text-completion-openai",Openrouter:"openrouter",Oracle:"oci",OVHCLOUD:"ovhcloud",Perplexity:"perplexity",PETALS:"petals",PG_VECTOR:"pg_vector",PREDIBASE:"predibase",RECRAFT:"recraft",REPLICATE:"replicate",RunwayML:"runwayml",SAGEMAKER_LEGACY:"sagemaker",SageMaker:"sagemaker_chat",Sambanova:"sambanova",SAP:"sap",Snowflake:"snowflake",TEXT_COMPLETION_CODESTRAL:"text-completion-codestral",TogetherAI:"together_ai",TOPAZ:"topaz",Triton:"triton",V0:"v0",VERCEL_AI_GATEWAY:"vercel_ai_gateway",Vertex_AI:"vertex_ai",VERTEX_AI_BETA:"vertex_ai_beta",VLLM:"vllm",VolcEngine:"volcengine",Voyage:"voyage",WANDB:"wandb",WATSONX:"watsonx",WATSONX_TEXT:"watsonx_text",xAI:"xai",XINFERENCE:"xinference"},o="../ui/assets/logos/",i={"A2A Agent":`${o}a2a_agent.png`,Ai21:`${o}ai21.svg`,"Ai21 Chat":`${o}ai21.svg`,"AI/ML API":`${o}aiml_api.svg`,"Aiohttp Openai":`${o}openai_small.svg`,Anthropic:`${o}anthropic.svg`,"Anthropic Text":`${o}anthropic.svg`,AssemblyAI:`${o}assemblyai_small.png`,Azure:`${o}microsoft_azure.svg`,"Azure AI Foundry (Studio)":`${o}microsoft_azure.svg`,"Azure Text":`${o}microsoft_azure.svg`,Baseten:`${o}baseten.svg`,"Amazon Bedrock":`${o}bedrock.svg`,"Amazon Bedrock Mantle":`${o}bedrock.svg`,"AWS SageMaker":`${o}bedrock.svg`,Cerebras:`${o}cerebras.svg`,Cloudflare:`${o}cloudflare.svg`,Codestral:`${o}mistral.svg`,Cohere:`${o}cohere.svg`,"Cohere Chat":`${o}cohere.svg`,Cometapi:`${o}cometapi.svg`,Cursor:`${o}cursor.svg`,"Databricks (Qwen API)":`${o}databricks.svg`,Dashscope:`${o}dashscope.svg`,Deepseek:`${o}deepseek.svg`,Deepgram:`${o}deepgram.png`,DeepInfra:`${o}deepinfra.png`,ElevenLabs:`${o}elevenlabs.png`,"Fal AI":`${o}fal_ai.jpg`,"Featherless Ai":`${o}featherless.svg`,"Fireworks AI":`${o}fireworks.svg`,Friendliai:`${o}friendli.svg`,"Github Copilot":`${o}github_copilot.svg`,"Google AI Studio":`${o}google.svg`,GradientAI:`${o}gradientai.svg`,Groq:`${o}groq.svg`,vllm:`${o}vllm.png`,Huggingface:`${o}huggingface.svg`,Hyperbolic:`${o}hyperbolic.svg`,Infinity:`${o}infinity.png`,"Jina AI":`${o}jina.png`,"Lambda Ai":`${o}lambda.svg`,"Lm Studio":`${o}lmstudio.svg`,"Meta Llama":`${o}meta_llama.svg`,MiniMax:`${o}minimax.svg`,"Mistral AI":`${o}mistral.svg`,Moonshot:`${o}moonshot.svg`,Morph:`${o}morph.svg`,Nebius:`${o}nebius.svg`,Novita:`${o}novita.svg`,"Nvidia Nim":`${o}nvidia_nim.svg`,Ollama:`${o}ollama.svg`,"Ollama Chat":`${o}ollama.svg`,Oobabooga:`${o}openai_small.svg`,OpenAI:`${o}openai_small.svg`,"Openai Like":`${o}openai_small.svg`,"OpenAI Text Completion":`${o}openai_small.svg`,"OpenAI-Compatible Text Completion Models (Together AI, etc.)":`${o}openai_small.svg`,"OpenAI-Compatible Endpoints (Together AI, etc.)":`${o}openai_small.svg`,Openrouter:`${o}openrouter.svg`,"Oracle Cloud Infrastructure (OCI)":`${o}oracle.svg`,Perplexity:`${o}perplexity-ai.svg`,Recraft:`${o}recraft.svg`,Replicate:`${o}replicate.svg`,RunwayML:`${o}runwayml.png`,Sagemaker:`${o}bedrock.svg`,Sambanova:`${o}sambanova.svg`,"SAP Generative AI Hub":`${o}sap.png`,Snowflake:`${o}snowflake.svg`,"Text-Completion-Codestral":`${o}mistral.svg`,TogetherAI:`${o}togetherai.svg`,Topaz:`${o}topaz.svg`,Triton:`${o}nvidia_triton.png`,V0:`${o}v0.svg`,"Vercel Ai Gateway":`${o}vercel.svg`,"Vertex AI (Anthropic, Gemini, etc.)":`${o}google.svg`,"Vertex Ai Beta":`${o}google.svg`,Vllm:`${o}vllm.png`,VolcEngine:`${o}volcengine.png`,"Voyage AI":`${o}voyage.webp`,Watsonx:`${o}watsonx.svg`,"Watsonx Text":`${o}watsonx.svg`,xAI:`${o}xai.svg`,Xinference:`${o}xinference.svg`};e.s(["Providers",()=>a,"getPlaceholder",0,e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e)return"claude-3-opus";if("Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";else if("Google AI Studio"==e)return"gemini-pro";else if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";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 if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else if("Cursor"===e)return"cursor/claude-4-sonnet";else return"gpt-3.5-turbo"},"getProviderLogoAndName",0,e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:i[e],displayName:e}}let r=Object.keys(t).find(r=>t[r].toLowerCase()===e.toLowerCase());if(!r)return{logo:"",displayName:e};let o=a[r];return{logo:i[o],displayName:o}},"getProviderModels",0,(e,r)=>{console.log(`Provider key: ${e}`);let a=t[e];console.log(`Provider mapped to: ${a}`);let o=[];return e&&"object"==typeof r&&(Object.entries(r).forEach(([e,r])=>{if(null!==r&&"object"==typeof r&&"litellm_provider"in r){let t=r.litellm_provider;(t===a||"string"==typeof t&&t.includes(a))&&o.push(e)}}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(r).forEach(([e,r])=>{null!==r&&"object"==typeof r&&"litellm_provider"in r&&"cohere_chat"===r.litellm_provider&&o.push(e)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(r).forEach(([e,r])=>{null!==r&&"object"==typeof r&&"litellm_provider"in r&&"sagemaker_chat"===r.litellm_provider&&o.push(e)}))),o},"providerLogoMap",0,i,"provider_map",0,t])},240647,e=>{"use strict";var r=e.i(286612);e.s(["RightOutlined",()=>r.default])},362024,e=>{"use strict";var r=e.i(988122);e.s(["Collapse",()=>r.default])},980187,e=>{"use strict";e.s(["createTeamAliasMap",0,e=>e?e.reduce((e,r)=>(e[r.team_id]=r.team_alias,e),{}):{},"resolveTeamAliasFromTeamID",0,(e,r)=>{let a=r.find(r=>r.team_id===e);return a?a.team_alias:null}])},793130,e=>{"use strict";var r=e.i(290571),a=e.i(429427),t=e.i(371330),o=e.i(271645),i=e.i(394487),l=e.i(503269),n=e.i(214520),s=e.i(746725),u=e.i(914189),c=e.i(144279),d=e.i(294316),m=e.i(601893),g=e.i(140721),A=e.i(942803),p=e.i(233538),f=e.i(694421),v=e.i(700020),b=e.i(35889),I=e.i(998348),h=e.i(722678);let C=(0,o.createContext)(null);C.displayName="GroupContext";let E=o.Fragment,T=Object.assign((0,v.forwardRefWithAs)(function(e,r){var E;let T=(0,o.useId)(),_=(0,A.useProvidedId)(),O=(0,m.useDisabled)(),{id:k=_||`headlessui-switch-${T}`,disabled:L=O||!1,checked:x,defaultChecked:M,onChange:y,name:R,value:N,form:S,autoFocus:$=!1,...w}=e,P=(0,o.useContext)(C),[D,F]=(0,o.useState)(null),G=(0,o.useRef)(null),B=(0,d.useSyncRefs)(G,r,null===P?null:P.setSwitch,F),V=(0,n.useDefaultValue)(M),[H,z]=(0,l.useControllable)(x,y,null!=V&&V),U=(0,s.useDisposables)(),[j,W]=(0,o.useState)(!1),X=(0,u.useEvent)(()=>{W(!0),null==z||z(!H),U.nextFrame(()=>{W(!1)})}),K=(0,u.useEvent)(e=>{if((0,p.isDisabledReactIssue7711)(e.currentTarget))return e.preventDefault();e.preventDefault(),X()}),q=(0,u.useEvent)(e=>{e.key===I.Keys.Space?(e.preventDefault(),X()):e.key===I.Keys.Enter&&(0,f.attemptSubmit)(e.currentTarget)}),Y=(0,u.useEvent)(e=>e.preventDefault()),Z=(0,h.useLabelledBy)(),J=(0,b.useDescribedBy)(),{isFocusVisible:Q,focusProps:ee}=(0,a.useFocusRing)({autoFocus:$}),{isHovered:er,hoverProps:ea}=(0,t.useHover)({isDisabled:L}),{pressed:et,pressProps:eo}=(0,i.useActivePress)({disabled:L}),ei=(0,o.useMemo)(()=>({checked:H,disabled:L,hover:er,focus:Q,active:et,autofocus:$,changing:j}),[H,er,Q,et,L,j,$]),el=(0,v.mergeProps)({id:k,ref:B,role:"switch",type:(0,c.useResolveButtonType)(e,D),tabIndex:-1===e.tabIndex?0:null!=(E=e.tabIndex)?E:0,"aria-checked":H,"aria-labelledby":Z,"aria-describedby":J,disabled:L||void 0,autoFocus:$,onClick:K,onKeyUp:q,onKeyPress:Y},ee,ea,eo),en=(0,o.useCallback)(()=>{if(void 0!==V)return null==z?void 0:z(V)},[z,V]),es=(0,v.useRender)();return o.default.createElement(o.default.Fragment,null,null!=R&&o.default.createElement(g.FormFields,{disabled:L,data:{[R]:N||"on"},overrides:{type:"checkbox",checked:H},form:S,onReset:en}),es({ourProps:el,theirProps:w,slot:ei,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var r;let[a,t]=(0,o.useState)(null),[i,l]=(0,h.useLabels)(),[n,s]=(0,b.useDescriptions)(),u=(0,o.useMemo)(()=>({switch:a,setSwitch:t}),[a,t]),c=(0,v.useRender)();return o.default.createElement(s,{name:"Switch.Description",value:n},o.default.createElement(l,{name:"Switch.Label",value:i,props:{htmlFor:null==(r=u.switch)?void 0:r.id,onClick(e){a&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),a.click(),a.focus({preventScroll:!0}))}}},o.default.createElement(C.Provider,{value:u},c({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:h.Label,Description:b.Description});var _=e.i(888288),O=e.i(95779),k=e.i(444755),L=e.i(673706),x=e.i(829087);let M=(0,L.makeClassName)("Switch"),y=o.default.forwardRef((e,a)=>{let{checked:t,defaultChecked:i=!1,onChange:l,color:n,name:s,error:u,errorMessage:c,disabled:d,required:m,tooltip:g,id:A}=e,p=(0,r.__rest)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),f={bgColor:n?(0,L.getColorClassNames)(n,O.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:n?(0,L.getColorClassNames)(n,O.colorPalette.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,b]=(0,_.default)(i,t),[I,h]=(0,o.useState)(!1),{tooltipProps:C,getReferenceProps:E}=(0,x.useTooltip)(300);return o.default.createElement("div",{className:"flex flex-row items-center justify-start"},o.default.createElement(x.default,Object.assign({text:g},C)),o.default.createElement("div",Object.assign({ref:(0,L.mergeRefs)([a,C.refs.setReference]),className:(0,k.tremorTwMerge)(M("root"),"flex flex-row relative h-5")},p,E),o.default.createElement("input",{type:"checkbox",className:(0,k.tremorTwMerge)(M("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:s,required:m,checked:v,onChange:e=>{e.preventDefault()}}),o.default.createElement(T,{checked:v,onChange:e=>{b(e),null==l||l(e)},disabled:d,className:(0,k.tremorTwMerge)(M("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>h(!0),onBlur:()=>h(!1),id:A},o.default.createElement("span",{className:(0,k.tremorTwMerge)(M("sr-only"),"sr-only")},"Switch ",v?"on":"off"),o.default.createElement("span",{"aria-hidden":"true",className:(0,k.tremorTwMerge)(M("background"),v?f.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),o.default.createElement("span",{"aria-hidden":"true",className:(0,k.tremorTwMerge)(M("round"),v?(0,k.tremorTwMerge)(f.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",I?(0,k.tremorTwMerge)("ring-2",f.ringColor):"")}))),u&&c?o.default.createElement("p",{className:(0,k.tremorTwMerge)(M("errorMessage"),"text-sm text-red-500 mt-1 ")},c):null)});y.displayName="Switch",e.s(["Switch",()=>y],793130)},418371,e=>{"use strict";var r=e.i(843476),a=e.i(271645),t=e.i(916925);e.s(["ProviderLogo",0,({provider:e,className:o="w-4 h-4"})=>{let[i,l]=(0,a.useState)(!1),{logo:n}=(0,t.getProviderLogoAndName)(e);return i||!n?(0,r.jsx)("div",{className:`${o} rounded-full bg-gray-200 flex items-center justify-center text-xs`,children:e?.charAt(0)||"-"}):(0,r.jsx)("img",{src:n,alt:`${e} logo`,className:o,onError:()=>l(!0)})}])},571303,e=>{"use strict";var r=e.i(843476),a=e.i(271645),t=e.i(115504);function o({className:e="",...o}){var i,l;let n=(0,a.useId)();return i=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),r=e.find(e=>e.effect.target?.getAttribute("data-spinner-id")===n),a=e.find(e=>e.effect instanceof KeyframeEffect&&e.effect.target?.getAttribute("data-spinner-id")!==n);r&&a&&(r.currentTime=a.currentTime)},l=[n],(0,a.useLayoutEffect)(i,l),(0,r.jsxs)("svg",{"data-spinner-id":n,className:(0,t.cx)("pointer-events-none size-12 animate-spin text-current",e),fill:"none",viewBox:"0 0 24 24",...o,children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}e.s(["UiLoadingSpinner",()=>o],571303)},366283,e=>{"use strict";var r=e.i(290571),a=e.i(271645),t=e.i(95779),o=e.i(444755),i=e.i(673706);let l=(0,i.makeClassName)("Callout"),n=a.default.forwardRef((e,n)=>{let{title:s,icon:u,color:c,className:d,children:m}=e,g=(0,r.__rest)(e,["title","icon","color","className","children"]);return a.default.createElement("div",Object.assign({ref:n,className:(0,o.tremorTwMerge)(l("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",c?(0,o.tremorTwMerge)((0,i.getColorClassNames)(c,t.colorPalette.background).bgColor,(0,i.getColorClassNames)(c,t.colorPalette.darkBorder).borderColor,(0,i.getColorClassNames)(c,t.colorPalette.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,o.tremorTwMerge)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),d)},g),a.default.createElement("div",{className:(0,o.tremorTwMerge)(l("header"),"flex items-start")},u?a.default.createElement(u,{className:(0,o.tremorTwMerge)(l("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.default.createElement("h4",{className:(0,o.tremorTwMerge)(l("title"),"font-semibold")},s)),a.default.createElement("p",{className:(0,o.tremorTwMerge)(l("body"),"overflow-y-auto",m?"mt-2":"")},m))});n.displayName="Callout",e.s(["Callout",()=>n],366283)},986888,e=>{"use strict";var r=e.i(843476),a=e.i(797305),t=e.i(135214),o=e.i(214541);e.s(["default",0,()=>{let{accessToken:e,userRole:i,userId:l,premiumUser:n}=(0,t.default)(),{teams:s}=(0,o.default)();return(0,r.jsx)(a.default,{teams:s??[],organizations:[]})}])}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3ac3a9a88413bb27.js b/litellm/proxy/_experimental/out/_next/static/chunks/3ac3a9a88413bb27.js
deleted file mode 100644
index 31de866e0f..0000000000
--- a/litellm/proxy/_experimental/out/_next/static/chunks/3ac3a9a88413bb27.js
+++ /dev/null
@@ -1 +0,0 @@
-(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,954616,e=>{"use strict";var t=e.i(271645),s=e.i(114272),r=e.i(540143),a=e.i(915823),i=e.i(619273),l=class extends a.Subscribable{#e;#t=void 0;#s;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,i.shallowEqualObjects)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,i.hashKey)(t.mutationKey)!==(0,i.hashKey)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#a(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#a(),this.#i()}mutate(e,t){return this.#r=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#a(){let e=this.#s?.state??(0,s.getDefaultState)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#i(e){r.notifyManager.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,t,s,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,s,r)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,t,s,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,s,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},n=e.i(912598);function c(e,s){let a=(0,n.useQueryClient)(s),[c]=t.useState(()=>new l(a,e));t.useEffect(()=>{c.setOptions(e)},[c,e]);let o=t.useSyncExternalStore(t.useCallback(e=>c.subscribe(r.notifyManager.batchCalls(e)),[c]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),u=t.useCallback((e,t)=>{c.mutate(e,t).catch(i.noop)},[c]);if(o.error&&(0,i.shouldThrowError)(c.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}e.s(["useMutation",()=>c],954616)},888288,e=>{"use strict";var t=e.i(271645);let s=(e,s)=>{let r=void 0!==s,[a,i]=(0,t.useState)(e);return[r?s:a,e=>{r||i(e)}]};e.s(["default",()=>s])},492030,e=>{"use strict";var t=e.i(121229);e.s(["CheckOutlined",()=>t.default])},166406,e=>{"use strict";var t=e.i(190144);e.s(["CopyOutlined",()=>t.default])},447566,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};var a=e.i(9583),i=s.forwardRef(function(e,i){return s.createElement(a.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["ArrowLeftOutlined",0,i],447566)},292639,e=>{"use strict";var t=e.i(764205),s=e.i(266027);let r=(0,e.i(243652).createQueryKeys)("uiSettings");e.s(["useUISettings",0,()=>(0,s.useQuery)({queryKey:r.list({}),queryFn:async()=>await (0,t.getUiSettings)(),staleTime:36e5,gcTime:36e5})])},250980,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.s(["PlusCircleIcon",0,s],250980)},502547,e=>{"use strict";var t=e.i(271645);let s=t.forwardRef(function(e,s){return t.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:s},e),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});e.s(["ChevronRightIcon",0,s],502547)},178654,621192,e=>{"use strict";let t=e.i(211576).Col;e.s(["Col",0,t],178654);let s=e.i(264042).Row;e.s(["Row",0,s],621192)},214541,e=>{"use strict";var t=e.i(271645),s=e.i(135214),r=e.i(270345);e.s(["default",0,()=>{let[e,a]=(0,t.useState)([]),{accessToken:i,userId:l,userRole:n}=(0,s.default)();return(0,t.useEffect)(()=>{(async()=>{a(await (0,r.fetchTeams)(i,l,n,null))})()},[i,l,n]),{teams:e,setTeams:a}}])},439189,435684,96226,497245,e=>{"use strict";function t(e){let t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):new Date("number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?e:NaN)}function s(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function r(e,r){let a=t(e);return isNaN(r)?s(e,NaN):(r&&a.setDate(a.getDate()+r),a)}function a(e,r){let a=t(e);if(isNaN(r))return s(e,NaN);if(!r)return a;let i=a.getDate(),l=s(e,a.getTime());return(l.setMonth(a.getMonth()+r+1,0),i>=l.getDate())?l:(a.setFullYear(l.getFullYear(),l.getMonth(),i),a)}e.s(["toDate",()=>t],435684),e.s(["constructFrom",()=>s],96226),e.s(["addDays",()=>r],439189),e.s(["addMonths",()=>a],497245)},525720,e=>{"use strict";e.i(247167);var t=e.i(271645),s=e.i(343794),r=e.i(529681),a=e.i(908286),i=e.i(242064),l=e.i(246422),n=e.i(838378);let c=["wrap","nowrap","wrap-reverse"],o=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],u=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],d=function(e,t){let r,a,i;return(0,s.default)(Object.assign(Object.assign(Object.assign({},(r=!0===t.wrap?"wrap":t.wrap,{[`${e}-wrap-${r}`]:r&&c.includes(r)})),(a={},u.forEach(s=>{a[`${e}-align-${s}`]=t.align===s}),a[`${e}-align-stretch`]=!t.align&&!!t.vertical,a)),(i={},o.forEach(s=>{i[`${e}-justify-${s}`]=t.justify===s}),i)))},p=(0,l.genStyleHooks)("Flex",e=>{let{paddingXS:t,padding:s,paddingLG:r}=e,a=(0,n.mergeToken)(e,{flexGapSM:t,flexGap:s,flexGapLG:r});return[(e=>{let{componentCls:t}=e;return{[t]:{display:"flex",margin:0,padding:0,"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}})(a),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}})(a),(e=>{let{componentCls:t}=e,s={};return c.forEach(e=>{s[`${t}-wrap-${e}`]={flexWrap:e}}),s})(a),(e=>{let{componentCls:t}=e,s={};return u.forEach(e=>{s[`${t}-align-${e}`]={alignItems:e}}),s})(a),(e=>{let{componentCls:t}=e,s={};return o.forEach(e=>{s[`${t}-justify-${e}`]={justifyContent:e}}),s})(a)]},()=>({}),{resetStyle:!1});var h=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(s[r[a]]=e[r[a]]);return s};let m=t.default.forwardRef((e,l)=>{let{prefixCls:n,rootClassName:c,className:o,style:u,flex:m,gap:g,vertical:x=!1,component:f="div",children:v}=e,y=h(e,["prefixCls","rootClassName","className","style","flex","gap","vertical","component","children"]),{flex:b,direction:j,getPrefixCls:w}=t.default.useContext(i.ConfigContext),N=w("flex",n),[M,S,C]=p(N),O=null!=x?x:null==b?void 0:b.vertical,k=(0,s.default)(o,c,null==b?void 0:b.className,N,S,C,d(N,e),{[`${N}-rtl`]:"rtl"===j,[`${N}-gap-${g}`]:(0,a.isPresetSize)(g),[`${N}-vertical`]:O}),_=Object.assign(Object.assign({},null==b?void 0:b.style),u);return m&&(_.flex=m),g&&!(0,a.isPresetSize)(g)&&(_.gap=g),M(t.default.createElement(f,Object.assign({ref:l,className:k,style:_},(0,r.default)(y,["justify","wrap","align"])),v))});e.s(["Flex",0,m],525720)},891547,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(199133),a=e.i(764205);e.s(["default",0,({onChange:e,value:i,className:l,accessToken:n,disabled:c})=>{let[o,u]=(0,s.useState)([]),[d,p]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(n){p(!0);try{let e=await (0,a.getGuardrailsList)(n);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),u(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{p(!1)}}})()},[n]),(0,t.jsx)("div",{children:(0,t.jsx)(r.Select,{mode:"multiple",disabled:c,placeholder:c?"Setting guardrails is a premium feature.":"Select guardrails",onChange:t=>{console.log("Selected guardrails:",t),e(t)},value:i,loading:d,className:l,allowClear:!0,options:o.map(e=>(console.log("Mapping guardrail:",e),{label:`${e.guardrail_name}`,value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}])},921511,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(199133),a=e.i(764205);function i(e){return e.filter(e=>(e.version_status??"draft")!=="draft").map(e=>{var t;let s=e.version_number??1,r=e.version_status??"draft";return{label:`${e.policy_name} — v${s} (${r})${e.description?` — ${e.description}`:""}`,value:"production"===r?e.policy_name:e.policy_id?(t=e.policy_id,`policy_${t}`):e.policy_name}})}e.s(["default",0,({onChange:e,value:l,className:n,accessToken:c,disabled:o,onPoliciesLoaded:u})=>{let[d,p]=(0,s.useState)([]),[h,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(c){m(!0);try{let e=await (0,a.getPoliciesList)(c);e.policies&&(p(e.policies),u?.(e.policies))}catch(e){console.error("Error fetching policies:",e)}finally{m(!1)}}})()},[c,u]),(0,t.jsx)("div",{children:(0,t.jsx)(r.Select,{mode:"multiple",disabled:o,placeholder:o?"Setting policies is a premium feature.":"Select policies (production or published versions)",onChange:t=>{e(t)},value:l,loading:h,className:n,allowClear:!0,options:i(d),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},"getPolicyOptionEntries",()=>i])},384767,e=>{"use strict";var t=e.i(843476),s=e.i(599724),r=e.i(271645),a=e.i(389083);let i=r.forwardRef(function(e,t){return r.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),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});var l=e.i(764205);let n=function({vectorStores:e,accessToken:n}){let[c,o]=(0,r.useState)([]);return(0,r.useEffect)(()=>{(async()=>{if(n&&0!==e.length)try{let e=await (0,l.vectorStoreListCall)(n);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[n,e.length]),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(s.Text,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,t.jsx)(a.Badge,{color:"blue",size:"xs",children:e.length})]}),e.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((e,s)=>{let r;return(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:(r=c.find(t=>t.vector_store_id===e))?`${r.vector_store_name||r.vector_store_id} (${r.vector_store_id})`:e},s)})}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(i,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(s.Text,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},c=r.forwardRef(function(e,t){return r.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),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});var o=e.i(871943),u=e.i(502547),d=e.i(592968);let p=function({mcpServers:e,mcpAccessGroups:i=[],mcpToolPermissions:n={},mcpToolsets:p=[],accessToken:h}){let[m,g]=(0,r.useState)([]),[x,f]=(0,r.useState)([]),[v,y]=(0,r.useState)(new Set),[b,j]=(0,r.useState)(new Set);(0,r.useEffect)(()=>{(async()=>{if(h&&e.length>0)try{let e=await (0,l.fetchMCPServers)(h);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[h,e.length]),(0,r.useEffect)(()=>{(async()=>{if(h&&p.length>0)try{let e=await (0,l.fetchMCPToolsets)(h),t=Array.isArray(e)?e.filter(e=>p.includes(e.toolset_id)):[];f(t)}catch(e){console.error("Error fetching toolsets:",e)}})()},[h,p.length]);let w=[...e.map(e=>({type:"server",value:e})),...i.map(e=>({type:"accessGroup",value:e}))],N=w.length+p.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(s.Text,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,t.jsx)(a.Badge,{color:"blue",size:"xs",children:N})]}),N>0?(0,t.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:[w.map((e,s)=>{let r="server"===e.type?n[e.value]:void 0,a=r&&r.length>0,i=v.has(e.value);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>{var t;return a&&(t=e.value,void y(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s}))},className:`flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ${a?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,t.jsx)(d.Tooltip,{title:`Full ID: ${e.value}`,placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:(e=>{let t=m.find(t=>t.server_id===e);if(t){let s=e.length>7?`${e.slice(0,3)}...${e.slice(-4)}`:e;return`${t.alias} (${s})`}return e})(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),a&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:r.length}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===r.length?"tool":"tools"}),i?(0,t.jsx)(o.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(u.ChevronRightIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),a&&i&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map((e,s)=>(0,t.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)}),p.length>0&&p.map((e,s)=>{let r=x.find(t=>t.toolset_id===e),a=b.has(e),i=r?.tools.length??0;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>i>0&&void j(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s}),className:`flex items-center gap-3 py-2 px-3 rounded-lg border border-purple-200 transition-all ${i>0?"cursor-pointer hover:bg-purple-50 hover:border-purple-300":"bg-white"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:r?.toolset_name??e}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-purple-600 bg-purple-50 border border-purple-200 rounded uppercase tracking-wide flex-shrink-0",children:"Toolset"})]}),i>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:i}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===i?"tool":"tools"}),a?(0,t.jsx)(o.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(u.ChevronRightIcon,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),i>0&&a&&r&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-purple-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tools.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-xs font-medium",children:[(0,t.jsxs)("span",{className:"text-purple-400 mr-1 text-[10px]",children:[e.server_id.slice(0,6),"…"]}),e.tool_name]},s))})})]},`toolset-${s}`)})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(c,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(s.Text,{className:"text-gray-500 text-sm",children:"No MCP servers, access groups, or toolsets configured"})]})]})},h=r.forwardRef(function(e,t){return r.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),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))}),m=function({agents:e,agentAccessGroups:i=[],accessToken:n}){let[c,o]=(0,r.useState)([]);(0,r.useEffect)(()=>{(async()=>{if(n&&e.length>0)try{let e=await (0,l.getAgentsList)(n);e&&e.agents&&Array.isArray(e.agents)&&o(e.agents)}catch(e){console.error("Error fetching agents:",e)}})()},[n,e.length]);let u=[...e.map(e=>({type:"agent",value:e})),...i.map(e=>({type:"accessGroup",value:e}))],p=u.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h,{className:"h-4 w-4 text-purple-600"}),(0,t.jsx)(s.Text,{className:"font-semibold text-gray-900",children:"Agents"}),(0,t.jsx)(a.Badge,{color:"purple",size:"xs",children:p})]}),p>0?(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:u.map((e,s)=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)("div",{className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"agent"===e.type?(0,t.jsx)(d.Tooltip,{title:`Full ID: ${e.value}`,placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:(e=>{let t=c.find(t=>t.agent_id===e);if(t){let s=e.length>7?`${e.slice(0,3)}...${e.slice(-4)}`:e;return`${t.agent_name} (${s})`}return e})(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})})})},s))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(h,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(s.Text,{className:"text-gray-500 text-sm",children:"No agents or access groups configured"})]})]})};e.s(["default",0,function({objectPermission:e,variant:r="card",className:a="",accessToken:i}){let l=e?.vector_stores||[],c=e?.mcp_servers||[],o=e?.mcp_access_groups||[],u=e?.mcp_tool_permissions||{},d=e?.mcp_toolsets||[],h=e?.agents||[],g=e?.agent_access_groups||[],x=(0,t.jsxs)("div",{className:"card"===r?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6":"space-y-4",children:[(0,t.jsx)(n,{vectorStores:l,accessToken:i}),(0,t.jsx)(p,{mcpServers:c,mcpAccessGroups:o,mcpToolPermissions:u,mcpToolsets:d,accessToken:i}),(0,t.jsx)(m,{agents:h,agentAccessGroups:g,accessToken:i})]});return"card"===r?(0,t.jsxs)("div",{className:`bg-white border border-gray-200 rounded-lg p-6 ${a}`,children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(s.Text,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,t.jsx)(s.Text,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),x]}):(0,t.jsxs)("div",{className:`${a}`,children:[(0,t.jsx)(s.Text,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),x]})}],384767)},160818,e=>{"use strict";e.i(247167);var t=e.i(931067),s=e.i(271645);let r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"};var a=e.i(9583),i=s.forwardRef(function(e,i){return s.createElement(a.default,(0,t.default)({},e,{ref:i,icon:r}))});e.s(["GlobalOutlined",0,i],160818)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3ba782adb71e77d0.js b/litellm/proxy/_experimental/out/_next/static/chunks/3ba782adb71e77d0.js
new file mode 100644
index 0000000000..2473bd3d29
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/3ba782adb71e77d0.js
@@ -0,0 +1,7 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,536916,e=>{"use strict";var t=e.i(374276);e.s(["Checkbox",()=>t.default])},464571,e=>{"use strict";var t=e.i(920228);e.s(["Button",()=>t.default])},959013,e=>{"use strict";e.i(247167);var t=e.i(931067),n=e.i(271645);let r={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"};var a=e.i(9583),l=n.forwardRef(function(e,l){return n.createElement(a.default,(0,t.default)({},e,{ref:l,icon:r}))});e.s(["default",0,l],959013)},599724,936325,e=>{"use strict";var t=e.i(95779),n=e.i(444755),r=e.i(673706),a=e.i(271645);let l=a.default.forwardRef((e,l)=>{let{color:o,className:i,children:c}=e;return a.default.createElement("p",{ref:l,className:(0,n.tremorTwMerge)("text-tremor-default",o?(0,r.getColorClassNames)(o,t.colorPalette.text).textColor:(0,n.tremorTwMerge)("text-tremor-content","dark:text-dark-tremor-content"),i)},c)});l.displayName="Text",e.s(["default",()=>l],936325),e.s(["Text",()=>l],599724)},304967,e=>{"use strict";var t=e.i(290571),n=e.i(271645),r=e.i(480731),a=e.i(95779),l=e.i(444755),o=e.i(673706);let i=(0,o.makeClassName)("Card"),c=n.default.forwardRef((e,c)=>{let{decoration:s="",decorationColor:d,children:u,className:p}=e,g=(0,t.__rest)(e,["decoration","decorationColor","children","className"]);return n.default.createElement("div",Object.assign({ref:c,className:(0,l.tremorTwMerge)(i("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",d?(0,o.getColorClassNames)(d,a.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",(e=>{if(!e)return"";switch(e){case r.HorizontalPositions.Left:return"border-l-4";case r.VerticalPositions.Top:return"border-t-4";case r.HorizontalPositions.Right:return"border-r-4";case r.VerticalPositions.Bottom:return"border-b-4";default:return""}})(s),p)},g),u)});c.displayName="Card",e.s(["Card",()=>c],304967)},91874,e=>{"use strict";var t=e.i(931067),n=e.i(209428),r=e.i(211577),a=e.i(392221),l=e.i(703923),o=e.i(343794),i=e.i(914949),c=e.i(271645),s=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],d=(0,c.forwardRef)(function(e,d){var u=e.prefixCls,p=void 0===u?"rc-checkbox":u,g=e.className,m=e.style,f=e.checked,b=e.disabled,h=e.defaultChecked,$=e.type,v=void 0===$?"checkbox":$,C=e.title,y=e.onChange,k=(0,l.default)(e,s),S=(0,c.useRef)(null),w=(0,c.useRef)(null),x=(0,i.default)(void 0!==h&&h,{value:f}),O=(0,a.default)(x,2),I=O[0],E=O[1];(0,c.useImperativeHandle)(d,function(){return{focus:function(e){var t;null==(t=S.current)||t.focus(e)},blur:function(){var e;null==(e=S.current)||e.blur()},input:S.current,nativeElement:w.current}});var N=(0,o.default)(p,g,(0,r.default)((0,r.default)({},"".concat(p,"-checked"),I),"".concat(p,"-disabled"),b));return c.createElement("span",{className:N,title:C,style:m,ref:w},c.createElement("input",(0,t.default)({},k,{className:"".concat(p,"-input"),ref:S,onChange:function(t){b||("checked"in e||E(t.target.checked),null==y||y({target:(0,n.default)((0,n.default)({},e),{},{type:v,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))},disabled:b,checked:!!I,type:v})),c.createElement("span",{className:"".concat(p,"-inner")}))});e.s(["default",0,d])},421512,236836,e=>{"use strict";let t=e.i(271645).default.createContext(null);e.s(["default",0,t],421512),e.i(296059);var n=e.i(915654),r=e.i(183293),a=e.i(246422),l=e.i(838378);function o(e,t){return(e=>{let{checkboxCls:t}=e,a=`${t}-wrapper`;return[{[`${t}-group`]:Object.assign(Object.assign({},(0,r.resetComponent)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[a]:Object.assign(Object.assign({},(0,r.resetComponent)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${a}`]:{marginInlineStart:0},[`&${a}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[t]:Object.assign(Object.assign({},(0,r.resetComponent)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:(0,r.genFocusOutline)(e)},[`${t}-inner`]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${(0,n.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:`${(0,n.unit)(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`
+ ${a}:not(${a}-disabled),
+ ${t}:not(${t}-disabled)
+ `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${a}:not(${a}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`
+ ${a}-checked:not(${a}-disabled),
+ ${t}-checked:not(${t}-disabled)
+ `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${a}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]})((0,l.mergeToken)(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}let i=(0,a.genStyleHooks)("Checkbox",(e,{prefixCls:t})=>[o(t,e)]);e.s(["default",0,i,"getStyle",()=>o],236836)},681216,e=>{"use strict";var t=e.i(271645),n=e.i(963188);function r(e){let r=t.default.useRef(null),a=()=>{n.default.cancel(r.current),r.current=null};return[()=>{a(),r.current=(0,n.default)(()=>{r.current=null})},t=>{r.current&&(t.stopPropagation(),a()),null==e||e(t)}]}e.s(["default",()=>r])},374276,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),r=e.i(91874),a=e.i(611935),l=e.i(121872),o=e.i(26905),i=e.i(242064),c=e.i(937328),s=e.i(321883),d=e.i(62139),u=e.i(421512),p=e.i(236836),g=e.i(681216),m=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let f=t.forwardRef((e,f)=>{var b;let{prefixCls:h,className:$,rootClassName:v,children:C,indeterminate:y=!1,style:k,onMouseEnter:S,onMouseLeave:w,skipGroup:x=!1,disabled:O}=e,I=m(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:E,direction:N,checkbox:j}=t.useContext(i.ConfigContext),P=t.useContext(u.default),{isFormItemInput:z}=t.useContext(d.FormItemInputContext),T=t.useContext(c.default),R=null!=(b=(null==P?void 0:P.disabled)||O)?b:T,M=t.useRef(I.value),q=t.useRef(null),H=(0,a.composeRef)(f,q);t.useEffect(()=>{null==P||P.registerValue(I.value)},[]),t.useEffect(()=>{if(!x)return I.value!==M.current&&(null==P||P.cancelValue(M.current),null==P||P.registerValue(I.value),M.current=I.value),()=>null==P?void 0:P.cancelValue(I.value)},[I.value]),t.useEffect(()=>{var e;(null==(e=q.current)?void 0:e.input)&&(q.current.input.indeterminate=y)},[y]);let B=E("checkbox",h),D=(0,s.default)(B),[L,G,A]=(0,p.default)(B,D),W=Object.assign({},I);P&&!x&&(W.onChange=(...e)=>{I.onChange&&I.onChange.apply(I,e),P.toggleOption&&P.toggleOption({label:C,value:I.value})},W.name=P.name,W.checked=P.value.includes(I.value));let F=(0,n.default)(`${B}-wrapper`,{[`${B}-rtl`]:"rtl"===N,[`${B}-wrapper-checked`]:W.checked,[`${B}-wrapper-disabled`]:R,[`${B}-wrapper-in-form-item`]:z},null==j?void 0:j.className,$,v,A,D,G),X=(0,n.default)({[`${B}-indeterminate`]:y},o.TARGET_CLS,G),[V,_]=(0,g.default)(W.onClick);return L(t.createElement(l.default,{component:"Checkbox",disabled:R},t.createElement("label",{className:F,style:Object.assign(Object.assign({},null==j?void 0:j.style),k),onMouseEnter:S,onMouseLeave:w,onClick:V},t.createElement(r.default,Object.assign({},W,{onClick:_,prefixCls:B,className:X,disabled:R,ref:H})),null!=C&&t.createElement("span",{className:`${B}-label`},C))))});var b=e.i(8211),h=e.i(529681),$=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let v=t.forwardRef((e,r)=>{let{defaultValue:a,children:l,options:o=[],prefixCls:c,className:d,rootClassName:g,style:m,onChange:v}=e,C=$(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:y,direction:k}=t.useContext(i.ConfigContext),[S,w]=t.useState(C.value||a||[]),[x,O]=t.useState([]);t.useEffect(()=>{"value"in C&&w(C.value||[])},[C.value]);let I=t.useMemo(()=>o.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[o]),E=e=>{O(t=>t.filter(t=>t!==e))},N=e=>{O(t=>[].concat((0,b.default)(t),[e]))},j=e=>{let t=S.indexOf(e.value),n=(0,b.default)(S);-1===t?n.push(e.value):n.splice(t,1),"value"in C||w(n),null==v||v(n.filter(e=>x.includes(e)).sort((e,t)=>I.findIndex(t=>t.value===e)-I.findIndex(e=>e.value===t)))},P=y("checkbox",c),z=`${P}-group`,T=(0,s.default)(P),[R,M,q]=(0,p.default)(P,T),H=(0,h.default)(C,["value","disabled"]),B=o.length?I.map(e=>t.createElement(f,{prefixCls:P,key:e.value.toString(),disabled:"disabled"in e?e.disabled:C.disabled,value:e.value,checked:S.includes(e.value),onChange:e.onChange,className:(0,n.default)(`${z}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):l,D=t.useMemo(()=>({toggleOption:j,value:S,disabled:C.disabled,name:C.name,registerValue:N,cancelValue:E}),[j,S,C.disabled,C.name,N,E]),L=(0,n.default)(z,{[`${z}-rtl`]:"rtl"===k},d,g,q,T,M);return R(t.createElement("div",Object.assign({className:L,style:m},H,{ref:r}),t.createElement(u.default.Provider,{value:D},B)))});f.Group=v,f.__ANT_CHECKBOX=!0,e.s(["default",0,f],374276)},653496,e=>{"use strict";var t=e.i(721369);e.s(["Tabs",()=>t.default])},790848,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(739295),r=e.i(343794),a=e.i(931067),l=e.i(211577),o=e.i(392221),i=e.i(703923),c=e.i(914949),s=e.i(404948),d=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],u=t.forwardRef(function(e,n){var u,p=e.prefixCls,g=void 0===p?"rc-switch":p,m=e.className,f=e.checked,b=e.defaultChecked,h=e.disabled,$=e.loadingIcon,v=e.checkedChildren,C=e.unCheckedChildren,y=e.onClick,k=e.onChange,S=e.onKeyDown,w=(0,i.default)(e,d),x=(0,c.default)(!1,{value:f,defaultValue:b}),O=(0,o.default)(x,2),I=O[0],E=O[1];function N(e,t){var n=I;return h||(E(n=e),null==k||k(n,t)),n}var j=(0,r.default)(g,m,(u={},(0,l.default)(u,"".concat(g,"-checked"),I),(0,l.default)(u,"".concat(g,"-disabled"),h),u));return t.createElement("button",(0,a.default)({},w,{type:"button",role:"switch","aria-checked":I,disabled:h,className:j,ref:n,onKeyDown:function(e){e.which===s.default.LEFT?N(!1,e):e.which===s.default.RIGHT&&N(!0,e),null==S||S(e)},onClick:function(e){var t=N(!I,e);null==y||y(t,e)}}),$,t.createElement("span",{className:"".concat(g,"-inner")},t.createElement("span",{className:"".concat(g,"-inner-checked")},v),t.createElement("span",{className:"".concat(g,"-inner-unchecked")},C)))});u.displayName="Switch";var p=e.i(121872),g=e.i(242064),m=e.i(937328),f=e.i(517455);e.i(296059);var b=e.i(915654);e.i(262370);var h=e.i(135551),$=e.i(183293),v=e.i(246422),C=e.i(838378);let y=(0,v.genStyleHooks)("Switch",e=>{let t=(0,C.mergeToken)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:"-30%"});return[(e=>{let{componentCls:t,trackHeight:n,trackMinWidth:r}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,$.resetComponent)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:r,height:n,lineHeight:(0,b.unit)(n),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${e.motionDurationMid}`,userSelect:"none",[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),(0,$.genFocusStyle)(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${t}-rtl`]:{direction:"rtl"}})}})(t),(e=>{let{componentCls:t,trackHeight:n,trackPadding:r,innerMinMargin:a,innerMaxMargin:l,handleSize:o,calc:i}=e,c=`${t}-inner`,s=(0,b.unit)(i(o).add(i(r).mul(2)).equal()),d=(0,b.unit)(i(l).mul(2).equal());return{[t]:{[c]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:l,paddingInlineEnd:a,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${c}-checked, ${c}-unchecked`]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:"none",minHeight:n},[`${c}-checked`]:{marginInlineStart:`calc(-100% + ${s} - ${d})`,marginInlineEnd:`calc(100% - ${s} + ${d})`},[`${c}-unchecked`]:{marginTop:i(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${c}`]:{paddingInlineStart:a,paddingInlineEnd:l,[`${c}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${c}-unchecked`]:{marginInlineStart:`calc(100% - ${s} + ${d})`,marginInlineEnd:`calc(-100% + ${s} - ${d})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${c}`]:{[`${c}-unchecked`]:{marginInlineStart:i(r).mul(2).equal(),marginInlineEnd:i(r).mul(-1).mul(2).equal()}},[`&${t}-checked ${c}`]:{[`${c}-checked`]:{marginInlineStart:i(r).mul(-1).mul(2).equal(),marginInlineEnd:i(r).mul(2).equal()}}}}}})(t),(e=>{let{componentCls:t,trackPadding:n,handleBg:r,handleShadow:a,handleSize:l,calc:o}=e,i=`${t}-handle`;return{[t]:{[i]:{position:"absolute",top:n,insetInlineStart:n,width:l,height:l,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:r,borderRadius:o(l).div(2).equal(),boxShadow:a,transition:`all ${e.switchDuration} ease-in-out`,content:'""'}},[`&${t}-checked ${i}`]:{insetInlineStart:`calc(100% - ${(0,b.unit)(o(l).add(n).equal())})`},[`&:not(${t}-disabled):active`]:{[`${i}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${i}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}})(t),(e=>{let{componentCls:t,handleSize:n,calc:r}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:"relative",top:r(r(n).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}})(t),(e=>{let{componentCls:t,trackHeightSM:n,trackPadding:r,trackMinWidthSM:a,innerMinMarginSM:l,innerMaxMarginSM:o,handleSizeSM:i,calc:c}=e,s=`${t}-inner`,d=(0,b.unit)(c(i).add(c(r).mul(2)).equal()),u=(0,b.unit)(c(o).mul(2).equal());return{[t]:{[`&${t}-small`]:{minWidth:a,height:n,lineHeight:(0,b.unit)(n),[`${t}-inner`]:{paddingInlineStart:o,paddingInlineEnd:l,[`${s}-checked, ${s}-unchecked`]:{minHeight:n},[`${s}-checked`]:{marginInlineStart:`calc(-100% + ${d} - ${u})`,marginInlineEnd:`calc(100% - ${d} + ${u})`},[`${s}-unchecked`]:{marginTop:c(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:i,height:i},[`${t}-loading-icon`]:{top:c(c(i).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:l,paddingInlineEnd:o,[`${s}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${s}-unchecked`]:{marginInlineStart:`calc(100% - ${d} + ${u})`,marginInlineEnd:`calc(-100% + ${d} - ${u})`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${(0,b.unit)(c(i).add(r).equal())})`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${s}`]:{[`${s}-unchecked`]:{marginInlineStart:c(e.marginXXS).div(2).equal(),marginInlineEnd:c(e.marginXXS).mul(-1).div(2).equal()}},[`&${t}-checked ${s}`]:{[`${s}-checked`]:{marginInlineStart:c(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:c(e.marginXXS).div(2).equal()}}}}}}})(t)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,colorWhite:a}=e,l=t*n,o=r/2,i=l-4,c=o-4;return{trackHeight:l,trackHeightSM:o,trackMinWidth:2*i+8,trackMinWidthSM:2*c+4,trackPadding:2,handleBg:a,handleSize:i,handleSizeSM:c,handleShadow:`0 2px 4px 0 ${new h.FastColor("#00230b").setA(.2).toRgbString()}`,innerMinMargin:i/2,innerMaxMargin:i+2+4,innerMinMarginSM:c/2,innerMaxMarginSM:c+2+4}});var k=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let S=t.forwardRef((e,a)=>{let{prefixCls:l,size:o,disabled:i,loading:s,className:d,rootClassName:b,style:h,checked:$,value:v,defaultChecked:C,defaultValue:S,onChange:w}=e,x=k(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[O,I]=(0,c.default)(!1,{value:null!=$?$:v,defaultValue:null!=C?C:S}),{getPrefixCls:E,direction:N,switch:j}=t.useContext(g.ConfigContext),P=t.useContext(m.default),z=(null!=i?i:P)||s,T=E("switch",l),R=t.createElement("div",{className:`${T}-handle`},s&&t.createElement(n.default,{className:`${T}-loading-icon`})),[M,q,H]=y(T),B=(0,f.default)(o),D=(0,r.default)(null==j?void 0:j.className,{[`${T}-small`]:"small"===B,[`${T}-loading`]:s,[`${T}-rtl`]:"rtl"===N},d,b,q,H),L=Object.assign(Object.assign({},null==j?void 0:j.style),h);return M(t.createElement(p.default,{component:"Switch",disabled:z},t.createElement(u,Object.assign({},x,{checked:O,onChange:(...e)=>{I(e[0]),null==w||w.apply(void 0,e)},prefixCls:T,className:D,style:L,disabled:z,ref:a,loadingIcon:R}))))});S.__ANT_SWITCH=!0,e.s(["Switch",0,S],790848)},770914,e=>{"use strict";var t=e.i(38243);e.s(["Space",()=>t.default])},38243,908286,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),r=e.i(876556);function a(e){return["small","middle","large"].includes(e)}function l(e){return!!e&&"number"==typeof e&&!Number.isNaN(e)}e.s(["isPresetSize",()=>a,"isValidGapNumber",()=>l],908286);var o=e.i(242064),i=e.i(249616),c=e.i(372409),s=e.i(246422);let d=(0,s.genStyleHooks)(["Space","Addon"],e=>[(e=>{let{componentCls:t,borderRadius:n,paddingSM:r,colorBorder:a,paddingXS:l,fontSizeLG:o,fontSizeSM:i,borderRadiusLG:s,borderRadiusSM:d,colorBgContainerDisabled:u,lineWidth:p}=e;return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:r,margin:0,background:u,borderWidth:p,borderStyle:"solid",borderColor:a,borderRadius:n,"&-large":{fontSize:o,borderRadius:s},"&-small":{paddingInline:l,borderRadius:d,fontSize:i},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0}},(0,c.genCompactItemStyle)(e,{focus:!1})]}})(e)]);var u=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let p=t.default.forwardRef((e,r)=>{let{className:a,children:l,style:c,prefixCls:s}=e,p=u(e,["className","children","style","prefixCls"]),{getPrefixCls:g,direction:m}=t.default.useContext(o.ConfigContext),f=g("space-addon",s),[b,h,$]=d(f),{compactItemClassnames:v,compactSize:C}=(0,i.useCompactItemContext)(f,m),y=(0,n.default)(f,h,v,$,{[`${f}-${C}`]:C},a);return b(t.default.createElement("div",Object.assign({ref:r,className:y,style:c},p),l))}),g=t.default.createContext({latestIndex:0}),m=g.Provider,f=({className:e,index:n,children:r,split:a,style:l})=>{let{latestIndex:o}=t.useContext(g);return null==r?null:t.createElement(t.Fragment,null,t.createElement("div",{className:e,style:l},r),n{let t=(0,b.mergeToken)(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[(e=>{let{componentCls:t,antCls:n}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${t}-item:empty`]:{display:"none"},[`${t}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}})(t)]},()=>({}),{resetStyle:!1});var $=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let v=t.forwardRef((e,i)=>{var c;let{getPrefixCls:s,direction:d,size:u,className:p,style:g,classNames:b,styles:v}=(0,o.useComponentConfig)("space"),{size:C=null!=u?u:"small",align:y,className:k,rootClassName:S,children:w,direction:x="horizontal",prefixCls:O,split:I,style:E,wrap:N=!1,classNames:j,styles:P}=e,z=$(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[T,R]=Array.isArray(C)?C:[C,C],M=a(R),q=a(T),H=l(R),B=l(T),D=(0,r.default)(w,{keepEmpty:!0}),L=void 0===y&&"horizontal"===x?"center":y,G=s("space",O),[A,W,F]=h(G),X=(0,n.default)(G,p,W,`${G}-${x}`,{[`${G}-rtl`]:"rtl"===d,[`${G}-align-${L}`]:L,[`${G}-gap-row-${R}`]:M,[`${G}-gap-col-${T}`]:q},k,S,F),V=(0,n.default)(`${G}-item`,null!=(c=null==j?void 0:j.item)?c:b.item),_=Object.assign(Object.assign({},v.item),null==P?void 0:P.item),K=D.map((e,n)=>{let r=(null==e?void 0:e.key)||`${V}-${n}`;return t.createElement(f,{className:V,key:r,index:n,split:I,style:_},e)}),U=t.useMemo(()=>({latestIndex:D.reduce((e,t,n)=>null!=t?n:e,0)}),[D]);if(0===D.length)return null;let Q={};return N&&(Q.flexWrap="wrap"),!q&&B&&(Q.columnGap=T),!M&&H&&(Q.rowGap=R),A(t.createElement("div",Object.assign({ref:i,className:X,style:Object.assign(Object.assign(Object.assign({},Q),g),E)},z),t.createElement(m,{value:U},K)))});v.Compact=i.default,v.Addon=p,e.s(["default",0,v],38243)},475254,e=>{"use strict";var t=e.i(271645);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},r=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var a={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 l=(0,t.forwardRef)(({color:e="currentColor",size:n=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:i="",children:c,iconNode:s,...d},u)=>(0,t.createElement)("svg",{ref:u,...a,width:n,height:n,stroke:e,strokeWidth:o?24*Number(l)/Number(n):l,className:r("lucide",i),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(d)&&{"aria-hidden":"true"},...d},[...s.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(c)?c:[c]])),o=(e,a)=>{let o=(0,t.forwardRef)(({className:o,...i},c)=>(0,t.createElement)(l,{ref:c,iconNode:a,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...i}));return o.displayName=n(e),o};e.s(["default",()=>o],475254)},262218,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(343794),r=e.i(529681),a=e.i(702779),l=e.i(563113),o=e.i(763731),i=e.i(121872),c=e.i(242064);e.i(296059);var s=e.i(915654);e.i(262370);var d=e.i(135551),u=e.i(183293),p=e.i(246422),g=e.i(838378);let m=e=>{let{lineWidth:t,fontSizeIcon:n,calc:r}=e,a=e.fontSizeSM;return(0,g.mergeToken)(e,{tagFontSize:a,tagLineHeight:(0,s.unit)(r(e.lineHeightSM).mul(a).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},f=e=>({defaultBg:new d.FastColor(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText}),b=(0,p.genStyleHooks)("Tag",e=>(e=>{let{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:a,calc:l}=e,o=l(r).sub(n).equal(),i=l(t).sub(n).equal();return{[a]:Object.assign(Object.assign({},(0,u.resetComponent)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:o,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,s.unit)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${a}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${a}-close-icon`]:{marginInlineStart:i,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${a}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${a}-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"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:o}}),[`${a}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}})(m(e)),f);var h=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let $=t.forwardRef((e,r)=>{let{prefixCls:a,style:l,className:o,checked:i,children:s,icon:d,onChange:u,onClick:p}=e,g=h(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:m,tag:f}=t.useContext(c.ConfigContext),$=m("tag",a),[v,C,y]=b($),k=(0,n.default)($,`${$}-checkable`,{[`${$}-checkable-checked`]:i},null==f?void 0:f.className,o,C,y);return v(t.createElement("span",Object.assign({},g,{ref:r,style:Object.assign(Object.assign({},l),null==f?void 0:f.style),className:k,onClick:e=>{null==u||u(!i),null==p||p(e)}}),d,t.createElement("span",null,s)))});var v=e.i(403541);let C=(0,p.genSubStyleComponent)(["Tag","preset"],e=>{let t;return t=m(e),(0,v.genPresetColor)(t,(e,{textColor:n,lightBorderColor:r,lightColor:a,darkColor:l})=>({[`${t.componentCls}${t.componentCls}-${e}`]:{color:n,background:a,borderColor:r,"&-inverse":{color:t.colorTextLightSolid,background:l,borderColor:l},[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}))},f),y=(e,t,n)=>{let r="string"!=typeof n?n:n.charAt(0).toUpperCase()+n.slice(1);return{[`${e.componentCls}${e.componentCls}-${t}`]:{color:e[`color${n}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},k=(0,p.genSubStyleComponent)(["Tag","status"],e=>{let t=m(e);return[y(t,"success","Success"),y(t,"processing","Info"),y(t,"error","Error"),y(t,"warning","Warning")]},f);var S=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 a=0,r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let w=t.forwardRef((e,s)=>{let{prefixCls:d,className:u,rootClassName:p,style:g,children:m,icon:f,color:h,onClose:$,bordered:v=!0,visible:y}=e,w=S(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:x,direction:O,tag:I}=t.useContext(c.ConfigContext),[E,N]=t.useState(!0),j=(0,r.default)(w,["closeIcon","closable"]);t.useEffect(()=>{void 0!==y&&N(y)},[y]);let P=(0,a.isPresetColor)(h),z=(0,a.isPresetStatusColor)(h),T=P||z,R=Object.assign(Object.assign({backgroundColor:h&&!T?h:void 0},null==I?void 0:I.style),g),M=x("tag",d),[q,H,B]=b(M),D=(0,n.default)(M,null==I?void 0:I.className,{[`${M}-${h}`]:T,[`${M}-has-color`]:h&&!T,[`${M}-hidden`]:!E,[`${M}-rtl`]:"rtl"===O,[`${M}-borderless`]:!v},u,p,H,B),L=e=>{e.stopPropagation(),null==$||$(e),e.defaultPrevented||N(!1)},[,G]=(0,l.useClosable)((0,l.pickClosable)(e),(0,l.pickClosable)(I),{closable:!1,closeIconRender:e=>{let r=t.createElement("span",{className:`${M}-close-icon`,onClick:L},e);return(0,o.replaceElement)(e,r,e=>({onClick:t=>{var n;null==(n=null==e?void 0:e.onClick)||n.call(e,t),L(t)},className:(0,n.default)(null==e?void 0:e.className,`${M}-close-icon`)}))}}),A="function"==typeof w.onClick||m&&"a"===m.type,W=f||null,F=W?t.createElement(t.Fragment,null,W,m&&t.createElement("span",null,m)):m,X=t.createElement("span",Object.assign({},j,{ref:s,className:D,style:R}),F,G,P&&t.createElement(C,{key:"preset",prefixCls:M}),z&&t.createElement(k,{key:"status",prefixCls:M}));return q(A?t.createElement(i.default,{component:"Tag"},X):X)});w.CheckableTag=$,e.s(["Tag",0,w],262218)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3c2d67ecf9619f2b.js b/litellm/proxy/_experimental/out/_next/static/chunks/3c2d67ecf9619f2b.js
new file mode 100644
index 0000000000..35fea2a91b
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/3c2d67ecf9619f2b.js
@@ -0,0 +1 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,105278,e=>{"use strict";var t=e.i(843476),s=e.i(135214),r=e.i(994388),i=e.i(366283),l=e.i(304967),n=e.i(269200),a=e.i(942232),o=e.i(977572),c=e.i(427612),d=e.i(64848),u=e.i(496020),p=e.i(560445),m=e.i(464571),g=e.i(808613),_=e.i(311451),h=e.i(212931),x=e.i(770914),f=e.i(653496),y=e.i(898586),j=e.i(271645),v=e.i(844444),S=e.i(700514),b=e.i(727749),I=e.i(764205),w=e.i(629569),T=e.i(599724),C=e.i(350967),k=e.i(779241),E=e.i(114600),N=e.i(237016),O=e.i(596239),F=e.i(438957),A=e.i(166406),P=e.i(270377),M=e.i(475647),B=e.i(190702);let U=({accessToken:e,userID:s,proxySettings:n})=>{let[a]=g.Form.useForm(),[o,c]=(0,j.useState)(!1),[d,u]=(0,j.useState)(null),[p,m]=(0,j.useState)("");(0,j.useEffect)(()=>{let e="";m(e=n&&n.PROXY_BASE_URL&&void 0!==n.PROXY_BASE_URL?n.PROXY_BASE_URL:window.location.origin)},[n]);let _=`${p}/scim/v2`,h=async t=>{if(!e||!s)return void b.default.fromBackend("You need to be logged in to create a SCIM token");try{c(!0);let r={key_alias:t.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},i=await (0,I.keyCreateCall)(e,s,r);u(i),b.default.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),b.default.fromBackend("Failed to create SCIM token: "+(0,B.parseErrorMessage)(e))}finally{c(!1)}};return(0,t.jsx)(C.Grid,{numItems:1,children:(0,t.jsxs)(l.Card,{children:[(0,t.jsx)("div",{className:"flex items-center mb-4",children:(0,t.jsx)(w.Title,{children:"SCIM Configuration"})}),(0,t.jsx)(T.Text,{className:"text-gray-600",children:"System for Cross-domain Identity Management (SCIM) allows you to automatically provision and manage users and groups in LiteLLM."}),(0,t.jsx)(E.Divider,{}),(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center mb-2",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"1"}),(0,t.jsxs)(w.Title,{className:"text-lg flex items-center",children:[(0,t.jsx)(O.LinkOutlined,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,t.jsx)(T.Text,{className:"text-gray-600 mb-3",children:"Use this URL in your identity provider SCIM integration settings."}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(k.TextInput,{value:_,disabled:!0,className:"flex-grow"}),(0,t.jsx)(N.CopyToClipboard,{text:_,onCopy:()=>b.default.success("URL copied to clipboard"),children:(0,t.jsxs)(r.Button,{variant:"primary",className:"ml-2 flex items-center",children:[(0,t.jsx)(A.CopyOutlined,{className:"h-4 w-4 mr-1"}),"Copy"]})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center mb-2",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"2"}),(0,t.jsxs)(w.Title,{className:"text-lg flex items-center",children:[(0,t.jsx)(F.KeyOutlined,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,t.jsx)(i.Callout,{title:"Using SCIM",color:"blue",className:"mb-4",children:"You need a SCIM token to authenticate with the SCIM API. Create one below and use it in your SCIM provider configuration."}),d?(0,t.jsxs)(l.Card,{className:"border border-yellow-300 bg-yellow-50",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 text-yellow-800",children:[(0,t.jsx)(P.ExclamationCircleOutlined,{className:"h-5 w-5 mr-2"}),(0,t.jsx)(w.Title,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,t.jsx)(T.Text,{className:"text-yellow-800 mb-4 font-medium",children:"Make sure to copy this token now. You will not be able to see it again."}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(k.TextInput,{value:d.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,t.jsx)(N.CopyToClipboard,{text:d.key,onCopy:()=>b.default.success("Token copied to clipboard"),children:(0,t.jsxs)(r.Button,{variant:"primary",className:"flex items-center",children:[(0,t.jsx)(A.CopyOutlined,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,t.jsxs)(r.Button,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>u(null),children:[(0,t.jsx)(M.PlusCircleOutlined,{className:"h-4 w-4 mr-1"}),"Create Another Token"]})]}):(0,t.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,t.jsxs)(g.Form,{form:a,onFinish:h,layout:"vertical",children:[(0,t.jsx)(g.Form.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,t.jsx)(k.TextInput,{placeholder:"SCIM Access Token"})}),(0,t.jsx)(g.Form.Item,{children:(0,t.jsxs)(r.Button,{variant:"primary",type:"submit",loading:o,className:"flex items-center",children:[(0,t.jsx)(F.KeyOutlined,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})};var L=e.i(153472),R=e.i(954616),z=e.i(912598);let D=async(e,t)=>{let s=(0,I.getProxyBaseUrl)(),r=s?`${s}/config/update`:"/config/update",i=await fetch(r,{method:"POST",headers:{[(0,I.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({general_settings:{store_prompts_in_spend_logs:t.store_prompts_in_spend_logs,...t.maximum_spend_logs_retention_period&&{maximum_spend_logs_retention_period:t.maximum_spend_logs_retention_period}}})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message||e?.message||e?.detail||"Failed to update spend logs settings")}return await i.json()};var G=e.i(637235),V=e.i(175712),q=e.i(981339),H=e.i(790848);let K=()=>{let[e]=g.Form.useForm(),{mutate:r,isPending:i}=(()=>{let{accessToken:e}=(0,s.default)(),t=(0,z.useQueryClient)();return(0,R.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return await D(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:L.proxyConfigKeys.all})}})})(),{mutate:l,isPending:n}=(0,L.useDeleteProxyConfigField)(),{data:a,isLoading:o}=(0,L.useProxyConfig)(L.ConfigType.GENERAL_SETTINGS),c=g.Form.useWatch("store_prompts_in_spend_logs",e),d=(0,j.useMemo)(()=>{if(!a)return{store_prompts_in_spend_logs:!1,maximum_spend_logs_retention_period:void 0};let e=a.find(e=>"store_prompts_in_spend_logs"===e.field_name),t=a.find(e=>"maximum_spend_logs_retention_period"===e.field_name);return{store_prompts_in_spend_logs:e?.field_value??!1,maximum_spend_logs_retention_period:t?.field_value??void 0}},[a]);return(0,t.jsx)(V.Card,{title:"Logging Settings",children:(0,t.jsxs)(x.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[(0,t.jsx)(y.Typography.Paragraph,{style:{marginBottom:0},type:"secondary",children:"Proxy-wide settings that control how request and response data are written to spend logs."}),(0,t.jsxs)(g.Form,{form:e,layout:"vertical",onFinish:e=>{let t=e.maximum_spend_logs_retention_period,s="string"==typeof t&&""!==t.trim(),i={store_prompts_in_spend_logs:e.store_prompts_in_spend_logs,...s&&{maximum_spend_logs_retention_period:t}},n=()=>r(i,{onSuccess:()=>b.default.success("Spend logs settings updated successfully"),onError:e=>b.default.fromBackend("Failed to save spend logs settings: "+(0,B.parseErrorMessage)(e))});s?n():l({config_type:L.ConfigType.GENERAL_SETTINGS,field_name:L.GeneralSettingsFieldName.MAXIMUM_SPEND_LOGS_RETENTION_PERIOD},{onError:e=>console.warn("Failed to delete retention period field (may not exist):",e),onSettled:n})},initialValues:d,children:[(0,t.jsx)(g.Form.Item,{label:"Store Prompts in Spend Logs",name:"store_prompts_in_spend_logs",tooltip:a?.find(e=>"store_prompts_in_spend_logs"===e.field_name)?.field_description||"When enabled, prompts will be stored in spend logs for tracking and analysis purposes.",valuePropName:"checked",children:o?(0,t.jsx)(q.Skeleton.Input,{active:!0,block:!0}):(0,t.jsx)(H.Switch,{checked:c??!1,onChange:t=>e.setFieldValue("store_prompts_in_spend_logs",t)})}),(0,t.jsx)(g.Form.Item,{label:"Maximum Spend Logs Retention Period (Optional)",name:"maximum_spend_logs_retention_period",tooltip:a?.find(e=>"maximum_spend_logs_retention_period"===e.field_name)?.field_description||"Set the maximum retention period for spend logs (e.g., '7d' for 7 days, '30d' for 30 days). Leave empty for no limit.",children:o?(0,t.jsx)(q.Skeleton.Input,{active:!0,block:!0}):(0,t.jsx)(_.Input,{placeholder:"e.g., 7d, 30d",prefix:(0,t.jsx)(G.ClockCircleOutlined,{})})}),(0,t.jsx)(g.Form.Item,{children:(0,t.jsx)(m.Button,{type:"primary",htmlType:"submit",loading:i||n,disabled:o,children:i||n?"Saving...":"Save Settings"})})]},a?JSON.stringify(d):"loading")]})})};var $=e.i(266027),Q=e.i(243652);let W=(0,Q.createQueryKeys)("sso"),Y=()=>{let{accessToken:e,userId:t,userRole:r}=(0,s.default)();return(0,$.useQuery)({queryKey:W.detail("settings"),queryFn:async()=>await (0,I.getSSOSettings)(e),enabled:!!(e&&t&&r)})};var J=e.i(869216),Z=e.i(262218),X=e.i(688511),ee=e.i(98919),et=e.i(727612);let es={google:"https://artificialanalysis.ai/img/logos/google_small.svg",microsoft:"https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg",okta:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",generic:""},er={google:"Google SSO",microsoft:"Microsoft SSO",okta:"Okta / Auth0 SSO",generic:"Generic SSO"},ei={internal_user_viewer:"Internal Viewer",internal_user:"Internal User",proxy_admin_viewer:"Proxy Admin Viewer",proxy_admin:"Proxy Admin"};var el=e.i(536916),en=e.i(199133);let ea={google:{envVarMap:{google_client_id:"GOOGLE_CLIENT_ID",google_client_secret:"GOOGLE_CLIENT_SECRET"},fields:[{label:"Google Client ID",name:"google_client_id"},{label:"Google Client Secret",name:"google_client_secret"}]},microsoft:{envVarMap:{microsoft_client_id:"MICROSOFT_CLIENT_ID",microsoft_client_secret:"MICROSOFT_CLIENT_SECRET",microsoft_tenant:"MICROSOFT_TENANT"},fields:[{label:"Microsoft Client ID",name:"microsoft_client_id"},{label:"Microsoft Client Secret",name:"microsoft_client_secret"},{label:"Microsoft Tenant",name:"microsoft_tenant"}]},okta:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"Generic Client ID",name:"generic_client_id"},{label:"Generic Client Secret",name:"generic_client_secret"},{label:"Authorization Endpoint",name:"generic_authorization_endpoint",placeholder:"https://your-domain/authorize"},{label:"Token Endpoint",name:"generic_token_endpoint",placeholder:"https://your-domain/token"},{label:"Userinfo Endpoint",name:"generic_userinfo_endpoint",placeholder:"https://your-domain/userinfo"}]},generic:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"Generic Client ID",name:"generic_client_id"},{label:"Generic Client Secret",name:"generic_client_secret"},{label:"Authorization Endpoint",name:"generic_authorization_endpoint"},{label:"Token Endpoint",name:"generic_token_endpoint"},{label:"Userinfo Endpoint",name:"generic_userinfo_endpoint"}]}},eo=({form:e,onFormSubmit:s})=>(0,t.jsx)("div",{children:(0,t.jsxs)(g.Form,{form:e,onFinish:s,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsx)(g.Form.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,t.jsx)(en.Select,{children:Object.entries(es).map(([e,s])=>(0,t.jsx)(en.Select.Option,{value:e,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[s&&(0,t.jsx)("img",{src:s,alt:e,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,t.jsx)("span",{children:er[e]||e.charAt(0).toUpperCase()+e.slice(1)+" SSO"})]})},e))})}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s,r=e("sso_provider");return r&&(s=ea[r])?s.fields.map(e=>(0,t.jsx)(g.Form.Item,{label:e.label,name:e.name,rules:[{required:!0,message:`Please enter the ${e.label.toLowerCase()}`}],children:e.name.includes("client")?(0,t.jsx)(_.Input.Password,{}):(0,t.jsx)(k.TextInput,{placeholder:e.placeholder})},e.name)):null}}),(0,t.jsx)(g.Form.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Proxy Base URL",name:"proxy_base_url",normalize:e=>e?.trim(),rules:[{required:!0,message:"Please enter the proxy base url"},{pattern:/^https?:\/\/.+/,message:"URL must start with http:// or https://"},{validator:(e,t)=>t&&/^https?:\/\/.+/.test(t)&&t.endsWith("/")?Promise.reject("URL must not end with a trailing slash"):Promise.resolve()}],children:(0,t.jsx)(k.TextInput,{placeholder:"https://example.com"})}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s=e("sso_provider");return"okta"===s||"generic"===s?(0,t.jsx)(g.Form.Item,{label:"Use Role Mappings",name:"use_role_mappings",valuePropName:"checked",children:(0,t.jsx)(el.Checkbox,{})}):null}}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.use_role_mappings!==t.use_role_mappings||e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s=e("use_role_mappings"),r=e("sso_provider");return s&&("okta"===r||"generic"===r)?(0,t.jsx)(g.Form.Item,{label:"Group Claim",name:"group_claim",rules:[{required:!0,message:"Please enter the group claim"}],children:(0,t.jsx)(k.TextInput,{})}):null}}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.use_role_mappings!==t.use_role_mappings||e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s=e("use_role_mappings"),r=e("sso_provider");return s&&("okta"===r||"generic"===r)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Form.Item,{label:"Default Role",name:"default_role",initialValue:"Internal User",children:(0,t.jsxs)(en.Select,{children:[(0,t.jsx)(en.Select.Option,{value:"internal_user_viewer",children:"Internal Viewer"}),(0,t.jsx)(en.Select.Option,{value:"internal_user",children:"Internal User"}),(0,t.jsx)(en.Select.Option,{value:"proxy_admin_viewer",children:"Admin Viewer"}),(0,t.jsx)(en.Select.Option,{value:"proxy_admin",children:"Proxy Admin"})]})}),(0,t.jsx)(g.Form.Item,{label:"Proxy Admin Teams",name:"proxy_admin_teams",children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Admin Viewer Teams",name:"admin_viewer_teams",children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Internal User Teams",name:"internal_user_teams",children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Internal Viewer Teams",name:"internal_viewer_teams",children:(0,t.jsx)(k.TextInput,{})})]}):null}}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s=e("sso_provider");return"okta"===s||"generic"===s?(0,t.jsx)(g.Form.Item,{label:"Use Team Mappings",name:"use_team_mappings",valuePropName:"checked",children:(0,t.jsx)(el.Checkbox,{})}):null}}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.use_team_mappings!==t.use_team_mappings||e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s=e("use_team_mappings"),r=e("sso_provider");return s&&("okta"===r||"generic"===r)?(0,t.jsx)(g.Form.Item,{label:"Team IDs JWT Field",name:"team_ids_jwt_field",rules:[{required:!0,message:"Please enter the team IDs JWT field"}],children:(0,t.jsx)(k.TextInput,{})}):null}})]})}),ec=()=>{let{accessToken:e}=(0,s.default)();return(0,R.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return await (0,I.updateSSOSettings)(e,t)}})},ed=e=>{let{proxy_admin_teams:t,admin_viewer_teams:s,internal_user_teams:r,internal_viewer_teams:i,default_role:l,group_claim:n,use_role_mappings:a,use_team_mappings:o,team_ids_jwt_field:c,...d}=e,u={...d},p=d.sso_provider;if(a&&("okta"===p||"generic"===p)){let e=e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>e.length>0):[];u.role_mappings={provider:"generic",group_claim:n,default_role:({internal_user_viewer:"internal_user_viewer",internal_user:"internal_user",proxy_admin_viewer:"proxy_admin_viewer",proxy_admin:"proxy_admin"})[l]||"internal_user",roles:{proxy_admin:e(t),proxy_admin_viewer:e(s),internal_user:e(r),internal_user_viewer:e(i)}}}return o&&("okta"===p||"generic"===p)&&(u.team_mappings={team_ids_jwt_field:c}),u},eu=e=>e.google_client_id?"google":e.microsoft_client_id?"microsoft":e.generic_client_id?e.generic_authorization_endpoint?.includes("okta")||e.generic_authorization_endpoint?.includes("auth0")?"okta":"generic":null,ep=({isVisible:e,onCancel:s,onSuccess:r})=>{let[i]=g.Form.useForm(),{mutateAsync:l,isPending:n}=ec(),a=async e=>{let t=ed(e);await l(t,{onSuccess:()=>{b.default.success("SSO settings added successfully"),r()},onError:e=>{b.default.fromBackend("Failed to save SSO settings: "+(0,B.parseErrorMessage)(e))}})},o=()=>{i.resetFields(),s()};return(0,t.jsx)(h.Modal,{title:"Add SSO",open:e,width:800,footer:(0,t.jsxs)(x.Space,{children:[(0,t.jsx)(m.Button,{onClick:o,disabled:n,children:"Cancel"}),(0,t.jsx)(m.Button,{loading:n,onClick:()=>i.submit(),children:n?"Adding...":"Add SSO"})]}),onCancel:o,children:(0,t.jsx)(eo,{form:i,onFormSubmit:a})})};var em=e.i(127952);let eg=({isVisible:e,onCancel:s,onSuccess:r})=>{let{data:i}=Y(),{mutateAsync:l,isPending:n}=ec(),a=async()=>{await l({google_client_id:null,google_client_secret:null,microsoft_client_id:null,microsoft_client_secret:null,microsoft_tenant:null,generic_client_id:null,generic_client_secret:null,generic_authorization_endpoint:null,generic_token_endpoint:null,generic_userinfo_endpoint:null,proxy_base_url:null,user_email:null,sso_provider:null,role_mappings:null,team_mappings:null},{onSuccess:()=>{b.default.success("SSO settings cleared successfully"),s(),r()},onError:e=>{b.default.fromBackend("Failed to clear SSO settings: "+(0,B.parseErrorMessage)(e))}})};return(0,t.jsx)(em.default,{isOpen:e,title:"Confirm Clear SSO Settings",alertMessage:"This action cannot be undone.",message:"Are you sure you want to clear all SSO settings? Users will no longer be able to login using SSO after this change.",resourceInformationTitle:"SSO Settings",resourceInformation:[{label:"Provider",value:i?.values&&eu(i?.values)||"Generic"}],onCancel:s,onOk:a,confirmLoading:n})},e_=({isVisible:e,onCancel:s,onSuccess:r})=>{let[i]=g.Form.useForm(),l=Y(),{mutateAsync:n,isPending:a}=ec();(0,j.useEffect)(()=>{if(e&&l.data&&l.data.values){let e=l.data;console.log("Raw SSO data received:",e),console.log("SSO values:",e.values),console.log("user_email from API:",e.values.user_email);let t=null;e.values.google_client_id?t="google":e.values.microsoft_client_id?t="microsoft":e.values.generic_client_id&&(t=e.values.generic_authorization_endpoint?.includes("okta")||e.values.generic_authorization_endpoint?.includes("auth0")?"okta":"generic");let s={};if(e.values.role_mappings){let t=e.values.role_mappings,r=e=>e&&0!==e.length?e.join(", "):"";s={use_role_mappings:!0,group_claim:t.group_claim,default_role:t.default_role||"internal_user",proxy_admin_teams:r(t.roles?.proxy_admin),admin_viewer_teams:r(t.roles?.proxy_admin_viewer),internal_user_teams:r(t.roles?.internal_user),internal_viewer_teams:r(t.roles?.internal_user_viewer)}}let r={};e.values.team_mappings&&(r={use_team_mappings:!0,team_ids_jwt_field:e.values.team_mappings.team_ids_jwt_field});let n={sso_provider:t,...e.values,...s,...r};console.log("Setting form values:",n),i.resetFields(),setTimeout(()=>{i.setFieldsValue(n),console.log("Form values set, current form values:",i.getFieldsValue())},100)}},[e,l.data,i]);let o=async e=>{try{let t=ed(e);await n(t,{onSuccess:()=>{b.default.success("SSO settings updated successfully"),r()},onError:e=>{b.default.fromBackend("Failed to save SSO settings: "+(0,B.parseErrorMessage)(e))}})}catch(e){b.default.fromBackend("Failed to process SSO settings: "+(0,B.parseErrorMessage)(e))}},c=()=>{i.resetFields(),s()};return(0,t.jsx)(h.Modal,{title:"Edit SSO Settings",open:e,width:800,footer:(0,t.jsxs)(x.Space,{children:[(0,t.jsx)(m.Button,{onClick:c,disabled:a,children:"Cancel"}),(0,t.jsx)(m.Button,{loading:a,onClick:()=>i.submit(),children:a?"Saving...":"Save"})]}),onCancel:c,children:(0,t.jsx)(eo,{form:i,onFormSubmit:o})})};var eh=e.i(286536),ex=e.i(77705);function ef({defaultHidden:e=!0,value:s}){let[r,i]=(0,j.useState)(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-gray-600 flex-1",children:s?r?"•".repeat(s.length):s:(0,t.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})}),s&&(0,t.jsx)(m.Button,{type:"text",size:"small",icon:r?(0,t.jsx)(eh.Eye,{className:"w-4 h-4"}):(0,t.jsx)(ex.EyeOff,{className:"w-4 h-4"}),onClick:()=>i(!r),className:"text-gray-400 hover:text-gray-600"})]})}var ey=e.i(312361),ej=e.i(291542),ev=e.i(761911);let{Title:eS,Text:eb}=y.Typography;function eI({roleMappings:e}){if(!e)return null;let s=[{title:"Role",dataIndex:"role",key:"role",render:e=>(0,t.jsx)(eb,{strong:!0,children:ei[e]})},{title:"Mapped Groups",dataIndex:"groups",key:"groups",render:e=>(0,t.jsx)(t.Fragment,{children:e.length>0?e.map((e,s)=>(0,t.jsx)(Z.Tag,{color:"blue",children:e},s)):(0,t.jsx)(eb,{className:"text-gray-400 italic",children:"No groups mapped"})})}];return(0,t.jsxs)(V.Card,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(ev.Users,{className:"w-6 h-6 text-gray-400 mb-2"}),(0,t.jsx)(eS,{level:3,children:"Role Mappings"})]}),(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eS,{level:5,children:"Group Claim"}),(0,t.jsx)("div",{children:(0,t.jsx)(eb,{code:!0,children:e.group_claim})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eS,{level:5,children:"Default Role"}),(0,t.jsx)("div",{children:(0,t.jsx)(eb,{strong:!0,children:ei[e.default_role]})})]})]}),(0,t.jsx)(ey.Divider,{}),(0,t.jsx)(ej.Table,{columns:s,dataSource:Object.entries(e.roles).map(([e,t])=>({role:e,groups:t})),pagination:!1,bordered:!0,size:"small",className:"w-full"})]})]})}var ew=e.i(21548);let{Title:eT,Paragraph:eC}=y.Typography;function ek({onAdd:e}){return(0,t.jsx)("div",{className:"bg-white p-12 rounded-lg border border-dashed border-gray-300 text-center w-full",children:(0,t.jsx)(ew.Empty,{image:ew.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(eT,{level:4,children:"No SSO Configuration Found"}),(0,t.jsx)(eC,{type:"secondary",className:"max-w-md mx-auto",children:"Configure Single Sign-On (SSO) to enable seamless authentication for your team members using your identity provider."})]}),children:(0,t.jsx)(m.Button,{type:"primary",size:"large",onClick:e,className:"flex items-center gap-2 mx-auto mt-4",children:"Configure SSO"})})})}let{Title:eE,Text:eN}=y.Typography;function eO(){return(0,t.jsx)(V.Card,{children:(0,t.jsxs)(x.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(ee.Shield,{className:"w-6 h-6 text-gray-400"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eE,{level:3,children:"SSO Configuration"}),(0,t.jsx)(eN,{type:"secondary",children:"Manage Single Sign-On authentication settings"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(q.Skeleton.Button,{active:!0,size:"default",style:{width:170,height:32}}),(0,t.jsx)(q.Skeleton.Button,{active:!0,size:"default",style:{width:190,height:32}})]})]}),(0,t.jsxs)(J.Descriptions,{bordered:!0,...{column:{xxl:1,xl:1,lg:1,md:1,sm:1,xs:1}},children:[(0,t.jsx)(J.Descriptions.Item,{label:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:80,height:16}}),children:(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:100,height:16}})})}),(0,t.jsx)(J.Descriptions.Item,{label:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:80,height:16}}),children:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:200,height:16}})}),(0,t.jsx)(J.Descriptions.Item,{label:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:80,height:16}}),children:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:250,height:16}})}),(0,t.jsx)(J.Descriptions.Item,{label:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:80,height:16}}),children:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:180,height:16}})}),(0,t.jsx)(J.Descriptions.Item,{label:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:80,height:16}}),children:(0,t.jsx)(q.Skeleton.Node,{active:!0,style:{width:220,height:16}})})]})]})})}let{Title:eF,Text:eA}=y.Typography;function eP(){let{data:e,refetch:s,isLoading:r}=Y(),[i,l]=(0,j.useState)(!1),[n,a]=(0,j.useState)(!1),[o,c]=(0,j.useState)(!1),d=!!e?.values.google_client_id||!!e?.values.microsoft_client_id||!!e?.values.generic_client_id,u=e?.values?eu(e.values):null,p=!!e?.values.role_mappings,g=!!e?.values.team_mappings,_=e=>(0,t.jsx)(eA,{className:"font-mono text-gray-600 text-sm",copyable:!!e,children:e||"-"}),h=e=>e||(0,t.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"}),f=e=>e.team_mappings?.team_ids_jwt_field?(0,t.jsx)(Z.Tag,{children:e.team_mappings.team_ids_jwt_field}):(0,t.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"}),y={column:{xxl:1,xl:1,lg:1,md:1,sm:1,xs:1}},v={google:{providerText:er.google,fields:[{label:"Client ID",render:e=>(0,t.jsx)(ef,{value:e.google_client_id})},{label:"Client Secret",render:e=>(0,t.jsx)(ef,{value:e.google_client_secret})},{label:"Proxy Base URL",render:e=>h(e.proxy_base_url)}]},microsoft:{providerText:er.microsoft,fields:[{label:"Client ID",render:e=>(0,t.jsx)(ef,{value:e.microsoft_client_id})},{label:"Client Secret",render:e=>(0,t.jsx)(ef,{value:e.microsoft_client_secret})},{label:"Tenant",render:e=>h(e.microsoft_tenant)},{label:"Proxy Base URL",render:e=>h(e.proxy_base_url)}]},okta:{providerText:er.okta,fields:[{label:"Client ID",render:e=>(0,t.jsx)(ef,{value:e.generic_client_id})},{label:"Client Secret",render:e=>(0,t.jsx)(ef,{value:e.generic_client_secret})},{label:"Authorization Endpoint",render:e=>_(e.generic_authorization_endpoint)},{label:"Token Endpoint",render:e=>_(e.generic_token_endpoint)},{label:"User Info Endpoint",render:e=>_(e.generic_userinfo_endpoint)},{label:"Proxy Base URL",render:e=>h(e.proxy_base_url)},g?{label:"Team IDs JWT Field",render:e=>f(e)}:null]},generic:{providerText:er.generic,fields:[{label:"Client ID",render:e=>(0,t.jsx)(ef,{value:e.generic_client_id})},{label:"Client Secret",render:e=>(0,t.jsx)(ef,{value:e.generic_client_secret})},{label:"Authorization Endpoint",render:e=>_(e.generic_authorization_endpoint)},{label:"Token Endpoint",render:e=>_(e.generic_token_endpoint)},{label:"User Info Endpoint",render:e=>_(e.generic_userinfo_endpoint)},{label:"Proxy Base URL",render:e=>h(e.proxy_base_url)},g?{label:"Team IDs JWT Field",render:e=>f(e)}:null]}};return(0,t.jsxs)(t.Fragment,{children:[r?(0,t.jsx)(eO,{}):(0,t.jsxs)(x.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(V.Card,{children:(0,t.jsxs)(x.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(ee.Shield,{className:"w-6 h-6 text-gray-400"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eF,{level:3,children:"SSO Configuration"}),(0,t.jsx)(eA,{type:"secondary",children:"Manage Single Sign-On authentication settings"})]})]}),(0,t.jsx)("div",{className:"flex items-center gap-3",children:d&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Button,{icon:(0,t.jsx)(X.Edit,{className:"w-4 h-4"}),onClick:()=>c(!0),children:"Edit SSO Settings"}),(0,t.jsx)(m.Button,{danger:!0,icon:(0,t.jsx)(et.Trash2,{className:"w-4 h-4"}),onClick:()=>l(!0),children:"Delete SSO Settings"})]})})]}),d?(()=>{if(!e?.values||!u)return null;let{values:s}=e,r=v[u];return r?(0,t.jsxs)(J.Descriptions,{bordered:!0,...y,children:[(0,t.jsx)(J.Descriptions.Item,{label:"Provider",children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[es[u]&&(0,t.jsx)("img",{src:es[u],alt:u,style:{height:24,width:24,objectFit:"contain"}}),(0,t.jsx)("span",{children:r.providerText})]})}),r.fields.map((e,r)=>e&&(0,t.jsx)(J.Descriptions.Item,{label:e.label,children:e.render(s)},r))]}):null})():(0,t.jsx)(ek,{onAdd:()=>a(!0)})]})}),p&&(0,t.jsx)(eI,{roleMappings:e?.values.role_mappings})]}),(0,t.jsx)(eg,{isVisible:i,onCancel:()=>l(!1),onSuccess:()=>s()}),(0,t.jsx)(ep,{isVisible:n,onCancel:()=>a(!1),onSuccess:()=>{a(!1),s()}}),(0,t.jsx)(e_,{isVisible:o,onCancel:()=>c(!1),onSuccess:()=>{c(!1),s()}})]})}var eM=e.i(292639);let eB=(0,Q.createQueryKeys)("uiSettings");var eU=e.i(111672);let eL={"api-keys":"Manage virtual keys for API access and authentication","llm-playground":"Interactive playground for testing LLM requests",models:"Configure and manage LLM models and endpoints",agents:"Create and manage AI agents",agentic:"Manage agentic resources: agents, workflow runs, and memory",workflows:"Track and inspect durable workflow run history","mcp-servers":"Configure Model Context Protocol servers",memory:"Inspect and manage agent memory entries stored under /v1/memory",guardrails:"Set up content moderation and safety guardrails",policies:"Define access control and usage policies","search-tools":"Configure RAG search and retrieval tools","tool-policies":"Configure tool use policies and permissions","vector-stores":"Manage vector databases for embeddings",new_usage:"View usage analytics and metrics",logs:"Access request and response logs","guardrails-monitor":"Monitor guardrail performance and view logs",users:"Manage internal user accounts and permissions",teams:"Create and manage teams for access control",organizations:"Manage organizations and their members",projects:"Manage projects within teams","access-groups":"Manage access groups for role-based permissions",budgets:"Set and monitor spending budgets","api-reference":"Browse API documentation and endpoints","model-hub-table":"Explore available AI models and providers","learning-resources":"Access tutorials and documentation",caching:"Configure response caching settings","transform-request":"Set up request transformation rules","cost-tracking":"Track and analyze API costs","ui-theme":"Customize dashboard appearance","tag-management":"Organize resources with tags",prompts:"Manage and version prompt templates",skills:"Browse and manage Claude Code skills",usage:"View legacy usage dashboard","router-settings":"Configure routing and load balancing settings","logging-and-alerts":"Set up logging and alert configurations","admin-panel":"Access admin panel and settings"};var eR=e.i(708347);let ez=e=>!e||0===e.length||e.some(e=>eR.internalUserRoles.includes(e));var eD=e.i(362024);function eG({enabledPagesInternalUsers:e,enabledPagesPropertyDescription:s,isUpdating:r,onUpdate:i}){let l=null!=e,n=(0,j.useMemo)(()=>{let e;return e=[],eU.menuGroups.forEach(t=>{t.items.forEach(s=>{if(s.page&&"tools"!==s.page&&"experimental"!==s.page&&"settings"!==s.page&&ez(s.roles)){let r="string"==typeof s.label?s.label:s.key;e.push({page:s.page,label:r,group:t.groupLabel,description:eL[s.page]||"No description available"})}if(s.children){let r="string"==typeof s.label?s.label:s.key;s.children.forEach(s=>{if(ez(s.roles)){let i="string"==typeof s.label?s.label:s.key;e.push({page:s.page,label:i,group:`${t.groupLabel} > ${r}`,description:eL[s.page]||"No description available"})}})}})}),e},[]),a=(0,j.useMemo)(()=>{let e={};return n.forEach(t=>{e[t.group]||(e[t.group]=[]),e[t.group].push(t)}),e},[n]),[o,c]=(0,j.useState)(e||[]);return(0,j.useMemo)(()=>{e?c(e):c([])},[e]),(0,t.jsxs)(x.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsxs)(x.Space,{align:"center",children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Internal User Page Visibility"}),!l&&(0,t.jsx)(Z.Tag,{color:"default",style:{marginLeft:"8px"},children:"Not set (all pages visible)"}),l&&(0,t.jsxs)(Z.Tag,{color:"blue",style:{marginLeft:"8px"},children:[o.length," page",1!==o.length?"s":""," selected"]})]}),s&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:s}),(0,t.jsx)(y.Typography.Text,{type:"secondary",style:{fontSize:"12px",fontStyle:"italic"},children:"By default, all pages are visible to internal users. Select specific pages to restrict visibility."}),(0,t.jsx)(y.Typography.Text,{type:"secondary",style:{fontSize:"12px",color:"#8b5cf6"},children:"Note: Only pages accessible to internal user roles are shown here. Admin-only pages are excluded as they cannot be made visible to internal users regardless of this setting."})]}),(0,t.jsx)(eD.Collapse,{items:[{key:"page-visibility",label:"Configure Page Visibility",children:(0,t.jsxs)(x.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,t.jsx)(el.Checkbox.Group,{value:o,onChange:c,style:{width:"100%"},children:(0,t.jsx)(x.Space,{direction:"vertical",size:"middle",style:{width:"100%"},children:Object.entries(a).map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Typography.Text,{strong:!0,style:{fontSize:"11px",color:"#6b7280",letterSpacing:"0.05em",display:"block",marginBottom:"8px"},children:e}),(0,t.jsx)(x.Space,{direction:"vertical",size:"small",style:{marginLeft:"16px",width:"100%"},children:s.map(e=>(0,t.jsx)("div",{style:{marginBottom:"4px"},children:(0,t.jsx)(el.Checkbox,{value:e.page,children:(0,t.jsxs)(x.Space,{direction:"vertical",size:0,children:[(0,t.jsx)(y.Typography.Text,{children:e.label}),(0,t.jsx)(y.Typography.Text,{type:"secondary",style:{fontSize:"12px"},children:e.description})]})})},e.page))})]},e))})}),(0,t.jsxs)(x.Space,{children:[(0,t.jsx)(m.Button,{type:"primary",onClick:()=>{i({enabled_ui_pages_internal_users:o.length>0?o:null})},loading:r,disabled:r,children:"Save Page Visibility Settings"}),l&&(0,t.jsx)(m.Button,{onClick:()=>{c([]),i({enabled_ui_pages_internal_users:null})},loading:r,disabled:r,children:"Reset to Default (All Pages)"})]})]})}]})]})}function eV(){let e,{accessToken:r}=(0,s.default)(),{data:i,isLoading:l,isError:n,error:a}=(0,eM.useUISettings)(),{mutate:o,isPending:c,error:d}=(e=(0,z.useQueryClient)(),(0,R.useMutation)({mutationFn:async e=>{if(!r)throw Error("Access token is required");return(0,I.updateUiSettings)(r,e)},onSuccess:()=>{e.invalidateQueries({queryKey:eB.all})}})),u=i?.field_schema,m=u?.properties?.disable_model_add_for_internal_users,g=u?.properties?.disable_team_admin_delete_team_user,_=u?.properties?.require_auth_for_public_ai_hub,h=u?.properties?.forward_client_headers_to_llm_api,f=u?.properties?.forward_llm_provider_auth_headers,j=u?.properties?.enable_projects_ui,v=u?.properties?.enabled_ui_pages_internal_users,S=u?.properties?.disable_agents_for_internal_users,w=u?.properties?.allow_agents_for_team_admins,T=u?.properties?.disable_vector_stores_for_internal_users,C=u?.properties?.allow_vector_stores_for_team_admins,k=u?.properties?.scope_user_search_to_org,E=u?.properties?.disable_custom_api_keys,N=i?.values??{},O=!!N.disable_model_add_for_internal_users,F=!!N.disable_team_admin_delete_team_user,A=!!N.disable_agents_for_internal_users,P=!!N.disable_vector_stores_for_internal_users;return(0,t.jsx)(V.Card,{title:"UI Settings",children:l?(0,t.jsx)(q.Skeleton,{active:!0}):n?(0,t.jsx)(p.Alert,{type:"error",message:"Could not load UI settings",description:a instanceof Error?a.message:void 0}):(0,t.jsxs)(x.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[u?.description&&(0,t.jsx)(y.Typography.Paragraph,{style:{marginBottom:0},children:u.description}),d&&(0,t.jsx)(p.Alert,{type:"error",message:"Could not update UI settings",description:d instanceof Error?d.message:void 0}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:O,disabled:c,loading:c,onChange:e=>{o({disable_model_add_for_internal_users:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":m?.description??"Disable model add for internal users"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Disable model add for internal users"}),m?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:m.description})]})]}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:F,disabled:c,loading:c,onChange:e=>{o({disable_team_admin_delete_team_user:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":g?.description??"Disable team admin delete team user"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Disable team admin delete team user"}),g?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:g.description})]})]}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:N.require_auth_for_public_ai_hub,disabled:c,loading:c,onChange:e=>{o({require_auth_for_public_ai_hub:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":_?.description??"Require authentication for public AI Hub"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Require authentication for public AI Hub"}),_?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:_.description})]})]}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:!!N.forward_client_headers_to_llm_api,disabled:c,loading:c,onChange:e=>{o({forward_client_headers_to_llm_api:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":h?.description??"Forward client headers to LLM API"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Forward client headers to LLM API"}),(0,t.jsx)(y.Typography.Text,{type:"secondary",children:h?.description??"Forwards client headers (Authorization, anthropic-beta, and x-* custom headers) to the upstream LLM. Enable for Claude Code with a Max subscription (forwards the OAuth token) or to pass custom/tracing headers through to the provider. Independent of the BYOK toggle — enable only the one(s) you need."})]})]}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:!!N.forward_llm_provider_auth_headers,disabled:c,loading:c,onChange:e=>{o({forward_llm_provider_auth_headers:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":f?.description??"Forward LLM provider auth headers"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Forward LLM provider auth headers"}),(0,t.jsx)(y.Typography.Text,{type:"secondary",children:f?.description??"Forwards provider auth headers (x-api-key, x-goog-api-key, api-key, ocp-apim-subscription-key) to the upstream LLM, overriding any deployment-configured key for that request. Enable for Claude Code BYOK (clients bring their own API key). Independent of the client-headers toggle — enable only the one(s) you need."})]})]}),j&&(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:!!N.enable_projects_ui,disabled:c,loading:c,onChange:e=>{o({enable_projects_ui:e},{onSuccess:()=>{b.default.success("UI settings updated successfully. Refreshing page..."),setTimeout(()=>window.location.reload(),1e3)},onError:e=>{b.default.fromBackend(e)}})},"aria-label":j.description??"Enable Projects UI"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"[BETA] Enable Projects (page will refresh)"}),(0,t.jsx)(y.Typography.Text,{type:"secondary",children:j.description??"If enabled, shows the Projects feature in the UI sidebar and the project field in key management."})]})]}),(0,t.jsx)(ey.Divider,{}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:A,disabled:c,loading:c,onChange:e=>{o({disable_agents_for_internal_users:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":S?.description??"Disable agents for internal users"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Disable agents for internal users"}),S?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:S.description})]})]}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",style:{marginLeft:32},children:[(0,t.jsx)(H.Switch,{checked:!!N.allow_agents_for_team_admins,disabled:c||!A,loading:c,onChange:e=>{o({allow_agents_for_team_admins:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":w?.description??"Allow agents for team admins"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,type:A?void 0:"secondary",children:"Allow agents for team admins"}),w?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:w.description})]})]}),(0,t.jsx)(ey.Divider,{}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:P,disabled:c,loading:c,onChange:e=>{o({disable_vector_stores_for_internal_users:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":T?.description??"Disable vector stores for internal users"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Disable vector stores for internal users"}),T?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:T.description})]})]}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",style:{marginLeft:32},children:[(0,t.jsx)(H.Switch,{checked:!!N.allow_vector_stores_for_team_admins,disabled:c||!P,loading:c,onChange:e=>{o({allow_vector_stores_for_team_admins:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":C?.description??"Allow vector stores for team admins"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,type:P?void 0:"secondary",children:"Allow vector stores for team admins"}),C?.description&&(0,t.jsx)(y.Typography.Text,{type:"secondary",children:C.description})]})]}),(0,t.jsx)(ey.Divider,{}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:!!N.scope_user_search_to_org,disabled:c,loading:c,onChange:e=>{o({scope_user_search_to_org:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":k?.description??"Scope user search to organization"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Scope user search to organization"}),(0,t.jsx)(y.Typography.Text,{type:"secondary",children:k?.description??"If enabled, the user search endpoint restricts results by organization. When off, any authenticated user can search all users."})]})]}),(0,t.jsx)(ey.Divider,{}),(0,t.jsxs)(x.Space,{align:"start",size:"middle",children:[(0,t.jsx)(H.Switch,{checked:!!N.disable_custom_api_keys,disabled:c,loading:c,onChange:e=>{o({disable_custom_api_keys:e},{onSuccess:()=>{b.default.success("UI settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})},"aria-label":E?.description??"Disable custom Virtual key values"}),(0,t.jsxs)(x.Space,{direction:"vertical",size:4,children:[(0,t.jsx)(y.Typography.Text,{strong:!0,children:"Disable custom Virtual key values"}),(0,t.jsx)(y.Typography.Text,{type:"secondary",children:E?.description??"If true, users cannot specify custom key values. All keys must be auto-generated."})]})]}),(0,t.jsx)(ey.Divider,{}),(0,t.jsx)(eG,{enabledPagesInternalUsers:N.enabled_ui_pages_internal_users,enabledPagesPropertyDescription:v?.description,isUpdating:c,onUpdate:e=>{o(e,{onSuccess:()=>{b.default.success("Page visibility settings updated successfully")},onError:e=>{b.default.fromBackend(e)}})}})]})})}let eq=async e=>{let t=(0,I.getProxyBaseUrl)(),s=t?`${t}/config_overrides/hashicorp_vault`:"/config_overrides/hashicorp_vault",r=await fetch(s,{method:"GET",headers:{[(0,I.getGlobalLitellmHeaderName)()]:`Bearer ${e}`}});if(!r.ok){let e=await r.json();throw Error((0,I.deriveErrorMessage)(e))}return await r.json()},eH=async(e,t)=>{let s=(0,I.getProxyBaseUrl)(),r=s?`${s}/config_overrides/hashicorp_vault`:"/config_overrides/hashicorp_vault",i=await fetch(r,{method:"POST",headers:{[(0,I.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!i.ok){let e=await i.json();throw Error((0,I.deriveErrorMessage)(e))}return await i.json()},eK=async e=>{let t=(0,I.getProxyBaseUrl)(),s=t?`${t}/config_overrides/hashicorp_vault`:"/config_overrides/hashicorp_vault",r=await fetch(s,{method:"DELETE",headers:{[(0,I.getGlobalLitellmHeaderName)()]:`Bearer ${e}`}});if(!r.ok){let e=await r.json();throw Error((0,I.deriveErrorMessage)(e))}return await r.json()},e$=async e=>{let t=(0,I.getProxyBaseUrl)(),s=t?`${t}/config_overrides/hashicorp_vault/test_connection`:"/config_overrides/hashicorp_vault/test_connection",r=await fetch(s,{method:"POST",headers:{[(0,I.getGlobalLitellmHeaderName)()]:`Bearer ${e}`}});if(!r.ok){let e=await r.json();throw Error((0,I.deriveErrorMessage)(e))}return await r.json()},eQ=(0,Q.createQueryKeys)("hashicorpVaultConfig"),eW=()=>{let{accessToken:e}=(0,s.default)();return(0,$.useQuery)({queryKey:eQ.list({}),queryFn:async()=>{if(!e)throw Error("Access token is required");return eq(e)},enabled:!!e,staleTime:36e5,gcTime:36e5})},eY=e=>{let t=(0,z.useQueryClient)();return(0,R.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return eH(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:eQ.all})}})};var eJ=e.i(525720),eZ=e.i(475254);let eX=(0,eZ.default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),e0=(0,eZ.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]),e1=new Set(["vault_token","approle_secret_id","client_key"]),e4={vault_addr:"Vault Address",vault_namespace:"Namespace",vault_mount_name:"KV Mount Name",vault_path_prefix:"Path Prefix",vault_token:"Token",approle_role_id:"Role ID",approle_secret_id:"Secret ID",approle_mount_path:"Mount Path",client_cert:"Client Certificate",client_key:"Client Key",vault_cert_role:"Certificate Role"},e2=[{title:"Connection",fields:["vault_addr","vault_namespace","vault_mount_name","vault_path_prefix"]},{title:"Token Authentication",subtitle:"Use a Vault token to authenticate. Only one auth method is required.",fields:["vault_token"]},{title:"AppRole Authentication",subtitle:"Use AppRole credentials to authenticate. Only one auth method is required.",fields:["approle_role_id","approle_secret_id","approle_mount_path"]},{title:"TLS",subtitle:"Optional client certificate for mTLS.",fields:["client_cert","client_key","vault_cert_role"]}],e6=({isVisible:e,onCancel:r,onSuccess:i})=>{let[l]=g.Form.useForm(),{accessToken:n}=(0,s.default)(),{data:a}=eW(),{mutate:o,isPending:c}=eY(n),d=a?.field_schema,u=d?.properties??{},p=a?.values??{};(0,j.useEffect)(()=>{if(e&&a){l.resetFields();let e={};for(let[t,s]of Object.entries(p))e1.has(t)||(e[t]=s);l.setFieldsValue(e)}},[e,a,l]);let f=()=>{l.resetFields(),r()},v=e=>{let s=u[e];if(!s)return null;let r="vault_addr"===e?[{pattern:/^https?:\/\/.+/,message:"Must start with http:// or https://"}]:void 0,i=e1.has(e),l=p[e],n=i&&null!=l&&""!==l?`Leave blank to keep existing (${l})`:s?.description;return(0,t.jsx)(g.Form.Item,{name:e,label:e4[e]??e,rules:r,children:i?(0,t.jsx)(_.Input.Password,{placeholder:n}):(0,t.jsx)(_.Input,{placeholder:s?.description})},e)};return(0,t.jsx)(h.Modal,{title:"Edit Hashicorp Vault Configuration",open:e,width:700,footer:(0,t.jsxs)(x.Space,{children:[(0,t.jsx)(m.Button,{onClick:f,disabled:c,children:"Cancel"}),(0,t.jsx)(m.Button,{type:"primary",loading:c,onClick:()=>l.submit(),children:c?"Saving...":"Save"})]}),onCancel:f,children:(0,t.jsx)(g.Form,{form:l,layout:"vertical",onFinish:e=>{let t={};for(let[s,r]of Object.entries(e))null!=r&&""!==r?t[s]=r:e1.has(s)||(t[s]="");o(t,{onSuccess:()=>{b.default.success("Hashicorp Vault configuration updated successfully"),i()},onError:e=>{b.default.fromBackend(e)}})},children:e2.map((e,s)=>(0,t.jsxs)("div",{children:[s>0&&(0,t.jsx)(ey.Divider,{}),(0,t.jsx)(y.Typography.Title,{level:5,style:{marginBottom:4},children:e.title}),e.subtitle&&(0,t.jsx)(y.Typography.Paragraph,{type:"secondary",style:{marginBottom:16},children:e.subtitle}),e.fields.map(v)]},e.title))})})},{Title:e3,Paragraph:e5}=y.Typography;function e8({onAdd:e}){return(0,t.jsx)("div",{className:"bg-white p-12 rounded-lg border border-dashed border-gray-300 text-center w-full",children:(0,t.jsx)(ew.Empty,{image:ew.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(e3,{level:4,children:"No Vault Configuration Found"}),(0,t.jsx)(e5,{type:"secondary",className:"max-w-md mx-auto",children:"Configure Hashicorp Vault to securely manage provider API keys and secrets for your LiteLLM deployment."})]}),children:(0,t.jsx)(m.Button,{type:"primary",size:"large",onClick:e,className:"flex items-center gap-2 mx-auto mt-4",children:"Configure Vault"})})})}let{Title:e7,Text:e9}=y.Typography,te={column:{xxl:1,xl:1,lg:1,md:1,sm:1,xs:1}};function tt(){let e,{accessToken:r}=(0,s.default)(),{data:i,isLoading:l,isError:n,error:a}=eW(),{mutate:o,isPending:c}=(e=(0,z.useQueryClient)(),(0,R.useMutation)({mutationFn:async()=>{if(!r)throw Error("Access token is required");return eK(r)},onSuccess:()=>{e.invalidateQueries({queryKey:eQ.all})}})),{mutate:d,isPending:u}=eY(r),[g,_]=(0,j.useState)(!1),[h,f]=(0,j.useState)(!1),[v,S]=(0,j.useState)(null),[I,w]=(0,j.useState)(!1),T=i?.values??{},C=!!T.vault_addr,k=async()=>{if(r){w(!0);try{let e=await e$(r);b.default.success(e.message||"Connection to Vault successful!")}catch(e){b.default.fromBackend(e)}finally{w(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[l?(0,t.jsx)(V.Card,{children:(0,t.jsx)(q.Skeleton,{active:!0})}):n?(0,t.jsx)(V.Card,{children:(0,t.jsx)(p.Alert,{type:"error",message:"Could not load Hashicorp Vault configuration",description:a instanceof Error?a.message:void 0})}):(0,t.jsx)(V.Card,{children:(0,t.jsxs)(x.Space,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)(eJ.Flex,{justify:"space-between",align:"center",children:[(0,t.jsxs)(eJ.Flex,{align:"center",gap:12,children:[(0,t.jsx)(eX,{className:"w-6 h-6 text-gray-400"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(e7,{level:3,style:{marginBottom:0},children:"Hashicorp Vault"}),(0,t.jsx)(e9,{type:"secondary",children:"Manage secret manager configuration"})]})]}),(0,t.jsx)(x.Space,{children:C&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.Button,{icon:(0,t.jsx)(e0,{className:"w-4 h-4"}),loading:I,onClick:k,children:"Test Connection"}),(0,t.jsx)(m.Button,{icon:(0,t.jsx)(X.Edit,{className:"w-4 h-4"}),onClick:()=>_(!0),children:"Edit Configuration"}),(0,t.jsx)(m.Button,{danger:!0,icon:(0,t.jsx)(et.Trash2,{className:"w-4 h-4"}),onClick:()=>f(!0),children:"Delete Configuration"})]})})]}),C&&(0,t.jsx)(p.Alert,{type:"info",showIcon:!0,message:'Secrets must be stored with the field name "key"',description:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e9,{code:!0,children:"vault kv put secret/SECRET_NAME key=secret_value"}),(0,t.jsx)("br",{}),(0,t.jsx)(y.Typography.Link,{href:"https://docs.litellm.ai/docs/secret_managers/hashicorp_vault",target:"_blank",children:"View documentation"})]})}),C?(()=>{let e=Object.entries(T).filter(([e,t])=>null!=t&&""!==t);return 0===e.length?null:(0,t.jsxs)(J.Descriptions,{bordered:!0,...te,children:[(0,t.jsx)(J.Descriptions.Item,{label:"Auth Method",children:(0,t.jsx)(e9,{children:T.approle_role_id||T.approle_secret_id?"AppRole":T.client_cert&&T.client_key?"TLS Certificate":T.vault_token?"Token":"None"})}),e.map(([e])=>{let s;return(0,t.jsx)(J.Descriptions.Item,{label:e4[e]??e,children:(s=T[e])?e1.has(e)?(0,t.jsxs)(eJ.Flex,{justify:"space-between",align:"center",children:[(0,t.jsx)(e9,{className:"font-mono text-gray-600",children:s}),(0,t.jsx)(m.Button,{type:"text",size:"small",danger:!0,icon:(0,t.jsx)(et.Trash2,{className:"w-3.5 h-3.5"}),onClick:()=>S(e)})]}):(0,t.jsx)(e9,{className:"font-mono text-gray-600",children:s}):(0,t.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})},e)})]})})():(0,t.jsx)(e8,{onAdd:()=>_(!0)})]})}),(0,t.jsx)(e6,{isVisible:g,onCancel:()=>_(!1),onSuccess:()=>_(!1)}),(0,t.jsx)(em.default,{isOpen:h,title:"Delete Hashicorp Vault Configuration?",message:"Models using Vault secrets will lose access to their API keys until a new configuration is saved.",resourceInformationTitle:"Vault Configuration",resourceInformation:[{label:"Vault Address",value:T.vault_addr}],onCancel:()=>f(!1),onOk:()=>{o(void 0,{onSuccess:()=>{b.default.success("Hashicorp Vault configuration deleted"),f(!1)},onError:e=>{b.default.fromBackend(e)}})},confirmLoading:c}),(0,t.jsx)(em.default,{isOpen:null!==v,title:`Clear ${v?e4[v]??v:""}?`,message:"This will remove the stored value.",resourceInformationTitle:"Field",resourceInformation:[{label:"Field",value:v?e4[v]??v:""}],onCancel:()=>S(null),onOk:()=>{v&&d({[v]:""},{onSuccess:()=>{b.default.success(`${e4[v]??v} cleared`),S(null)},onError:e=>{b.default.fromBackend(e)}})},confirmLoading:u})]})}let ts={google:"https://artificialanalysis.ai/img/logos/google_small.svg",microsoft:"https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg",okta:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",generic:""},tr={google:{envVarMap:{google_client_id:"GOOGLE_CLIENT_ID",google_client_secret:"GOOGLE_CLIENT_SECRET"},fields:[{label:"Google Client ID",name:"google_client_id"},{label:"Google Client Secret",name:"google_client_secret"}]},microsoft:{envVarMap:{microsoft_client_id:"MICROSOFT_CLIENT_ID",microsoft_client_secret:"MICROSOFT_CLIENT_SECRET",microsoft_tenant:"MICROSOFT_TENANT"},fields:[{label:"Microsoft Client ID",name:"microsoft_client_id"},{label:"Microsoft Client Secret",name:"microsoft_client_secret"},{label:"Microsoft Tenant",name:"microsoft_tenant"}]},okta:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"Generic Client ID",name:"generic_client_id"},{label:"Generic Client Secret",name:"generic_client_secret"},{label:"Authorization Endpoint",name:"generic_authorization_endpoint",placeholder:"https://your-domain/authorize"},{label:"Token Endpoint",name:"generic_token_endpoint",placeholder:"https://your-domain/token"},{label:"Userinfo Endpoint",name:"generic_userinfo_endpoint",placeholder:"https://your-domain/userinfo"}]},generic:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"Generic Client ID",name:"generic_client_id"},{label:"Generic Client Secret",name:"generic_client_secret"},{label:"Authorization Endpoint",name:"generic_authorization_endpoint"},{label:"Token Endpoint",name:"generic_token_endpoint"},{label:"Userinfo Endpoint",name:"generic_userinfo_endpoint"}]}},ti=({isAddSSOModalVisible:e,isInstructionsModalVisible:s,handleAddSSOOk:r,handleAddSSOCancel:i,handleShowInstructions:l,handleInstructionsOk:n,handleInstructionsCancel:a,form:o,accessToken:c,ssoConfigured:d=!1})=>{let[u,p]=(0,j.useState)(!1);(0,j.useEffect)(()=>{(async()=>{if(e&&c)try{let e=await (0,I.getSSOSettings)(c);if(console.log("Raw SSO data received:",e),e&&e.values){console.log("SSO values:",e.values),console.log("user_email from API:",e.values.user_email);let t=null;e.values.google_client_id?t="google":e.values.microsoft_client_id?t="microsoft":e.values.generic_client_id&&(t=e.values.generic_authorization_endpoint?.includes("okta")||e.values.generic_authorization_endpoint?.includes("auth0")?"okta":"generic");let s={};if(e.values.role_mappings){let t=e.values.role_mappings,r=e=>e&&0!==e.length?e.join(", "):"";s={use_role_mappings:!0,group_claim:t.group_claim,default_role:t.default_role||"internal_user",proxy_admin_teams:r(t.roles?.proxy_admin),admin_viewer_teams:r(t.roles?.proxy_admin_viewer),internal_user_teams:r(t.roles?.internal_user),internal_viewer_teams:r(t.roles?.internal_user_viewer)}}let r={sso_provider:t,proxy_base_url:e.values.proxy_base_url,user_email:e.values.user_email,...e.values,...s};console.log("Setting form values:",r),o.resetFields(),setTimeout(()=>{o.setFieldsValue(r),console.log("Form values set, current form values:",o.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[e,c,o]);let x=async e=>{if(!c)return void b.default.fromBackend("No access token available");try{let{proxy_admin_teams:t,admin_viewer_teams:s,internal_user_teams:r,internal_viewer_teams:i,default_role:n,group_claim:a,use_role_mappings:o,...d}=e,u={...d};if(o){let e=e=>e&&""!==e.trim()?e.split(",").map(e=>e.trim()).filter(e=>e.length>0):[];u.role_mappings={provider:"generic",group_claim:a,default_role:({internal_user_viewer:"internal_user_viewer",internal_user:"internal_user",proxy_admin_viewer:"proxy_admin_viewer",proxy_admin:"proxy_admin"})[n]||"internal_user",roles:{proxy_admin:e(t),proxy_admin_viewer:e(s),internal_user:e(r),internal_user_viewer:e(i)}}}await (0,I.updateSSOSettings)(c,u),l(e)}catch(e){b.default.fromBackend("Failed to save SSO settings: "+(0,B.parseErrorMessage)(e))}},f=async()=>{if(!c)return void b.default.fromBackend("No access token available");try{await (0,I.updateSSOSettings)(c,{google_client_id:null,google_client_secret:null,microsoft_client_id:null,microsoft_client_secret:null,microsoft_tenant:null,generic_client_id:null,generic_client_secret:null,generic_authorization_endpoint:null,generic_token_endpoint:null,generic_userinfo_endpoint:null,proxy_base_url:null,user_email:null,sso_provider:null,role_mappings:null}),o.resetFields(),p(!1),r(),b.default.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),b.default.fromBackend("Failed to clear SSO settings")}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Modal,{title:d?"Edit SSO Settings":"Add SSO",open:e,width:800,footer:null,onOk:r,onCancel:i,children:(0,t.jsxs)(g.Form,{form:o,onFinish:x,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Form.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,t.jsx)(en.Select,{children:Object.entries(ts).map(([e,s])=>(0,t.jsx)(en.Select.Option,{value:e,children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[s&&(0,t.jsx)("img",{src:s,alt:e,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,t.jsxs)("span",{children:["okta"===e.toLowerCase()?"Okta / Auth0":e.charAt(0).toUpperCase()+e.slice(1)," ","SSO"]})]})},e))})}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s,r=e("sso_provider");return r&&(s=tr[r])?s.fields.map(e=>(0,t.jsx)(g.Form.Item,{label:e.label,name:e.name,rules:[{required:!0,message:`Please enter the ${e.label.toLowerCase()}`}],children:e.name.includes("client")?(0,t.jsx)(_.Input.Password,{}):(0,t.jsx)(k.TextInput,{placeholder:e.placeholder})},e.name)):null}}),(0,t.jsx)(g.Form.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Proxy Base URL",name:"proxy_base_url",normalize:e=>e?.trim(),rules:[{required:!0,message:"Please enter the proxy base url"},{pattern:/^https?:\/\/.+/,message:"URL must start with http:// or https://"},{validator:(e,t)=>t&&/^https?:\/\/.+/.test(t)&&t.endsWith("/")?Promise.reject("URL must not end with a trailing slash"):Promise.resolve()}],children:(0,t.jsx)(k.TextInput,{placeholder:"https://example.com"})}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.sso_provider!==t.sso_provider,children:({getFieldValue:e})=>{let s=e("sso_provider");return"okta"===s||"generic"===s?(0,t.jsx)(g.Form.Item,{label:"Use Role Mappings",name:"use_role_mappings",valuePropName:"checked",children:(0,t.jsx)(el.Checkbox,{})}):null}}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.use_role_mappings!==t.use_role_mappings,children:({getFieldValue:e})=>e("use_role_mappings")?(0,t.jsx)(g.Form.Item,{label:"Group Claim",name:"group_claim",rules:[{required:!0,message:"Please enter the group claim"}],children:(0,t.jsx)(k.TextInput,{})}):null}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.use_role_mappings!==t.use_role_mappings,children:({getFieldValue:e})=>e("use_role_mappings")?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Form.Item,{label:"Default Role",name:"default_role",initialValue:"Internal User",children:(0,t.jsxs)(en.Select,{children:[(0,t.jsx)(en.Select.Option,{value:"internal_user_viewer",children:"Internal Viewer"}),(0,t.jsx)(en.Select.Option,{value:"internal_user",children:"Internal User"}),(0,t.jsx)(en.Select.Option,{value:"proxy_admin_viewer",children:"Admin Viewer"}),(0,t.jsx)(en.Select.Option,{value:"proxy_admin",children:"Proxy Admin"})]})}),(0,t.jsx)(g.Form.Item,{label:"Proxy Admin Teams",name:"proxy_admin_teams",children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Admin Viewer Teams",name:"admin_viewer_teams",children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Internal User Teams",name:"internal_user_teams",children:(0,t.jsx)(k.TextInput,{})}),(0,t.jsx)(g.Form.Item,{label:"Internal Viewer Teams",name:"internal_viewer_teams",children:(0,t.jsx)(k.TextInput,{})})]}):null})]}),(0,t.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[d&&(0,t.jsx)(m.Button,{onClick:()=>p(!0),style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#5558eb",e.currentTarget.style.borderColor="#5558eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1",e.currentTarget.style.borderColor="#6366f1"},children:"Clear"}),(0,t.jsx)(m.Button,{htmlType:"submit",children:"Save"})]})]})}),(0,t.jsxs)(h.Modal,{title:"Confirm Clear SSO Settings",open:u,onOk:f,onCancel:()=>p(!1),okText:"Yes, Clear",cancelText:"Cancel",okButtonProps:{danger:!0,style:{backgroundColor:"#dc2626",borderColor:"#dc2626"}},children:[(0,t.jsx)("p",{children:"Are you sure you want to clear all SSO settings? This action cannot be undone."}),(0,t.jsx)("p",{children:"Users will no longer be able to login using SSO after this change."})]}),(0,t.jsxs)(h.Modal,{title:"SSO Setup Instructions",open:s,width:800,footer:null,onOk:n,onCancel:a,children:[(0,t.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,t.jsx)(T.Text,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,t.jsx)(T.Text,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,t.jsx)(T.Text,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,t.jsx)(T.Text,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(m.Button,{onClick:n,children:"Done"})})]})]})},tl=({accessToken:e,onSuccess:s})=>{let[r]=g.Form.useForm(),[i,l]=(0,j.useState)(!1);(0,j.useEffect)(()=>{(async()=>{if(e)try{let t=await (0,I.getSSOSettings)(e);if(t&&t.values){let e=t.values.ui_access_mode,s={};e&&"object"==typeof e?s={ui_access_mode_type:e.type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}:"string"==typeof e&&(s={ui_access_mode_type:e,restricted_sso_group:t.values.restricted_sso_group,sso_group_jwt_field:t.values.team_ids_jwt_field||t.values.sso_group_jwt_field}),r.setFieldsValue(s)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[e,r]);let n=async t=>{if(!e)return void b.default.fromBackend("No access token available");l(!0);try{let r;r="all_authenticated_users"===t.ui_access_mode_type?{ui_access_mode:"none"}:{ui_access_mode:{type:t.ui_access_mode_type,restricted_sso_group:t.restricted_sso_group,sso_group_jwt_field:t.sso_group_jwt_field}},await (0,I.updateSSOSettings)(e,r),s()}catch(e){console.error("Failed to save UI access settings:",e),b.default.fromBackend("Failed to save UI access settings")}finally{l(!1)}};return(0,t.jsxs)("div",{style:{padding:"16px"},children:[(0,t.jsx)("div",{style:{marginBottom:"16px"},children:(0,t.jsx)(T.Text,{style:{fontSize:"14px",color:"#6b7280"},children:"Configure who can access the UI interface and how group information is extracted from JWT tokens."})}),(0,t.jsxs)(g.Form,{form:r,onFinish:n,layout:"vertical",children:[(0,t.jsx)(g.Form.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,t.jsxs)(en.Select,{placeholder:"Select access mode",children:[(0,t.jsx)(en.Select.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,t.jsx)(en.Select.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,t.jsx)(g.Form.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.ui_access_mode_type!==t.ui_access_mode_type,children:({getFieldValue:e})=>"restricted_sso_group"===e("ui_access_mode_type")?(0,t.jsx)(g.Form.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,t.jsx)(k.TextInput,{placeholder:"ui-access-group"})}):null}),(0,t.jsx)(g.Form.Item,{label:"SSO Group JWT Field",name:"sso_group_jwt_field",tooltip:"JWT field name that contains team/group information. Use dot notation to access nested fields.",children:(0,t.jsx)(k.TextInput,{placeholder:"groups"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,t.jsx)(m.Button,{type:"primary",htmlType:"submit",loading:i,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},{Title:tn,Paragraph:ta,Text:to}=y.Typography;e.s(["default",0,({proxySettings:e})=>{let{premiumUser:y,accessToken:w,userId:T}=(0,s.default)(),[C]=g.Form.useForm(),[k,E]=(0,j.useState)(!1),[N,O]=(0,j.useState)(!1),[F,A]=(0,j.useState)(!1),[P,M]=(0,j.useState)(!1),[B,L]=(0,j.useState)(!1),[R,z]=(0,j.useState)(!1),[D,G]=(0,j.useState)([]),[V,q]=(0,j.useState)(null),[H,$]=(0,j.useState)(!1),Q=(0,S.useBaseUrl)(),W="All IP Addresses Allowed",Y=Q;Y+="/fallback/login";let J=async()=>{if(w)try{let e=await (0,I.getSSOSettings)(w);if(e&&e.values){let t=e.values.google_client_id&&e.values.google_client_secret,s=e.values.microsoft_client_id&&e.values.microsoft_client_secret,r=e.values.generic_client_id&&e.values.generic_client_secret;$(t||s||r)}else $(!1)}catch(e){console.error("Error checking SSO configuration:",e),$(!1)}},Z=async()=>{try{if(!0!==y)return void b.default.fromBackend("This feature is only available for premium users. Please upgrade your account.");if(w){let e=await (0,I.getAllowedIPs)(w);G(e&&e.length>0?e:[W])}else G([W])}catch(e){console.error("Error fetching allowed IPs:",e),b.default.fromBackend(`Failed to fetch allowed IPs ${e}`),G([W])}finally{!0===y&&A(!0)}},X=async e=>{try{if(w){await (0,I.addAllowedIP)(w,e.ip);let t=await (0,I.getAllowedIPs)(w);G(t),b.default.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),b.default.fromBackend(`Failed to add IP address ${e}`)}finally{M(!1)}},ee=async e=>{q(e),L(!0)},et=async()=>{if(V&&w)try{await (0,I.deleteAllowedIP)(w,V);let e=await (0,I.getAllowedIPs)(w);G(e.length>0?e:[W]),b.default.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),b.default.fromBackend(`Failed to delete IP address ${e}`)}finally{L(!1),q(null)}};(0,j.useEffect)(()=>{J()},[w,y,J]);let es=()=>{z(!1)},er=[{key:"sso-settings",label:"SSO Settings",children:(0,t.jsx)(eP,{})},{key:"security-settings",label:"Security Settings",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Card,{children:[(0,t.jsx)(tn,{level:4,children:" ✨ Security Settings"}),(0,t.jsx)(p.Alert,{message:"SSO Configuration Deprecated",description:"Editing SSO Settings on this page is deprecated and will be removed in a future version. Please use the SSO Settings tab for SSO configuration.",type:"warning",showIcon:!0}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginTop:"1rem",marginLeft:"0.5rem"},children:[(0,t.jsx)("div",{children:(0,t.jsx)(r.Button,{style:{width:"150px"},onClick:()=>E(!0),children:H?"Edit SSO Settings":"Add SSO"})}),(0,t.jsx)("div",{children:(0,t.jsx)(r.Button,{style:{width:"150px"},onClick:Z,children:"Allowed IPs"})}),(0,t.jsx)("div",{children:(0,t.jsx)(r.Button,{style:{width:"150px"},onClick:()=>!0===y?z(!0):b.default.fromBackend("Only premium users can configure UI access control"),children:"UI Access Control"})})]})]}),(0,t.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,t.jsx)(ti,{isAddSSOModalVisible:k,isInstructionsModalVisible:N,handleAddSSOOk:()=>{E(!1),C.resetFields(),w&&y&&J()},handleAddSSOCancel:()=>{E(!1),C.resetFields()},handleShowInstructions:e=>{E(!1),O(!0)},handleInstructionsOk:()=>{O(!1),w&&y&&J()},handleInstructionsCancel:()=>{O(!1),w&&y&&J()},form:C,accessToken:w,ssoConfigured:H}),(0,t.jsx)(h.Modal,{title:"Manage Allowed IP Addresses",width:800,open:F,onCancel:()=>A(!1),footer:[(0,t.jsx)(r.Button,{className:"mx-1",onClick:()=>M(!0),children:"Add IP Address"},"add"),(0,t.jsx)(r.Button,{onClick:()=>A(!1),children:"Close"},"close")],children:(0,t.jsxs)(n.Table,{children:[(0,t.jsx)(c.TableHead,{children:(0,t.jsxs)(u.TableRow,{children:[(0,t.jsx)(d.TableHeaderCell,{children:"IP Address"}),(0,t.jsx)(d.TableHeaderCell,{className:"text-right",children:"Action"})]})}),(0,t.jsx)(a.TableBody,{children:D.map((e,s)=>(0,t.jsxs)(u.TableRow,{children:[(0,t.jsx)(o.TableCell,{children:e}),(0,t.jsx)(o.TableCell,{className:"text-right",children:e!==W&&(0,t.jsx)(r.Button,{onClick:()=>ee(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,t.jsx)(h.Modal,{title:"Add Allowed IP Address",open:P,onCancel:()=>M(!1),footer:null,children:(0,t.jsxs)(g.Form,{onFinish:X,children:[(0,t.jsx)(g.Form.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,t.jsx)(_.Input,{placeholder:"Enter IP address"})}),(0,t.jsx)(g.Form.Item,{children:(0,t.jsx)(m.Button,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,t.jsx)(h.Modal,{title:"Confirm Delete",open:B,onCancel:()=>L(!1),onOk:et,footer:[(0,t.jsx)(r.Button,{className:"mx-1",onClick:()=>et(),children:"Yes"},"delete"),(0,t.jsx)(r.Button,{onClick:()=>L(!1),children:"Close"},"close")],children:(0,t.jsxs)(to,{children:["Are you sure you want to delete the IP address: ",V,"?"]})}),(0,t.jsx)(h.Modal,{title:"UI Access Control Settings",open:R,width:600,footer:null,onOk:es,onCancel:()=>{z(!1)},children:(0,t.jsx)(tl,{accessToken:w,onSuccess:()=>{es(),b.default.success("UI Access Control settings updated successfully")}})})]}),(0,t.jsxs)(i.Callout,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,t.jsxs)("a",{href:Y,target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)("b",{children:Y})," "]})]})]})},{key:"scim",label:"SCIM",children:(0,t.jsx)(U,{accessToken:w,userID:T,proxySettings:e})},{key:"ui-settings",label:(0,t.jsx)(x.Space,{children:(0,t.jsxs)(to,{children:["UI Settings ",(0,t.jsx)(v.default,{})]})}),children:(0,t.jsx)(eV,{})},{key:"logging-settings",label:"Logging Settings",children:(0,t.jsx)(K,{})},{key:"hashicorp-vault",label:"Hashicorp Vault",children:(0,t.jsx)(tt,{})}];return(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsx)(tn,{level:4,children:"Admin Access "}),(0,t.jsx)(ta,{children:"Go to 'Internal Users' page to add other admins."}),(0,t.jsx)(f.Tabs,{items:er})]})}],105278)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3e917c79aadd945b.js b/litellm/proxy/_experimental/out/_next/static/chunks/3e917c79aadd945b.js
new file mode 100644
index 0000000000..ff821671b1
--- /dev/null
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/3e917c79aadd945b.js
@@ -0,0 +1,84 @@
+(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,826910,e=>{"use strict";var t=e.i(201072);e.s(["CheckCircleFilled",()=>t.default])},185357,180766,782719,969641,476993,824296,64352,230312,e=>{"use strict";var t,a,l=e.i(843476),r=e.i(808613),i=e.i(311451),s=e.i(212931),n=e.i(199133),o=e.i(262218),d=e.i(898586),c=e.i(464571),m=e.i(271645),u=e.i(727749),p=e.i(764205),g=e.i(770914),x=e.i(515831),h=e.i(175712),f=e.i(646563),y=e.i(519756);let{Text:j}=d.Typography,{Option:_}=n.Select,b=({visible:e,prebuiltPatterns:t,categories:a,selectedPatternName:r,patternAction:i,onPatternNameChange:o,onActionChange:d,onAdd:m,onCancel:u})=>(0,l.jsxs)(s.Modal,{title:"Add prebuilt pattern",open:e,onCancel:u,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Pattern type"}),(0,l.jsx)(n.Select,{placeholder:"Choose pattern type",value:r,onChange:o,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,a)=>{let l=t.find(e=>e.name===a?.value);return!!l&&(l.display_name.toLowerCase().includes(e.toLowerCase())||l.name.toLowerCase().includes(e.toLowerCase()))},children:a.map(e=>{let a=t.filter(t=>t.category===e);return 0===a.length?null:(0,l.jsx)(n.Select.OptGroup,{label:e,children:a.map(e=>(0,l.jsx)(_,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(j,{strong:!0,children:"Action"}),(0,l.jsx)(j,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:i,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(_,{value:"BLOCK",children:"Block"}),(0,l.jsx)(_,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:u,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:m,children:"Add"})]})]}),{Text:v}=d.Typography,{Option:w}=n.Select,N=({visible:e,patternName:t,patternRegex:a,patternAction:r,onNameChange:o,onRegexChange:d,onActionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add custom regex pattern",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Pattern name"}),(0,l.jsx)(i.Input,{placeholder:"e.g., internal_id, employee_code",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Regex pattern"}),(0,l.jsx)(i.Input,{placeholder:"e.g., ID-[0-9]{6}",value:a,onChange:e=>d(e.target.value),style:{marginTop:8}}),(0,l.jsx)(v,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(v,{strong:!0,children:"Action"}),(0,l.jsx)(v,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,l.jsxs)(n.Select,{value:r,onChange:m,style:{width:"100%"},children:[(0,l.jsx)(w,{value:"BLOCK",children:"Block"}),(0,l.jsx)(w,{value:"MASK",children:"Mask"})]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]}),{Text:C}=d.Typography,{Option:S}=n.Select,k=({visible:e,keyword:t,action:a,description:r,onKeywordChange:o,onActionChange:d,onDescriptionChange:m,onAdd:u,onCancel:p})=>(0,l.jsxs)(s.Modal,{title:"Add blocked keyword",open:e,onCancel:p,footer:null,width:800,children:[(0,l.jsxs)(g.Space,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Keyword"}),(0,l.jsx)(i.Input,{placeholder:"Enter sensitive keyword or phrase",value:t,onChange:e=>o(e.target.value),style:{marginTop:8}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Action"}),(0,l.jsx)(C,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,l.jsxs)(n.Select,{value:a,onChange:d,style:{width:"100%"},children:[(0,l.jsx)(S,{value:"BLOCK",children:"Block"}),(0,l.jsx)(S,{value:"MASK",children:"Mask"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(C,{strong:!0,children:"Description (optional)"}),(0,l.jsx)(i.Input.TextArea,{placeholder:"Explain why this keyword is sensitive",value:r,onChange:e=>m(e.target.value),rows:3,style:{marginTop:8}})]})]}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,l.jsx)(c.Button,{onClick:p,children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",onClick:u,children:"Add"})]})]});var I=e.i(291542),A=e.i(955135);let{Text:O}=d.Typography,{Option:P}=n.Select,T=({patterns:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,l.jsx)(o.Tag,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,t)=>t.display_name||t.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,l.jsxs)(O,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(P,{value:"BLOCK",children:"Block"}),(0,l.jsx)(P,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})},{Text:L}=d.Typography,{Option:B}=n.Select,F=({keywords:e,onActionChange:t,onRemove:a})=>{let r=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>t(a.id,"action",e),style:{width:120},size:"small",children:[(0,l.jsx)(B,{value:"BLOCK",children:"Block"}),(0,l.jsx)(B,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>a(t.id),children:"Delete"})}];return 0===e.length?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,l.jsx)(I.Table,{dataSource:e,columns:r,rowKey:"id",pagination:!1,size:"small"})};var $=e.i(362024),E=e.i(993914);let{Title:M,Text:R}=d.Typography,{Option:G}=n.Select,z=({availableCategories:e,selectedCategories:t,onCategoryAdd:a,onCategoryRemove:r,onCategoryUpdate:i,accessToken:s,pendingSelection:d,onPendingSelectionChange:u})=>{let[g,x]=m.default.useState(""),y=void 0!==d?d:g,j=u||x,[_,b]=m.default.useState({}),[v,w]=m.default.useState({}),[N,C]=m.default.useState({}),[S,k]=m.default.useState([]),[O,P]=m.default.useState(""),[T,L]=m.default.useState(!1),B=async e=>{if(s&&!_[e]){C(t=>({...t,[e]:!0}));try{let t=await (0,p.getCategoryYaml)(s,e),a=t.yaml_content;if("json"===t.file_type)try{let e=JSON.parse(a);a=JSON.stringify(e,null,2)}catch(t){console.warn(`Failed to format JSON for ${e}:`,t)}b(t=>({...t,[e]:a})),w(a=>({...a,[e]:t.file_type||"yaml"}))}catch(t){console.error(`Failed to fetch content for category ${e}:`,t)}finally{C(t=>({...t,[e]:!1}))}}};m.default.useEffect(()=>{if(y&&s){let e=_[y];if(e)return void P(e);L(!0),console.log(`Fetching content for category: ${y}`,{accessToken:s?"present":"missing"}),(0,p.getCategoryYaml)(s,y).then(e=>{console.log(`Successfully fetched content for ${y}:`,e);let t=e.yaml_content;if("json"===e.file_type)try{let e=JSON.parse(t);t=JSON.stringify(e,null,2)}catch(e){console.warn(`Failed to format JSON for ${y}:`,e)}P(t),b(e=>({...e,[y]:t})),w(t=>({...t,[y]:e.file_type||"yaml"}))}).catch(e=>{console.error(`Failed to fetch preview content for category ${y}:`,e),P("")}).finally(()=>{L(!1)})}else P(""),L(!1)},[y,s]);let F=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(t,a)=>{let r=e.find(e=>e.name===a.category);return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:t}),r?.description&&(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888",marginTop:"4px"},children:r.description})]})}},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"action",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"BLOCK",children:(0,l.jsx)(o.Tag,{color:"red",children:"BLOCK"})}),(0,l.jsx)(G,{value:"MASK",children:(0,l.jsx)(o.Tag,{color:"orange",children:"MASK"})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>(0,l.jsxs)(n.Select,{value:e,onChange:e=>i(t.id,"severity_threshold",e),style:{width:"100%"},children:[(0,l.jsx)(G,{value:"low",children:"Low"}),(0,l.jsx)(G,{value:"medium",children:"Medium"}),(0,l.jsx)(G,{value:"high",children:"High"})]})},{title:"",key:"actions",width:80,render:(e,t)=>(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r(t.id),size:"small",children:"Remove"})}],z=e.filter(e=>!t.some(t=>t.category===e.name));return(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:8},children:[(0,l.jsx)(M,{level:5,style:{margin:0},children:"Blocked topics"}),(0,l.jsx)(R,{type:"secondary",style:{fontSize:12,fontWeight:400},children:"Select topics to block using keyword and semantic analysis"})]}),size:"small",children:[(0,l.jsxs)("div",{style:{marginBottom:16,display:"flex",gap:8},children:[(0,l.jsx)(n.Select,{placeholder:"Select a content category",value:y||void 0,onChange:j,style:{flex:1},showSearch:!0,optionLabelProp:"label",filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),children:z.map(e=>(0,l.jsx)(G,{value:e.name,label:e.display_name,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:500},children:e.display_name}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:e.description})]})},e.name))}),(0,l.jsx)(c.Button,{type:"primary",onClick:()=>{if(!y)return;let l=e.find(e=>e.name===y);!l||t.some(e=>e.category===y)||(a({id:`category-${Date.now()}`,category:l.name,display_name:l.display_name,action:l.default_action,severity_threshold:"medium"}),j(""),P(""))},disabled:!y,icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add"})]}),y&&(0,l.jsxs)("div",{style:{marginBottom:16,padding:"12px",background:"#f9f9f9",border:"1px solid #e0e0e0",borderRadius:"4px"},children:[(0,l.jsxs)("div",{style:{marginBottom:8,fontWeight:500,fontSize:"14px"},children:["Preview: ",e.find(e=>e.name===y)?.display_name,v[y]&&(0,l.jsxs)("span",{style:{marginLeft:8,fontSize:"12px",color:"#888",fontWeight:400},children:["(",v[y]?.toUpperCase(),")"]})]}),T?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):O?(0,l.jsx)("pre",{style:{background:"#fff",padding:"12px",borderRadius:"4px",overflow:"auto",maxHeight:"300px",maxWidth:"100%",fontSize:"12px",lineHeight:"1.5",margin:0,border:"1px solid #e0e0e0",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,l.jsx)("code",{children:O})}):(0,l.jsx)("div",{style:{padding:"8px",textAlign:"center",color:"#888",fontSize:"12px"},children:"Unable to load category content"})]}),t.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Table,{dataSource:t,columns:F,pagination:!1,size:"small",rowKey:"id"}),(0,l.jsx)("div",{style:{marginTop:16},children:(0,l.jsx)($.Collapse,{activeKey:S,onChange:e=>{let t=Array.isArray(e)?e:e?[e]:[],a=new Set(S);t.forEach(e=>{a.has(e)||_[e]||B(e)}),k(t)},ghost:!0,items:t.map(e=>{let t=(v[e.category]||"yaml").toUpperCase();return{key:e.category,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(E.FileTextOutlined,{}),(0,l.jsxs)("span",{children:["View ",t," for ",e.display_name]})]}),children:N[e.category]?(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading content..."}):_[e.category]?(0,l.jsx)("pre",{style:{background:"#f5f5f5",padding:"16px",borderRadius:"4px",overflow:"auto",maxHeight:"400px",fontSize:"12px",lineHeight:"1.5",margin:0},children:(0,l.jsx)("code",{children:_[e.category]})}):(0,l.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Content will load when expanded"})}})})})]}):(0,l.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"#888",border:"1px dashed #d9d9d9",borderRadius:"4px"},children:"No blocked topics selected. Add topics to detect and block harmful content."})]})};var D=e.i(790848),K=e.i(28651);let{Title:q,Text:H}=d.Typography,{Option:J}=n.Select,U={competitor_intent_type:"airline",brand_self:[],locations:[],policy:{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:.7,threshold_medium:.45,threshold_low:.3},W=({enabled:e,config:t,onChange:a,accessToken:i})=>{let s=t??U,[o,d]=(0,m.useState)([]),[c,u]=(0,m.useState)(!1);(0,m.useEffect)(()=>{"airline"===s.competitor_intent_type&&i&&0===o.length&&(u(!0),(0,p.getMajorAirlines)(i).then(e=>d(e.airlines??[])).catch(()=>d([])).finally(()=>u(!1)))},[s.competitor_intent_type,i,o.length]);let x=e=>{a(e,e?{...U}:null)},f=(t,l)=>{a(e,{...s,[t]:l})},y=(t,l)=>{a(e,{...s,policy:{...s.policy,[t]:l}})},j=(t,l)=>{a(e,{...s,[t]:l.filter(Boolean)})};return e?(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(q,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:e,onChange:x})]}),size:"small",children:[(0,l.jsx)(H,{type:"secondary",style:{display:"block",marginBottom:16},children:"Block or reframe competitor comparison questions. Airline type uses major airlines (excluding your brand); generic requires manual competitor list."}),(0,l.jsxs)(r.Form,{layout:"vertical",size:"small",children:[(0,l.jsx)(r.Form.Item,{label:"Type",children:(0,l.jsxs)(n.Select,{value:s.competitor_intent_type,onChange:e=>f("competitor_intent_type",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"airline",children:"Airline (auto-load competitors from IATA)"}),(0,l.jsx)(J,{value:"generic",children:"Generic (specify competitors manually)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Your Brand (brand_self)",required:!0,help:"airline"===s.competitor_intent_type?"Select your airline from the list (excluded from competitors) or type to add a custom term":"Names/codes users use for your brand",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:c?"Loading airlines...":"airline"===s.competitor_intent_type?"Search or select airline, or type to add custom":"Type and press Enter to add",value:s.brand_self,onChange:t=>"airline"===s.competitor_intent_type&&o.length>0?(t=>{let l=t.filter(Boolean),r=[],i=new Set;for(let e of l){let t=o.find(t=>t.match.split("|")[0]?.trim().toLowerCase()===e.toLowerCase());if(t)for(let e of t.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean))i.has(e)||(i.add(e),r.push(e));else i.has(e.toLowerCase())||(i.add(e.toLowerCase()),r.push(e))}a(e,{...s,brand_self:r})})(t??[]):j("brand_self",t??[]),tokenSeparators:[","],loading:c,showSearch:!0,filterOption:(e,t)=>(t?.label?.toString().toLowerCase()??"").includes(e.toLowerCase()),optionFilterProp:"label",options:"airline"===s.competitor_intent_type&&o.length>0?o.map(e=>{let t=e.match.split("|")[0]?.trim()??e.id,a=e.match.split("|").map(e=>e.trim().toLowerCase()).filter(Boolean);return{value:t.toLowerCase(),label:`${t}${a.length>1?` (${a.slice(1).join(", ")})`:""}`}}):void 0})}),"airline"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Locations (optional)",help:"Countries, cities, airports for disambiguation (e.g. qatar, doha)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.locations??[],onChange:e=>j("locations",e??[]),tokenSeparators:[","]})}),"generic"===s.competitor_intent_type&&(0,l.jsx)(r.Form.Item,{label:"Competitors",required:!0,help:"Competitor names to detect (required for generic type)",children:(0,l.jsx)(n.Select,{mode:"tags",style:{width:"100%"},placeholder:"Type and press Enter to add",value:s.competitors??[],onChange:e=>j("competitors",e??[]),tokenSeparators:[","]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.competitor_comparison??"refuse",onChange:e=>y("competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Policy: Possible competitor comparison",children:(0,l.jsxs)(n.Select,{value:s.policy?.possible_competitor_comparison??"reframe",onChange:e=>y("possible_competitor_comparison",e),style:{width:"100%"},children:[(0,l.jsx)(J,{value:"refuse",children:"Refuse (block request)"}),(0,l.jsx)(J,{value:"reframe",children:"Reframe (suggest alternative to backend LLM)"})]})}),(0,l.jsx)(r.Form.Item,{label:"Confidence thresholds",help:(0,l.jsxs)(l.Fragment,{children:["Classify competitor intent by confidence (0–1). Higher confidence → stronger intent.",(0,l.jsxs)("ul",{style:{marginBottom:0,marginTop:4,paddingLeft:20},children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"High (≥)"}),': Treat as full competitor comparison → uses "Competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Medium (≥)"}),': Treat as possible comparison → uses "Possible competitor comparison" policy']}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Low (≥)"}),": Log only; allow request. Below Low → allow with no action"]})]}),"Raise thresholds to be more permissive; lower them to be stricter."]}),children:(0,l.jsxs)(g.Space,{wrap:!0,children:[(0,l.jsx)(r.Form.Item,{label:"High",style:{marginBottom:0},help:"e.g. 0.7",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_high??.7,onChange:e=>f("threshold_high",e??.7),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Medium",style:{marginBottom:0},help:"e.g. 0.45",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_medium??.45,onChange:e=>f("threshold_medium",e??.45),style:{width:80}})}),(0,l.jsx)(r.Form.Item,{label:"Low",style:{marginBottom:0},help:"e.g. 0.3",children:(0,l.jsx)(K.InputNumber,{min:0,max:1,step:.05,value:s.threshold_low??.3,onChange:e=>f("threshold_low",e??.3),style:{width:80}})})]})})]})]}):(0,l.jsx)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(q,{level:5,style:{margin:0},children:"Competitor Intent Filter"}),(0,l.jsx)(D.Switch,{checked:!1,onChange:x})]}),size:"small",children:(0,l.jsx)(H,{type:"secondary",children:"Block or reframe competitor comparison questions. When enabled, airline type auto-loads competitors from IATA; generic type requires manual competitor list."})})},{Title:V,Text:Y}=d.Typography,Q=({prebuiltPatterns:e,categories:t,selectedPatterns:a,blockedWords:r,onPatternAdd:i,onPatternRemove:s,onPatternActionChange:n,onBlockedWordAdd:o,onBlockedWordRemove:d,onBlockedWordUpdate:j,onFileUpload:_,accessToken:v,showStep:w,contentCategories:C=[],selectedContentCategories:S=[],onContentCategoryAdd:I,onContentCategoryRemove:A,onContentCategoryUpdate:O,pendingCategorySelection:P,onPendingCategorySelectionChange:L,competitorIntentEnabled:B=!1,competitorIntentConfig:$=null,onCompetitorIntentChange:E})=>{let[M,R]=(0,m.useState)(!1),[G,D]=(0,m.useState)(!1),[K,q]=(0,m.useState)(!1),[H,J]=(0,m.useState)(""),[U,Q]=(0,m.useState)("BLOCK"),[X,Z]=(0,m.useState)(""),[ee,et]=(0,m.useState)(""),[ea,el]=(0,m.useState)("BLOCK"),[er,ei]=(0,m.useState)(""),[es,en]=(0,m.useState)("BLOCK"),[eo,ed]=(0,m.useState)(""),[ec,em]=(0,m.useState)(!1),eu=async e=>{em(!0);try{let t=await e.text();if(v){let e=await (0,p.validateBlockedWordsFile)(v,t);if(e.valid)_&&_(t),u.default.success(e.message||"File uploaded successfully");else{let t=e.error||e.errors&&e.errors.join(", ")||"Invalid file";u.default.error(`Validation failed: ${t}`)}}}catch(e){u.default.error(`Failed to upload file: ${e}`)}finally{em(!1)}return!1};return(0,l.jsxs)("div",{className:"space-y-6",children:[!w&&(0,l.jsx)("div",{children:(0,l.jsx)(Y,{type:"secondary",children:"Configure patterns, keywords, and content categories to detect and filter sensitive information in requests and responses."})}),(!w||"patterns"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>R(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add prebuilt pattern"}),(0,l.jsx)(c.Button,{onClick:()=>q(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add custom regex"})]})}),(0,l.jsx)(T,{patterns:a,onActionChange:n,onRemove:s})]}),(!w||"keywords"===w)&&(0,l.jsxs)(h.Card,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsx)(V,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,l.jsx)(Y,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,l.jsx)("div",{style:{marginBottom:16},children:(0,l.jsxs)(g.Space,{children:[(0,l.jsx)(c.Button,{type:"primary",onClick:()=>D(!0),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add keyword"}),(0,l.jsx)(x.Upload,{beforeUpload:eu,accept:".yaml,.yml",showUploadList:!1,children:(0,l.jsx)(c.Button,{icon:(0,l.jsx)(y.UploadOutlined,{}),loading:ec,children:"Upload YAML file"})})]})}),(0,l.jsx)(F,{keywords:r,onActionChange:j,onRemove:d})]}),(!w||"competitor_intent"===w||"categories"===w)&&E&&(0,l.jsx)(W,{enabled:B,config:$,onChange:E,accessToken:v}),(!w||"categories"===w)&&C.length>0&&I&&A&&O&&(0,l.jsx)(z,{availableCategories:C,selectedCategories:S,onCategoryAdd:I,onCategoryRemove:A,onCategoryUpdate:O,accessToken:v,pendingSelection:P,onPendingSelectionChange:L}),(0,l.jsx)(b,{visible:M,prebuiltPatterns:e,categories:t,selectedPatternName:H,patternAction:U,onPatternNameChange:J,onActionChange:e=>Q(e),onAdd:()=>{if(!H)return void u.default.error("Please select a pattern");let t=e.find(e=>e.name===H);i({id:`pattern-${Date.now()}`,type:"prebuilt",name:H,display_name:t?.display_name,action:U}),R(!1),J(""),Q("BLOCK")},onCancel:()=>{R(!1),J(""),Q("BLOCK")}}),(0,l.jsx)(N,{visible:K,patternName:X,patternRegex:ee,patternAction:ea,onNameChange:Z,onRegexChange:et,onActionChange:e=>el(e),onAdd:()=>{X&&ee?(i({id:`custom-${Date.now()}`,type:"custom",name:X,pattern:ee,action:ea}),q(!1),Z(""),et(""),el("BLOCK")):u.default.error("Please provide pattern name and regex")},onCancel:()=>{q(!1),Z(""),et(""),el("BLOCK")}}),(0,l.jsx)(k,{visible:G,keyword:er,action:es,description:eo,onKeywordChange:ei,onActionChange:e=>en(e),onDescriptionChange:ed,onAdd:()=>{er?(o({id:`word-${Date.now()}`,keyword:er,action:es,description:eo||void 0}),D(!1),ei(""),ed(""),en("BLOCK")):u.default.error("Please enter a keyword")},onCancel:()=>{D(!1),ei(""),ed(""),en("BLOCK")}})]})};var X=((t={}).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t);let Z={},ee=e=>{let t={};return t.PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera",t.LlmAsAJudge="LiteLLM LLM as a Judge",Object.entries(e).forEach(([e,a])=>{a&&"object"==typeof a&&"ui_friendly_name"in a&&(t[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=a.ui_friendly_name)}),Z=t,t},et=()=>Object.keys(Z).length>0?Z:X,ea={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission",BlockCodeExecution:"block_code_execution",Promptguard:"promptguard",LlmAsAJudge:"llm_as_a_judge",Xecguard:"xecguard",QostodianNexus:"qostodian_nexus"},el=e=>{Object.entries(e).forEach(([e,t])=>{t&&"object"==typeof t&&"ui_friendly_name"in t&&(ea[e.split("_").map((e,t)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=e)})},er=e=>!!e&&"Presidio PII"===et()[e],ei=e=>!!e&&"LiteLLM Content Filter"===et()[e],es=e=>!!e&&"llm_as_a_judge"===ea[e],en="../ui/assets/logos/",eo={"Zscaler AI Guard":`${en}zscaler.svg`,"Presidio PII":`${en}microsoft_azure.svg`,"Bedrock Guardrail":`${en}bedrock.svg`,Lakera:`${en}lakeraai.jpeg`,"Azure Content Safety Prompt Shield":`${en}microsoft_azure.svg`,"Azure Content Safety Text Moderation":`${en}microsoft_azure.svg`,"Aporia AI":`${en}aporia.png`,"PANW Prisma AIRS":`${en}palo_alto_networks.jpeg`,"Noma Security":`${en}noma_security.png`,"Javelin Guardrails":`${en}javelin.png`,"Pillar Guardrail":`${en}pillar.jpeg`,"Google Cloud Model Armor":`${en}google.svg`,"Guardrails AI":`${en}guardrails_ai.jpeg`,"Lasso Guardrail":`${en}lasso.png`,"Pangea Guardrail":`${en}pangea.png`,"AIM Guardrail":`${en}aim_security.jpeg`,"OpenAI Moderation":`${en}openai_small.svg`,EnkryptAI:`${en}enkrypt_ai.avif`,"Prompt Security":`${en}prompt_security.png`,PromptGuard:`${en}promptguard.svg`,XecGuard:`${en}xecguard.svg`,"LiteLLM Content Filter":`${en}litellm_logo.jpg`,"LiteLLM LLM as a Judge":`${en}litellm_logo.jpg`,Akto:`${en}akto.svg`,"Qostodian Nexus":`${en}qohash.jpg`},ed=e=>{if(!e)return{logo:"",displayName:"-"};let t=Object.keys(ea).find(t=>ea[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let a=et()[t];return{logo:eo[a]||"",displayName:a||e}};function ec(e){return!0===e?"yes":!1===e?"no":"inherit"}function em(e){return"yes"===e||"no"!==e&&void 0}e.s(["choiceToSkipSystemForCreate",()=>em,"getGuardrailLogoAndName",0,ed,"getGuardrailProviders",0,et,"guardrailLogoMap",0,eo,"guardrail_provider_map",0,ea,"populateGuardrailProviderMap",0,el,"populateGuardrailProviders",0,ee,"shouldRenderContentFilterConfigSettings",0,ei,"shouldRenderLLMJudgeFields",0,es,"shouldRenderPIIConfigSettings",0,er,"skipSystemMessageToChoice",()=>ec],180766);var eu=e.i(435451);let{Title:ep}=d.Typography,eg=({field:e,fieldKey:t,fullFieldKey:a,value:s})=>{let[o,d]=m.default.useState([]),[u,p]=m.default.useState(e.dict_key_options||[]);return m.default.useEffect(()=>{if(s&&"object"==typeof s){let t=Object.keys(s);d(t.map(e=>({key:e,id:`${e}_${Date.now()}_${Math.random()}`}))),p((e.dict_key_options||[]).filter(e=>!t.includes(e)))}},[s,e.dict_key_options]),(0,l.jsxs)("div",{className:"space-y-3",children:[o.map(t=>(0,l.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,l.jsx)("div",{className:"w-24 font-medium text-sm",children:t.key}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(r.Form.Item,{name:Array.isArray(a)?[...a,t.key]:[a,t.key],style:{marginBottom:0},initialValue:s&&"object"==typeof s?s[t.key]:void 0,normalize:"number"===e.dict_value_type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"number"===e.dict_value_type?(0,l.jsx)(eu.default,{step:1,width:200,placeholder:`Enter ${t.key} value`}):"boolean"===e.dict_value_type?(0,l.jsxs)(n.Select,{placeholder:`Select ${t.key} value`,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):(0,l.jsx)(i.Input,{placeholder:`Enter ${t.key} value`})})}),(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>{var e,a;return e=t.id,a=t.key,void(d(o.filter(t=>t.id!==e)),p([...u,a].sort()))},children:"Remove"})]},t.id)),u.length>0&&(0,l.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,l.jsx)(n.Select,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&void(!e||(d([...o,{key:e,id:`${e}_${Date.now()}`}]),p(u.filter(t=>t!==e)))),value:void 0,children:u.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}),(0,l.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})},ex=({optionalParams:e,parentFieldKey:t,values:a})=>e.fields&&0!==Object.keys(e.fields).length?(0,l.jsxs)("div",{className:"guardrail-optional-params",children:[(0,l.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,l.jsx)(ep,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,l.jsx)("p",{className:"text-gray-600 text-sm",children:e.description||"Configure additional settings for this guardrail provider"})]}),(0,l.jsx)("div",{className:"space-y-8",children:Object.entries(e.fields).map(([e,s])=>{let o,d;return o=`${t}.${e}`,(console.log("value",d=a?.[e]),"dict"===s.type&&s.dict_key_options)?(0,l.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,l.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,l.jsx)(eg,{field:s,fieldKey:e,fullFieldKey:[t,e],value:d})]},o):(0,l.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,l.jsx)(r.Form.Item,{name:[t,e],label:(0,l.jsxs)("div",{className:"mb-2",children:[(0,l.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,l.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:`${e} is required`}]:void 0,className:"mb-0",initialValue:void 0!==d?d:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let t=Number(e);return isNaN(t)?e:t}:void 0,children:"select"===s.type&&s.options?(0,l.jsx)(n.Select,{placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,l.jsxs)(n.Select,{placeholder:s.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"number"===s.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:s.description}):(0,l.jsx)(i.Input,{placeholder:s.description})})},o)})})]}):null;var eh=e.i(482725),ef=e.i(850627);let ey=({selectedProvider:e,accessToken:t,providerParams:a=null,value:s=null})=>{let[o,d]=(0,m.useState)(!1),[c,u]=(0,m.useState)(a),[g,x]=(0,m.useState)(null);if((0,m.useEffect)(()=>{if(a)return void u(a);let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,p.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),ee(e),el(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};a||e()},[t,a]),!e)return null;if(o)return(0,l.jsx)(eh.Spin,{tip:"Loading provider parameters..."});if(g)return(0,l.jsx)("div",{className:"text-red-500",children:g});let h=ea[e]?.toLowerCase(),f=c&&c[h];if(console.log("Provider key:",h),console.log("Provider fields:",f),!f||0===Object.keys(f).length)return(0,l.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",s);let y=new Set(["patterns","blocked_words","blocked_words_file","categories","severity_threshold","pattern_redaction_format","keyword_redaction_tag"]),j=ei(e),_=(e,t="",a)=>Object.entries(e).map(([e,o])=>{let d=t?`${t}.${e}`:e,c=a?a[e]:s?.[e];if(console.log("Field value:",c),"ui_friendly_name"===e||"optional_params"===e&&"nested"===o.type&&o.fields||j&&y.has(e))return null;if("nested"===o.type&&o.fields)return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 font-medium",children:e}),(0,l.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:_(o.fields,d,c)})]},d);let m=void 0!==c?c:o.default_value??("percentage"===o.type?.5:void 0);return(0,l.jsx)(r.Form.Item,{name:d,label:e,tooltip:o.description,rules:o.required?[{required:!0,message:`${e} is required`}]:void 0,initialValue:m,children:"select"===o.type&&o.options?(0,l.jsx)(n.Select,{placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"multiselect"===o.type&&o.options?(0,l.jsx)(n.Select,{mode:"multiple",placeholder:o.description,defaultValue:c||o.default_value,children:o.options.map(e=>(0,l.jsx)(n.Select.Option,{value:e,children:e},e))}):"bool"===o.type||"boolean"===o.type?(0,l.jsxs)(n.Select,{placeholder:o.description,children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"True"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"False"})]}):"percentage"===o.type&&null!=o.min&&null!=o.max?(0,l.jsx)(ef.Slider,{min:o.min,max:o.max,step:o.step??.1,marks:{[o.min]:"0%",[(o.min+o.max)/2]:"50%",[o.max]:"100%"}}):"number"===o.type?(0,l.jsx)(eu.default,{step:1,width:400,placeholder:o.description,defaultValue:void 0!==c?Number(c):void 0}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,l.jsx)(i.Input.Password,{placeholder:o.description,defaultValue:c||""}):(0,l.jsx)(i.Input,{placeholder:o.description,defaultValue:c||""})},d)});return(0,l.jsx)(l.Fragment,{children:_(f)})};var ej=e.i(592968),e_=e.i(750113);let eb=({availableModels:e,form:t})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6,padding:"10px 14px",marginBottom:16,fontSize:13,color:"#389e0d"},children:["After each LLM response, the ",(0,l.jsx)("strong",{children:"Judge Model"})," scores it 0–100 against your criteria. If the weighted average falls below the threshold, the response is blocked (or logged)."]}),(0,l.jsx)(r.Form.Item,{name:"judge_model",label:(0,l.jsxs)("span",{children:["Judge Model ",(0,l.jsx)(ej.Tooltip,{title:"The LLM that reads each response and grades it. Pick a capable model — it never sees end-user data beyond what the LLM returned.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),rules:[{required:!0,message:"Select a judge model"}],children:(0,l.jsx)(n.Select,{showSearch:!0,placeholder:"Select a model",options:e.map(e=>({label:e,value:e}))})}),(0,l.jsx)(r.Form.Item,{name:"overall_threshold",label:(0,l.jsxs)("span",{children:["Minimum Score to Pass ",(0,l.jsx)(ej.Tooltip,{title:"0–100. If the weighted average of criterion scores falls below this, the guardrail triggers. 80 is a good default.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:80,children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"/ 100",style:{width:"100%"}})}),(0,l.jsx)(r.Form.Item,{name:"on_failure",label:(0,l.jsxs)("span",{children:["On Failure ",(0,l.jsx)(ej.Tooltip,{title:"Block: return HTTP 422 when the score is too low. Log: record the result but let the response through.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),initialValue:"block",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block (return 422)"}),(0,l.jsx)(n.Select.Option,{value:"log",children:"Log only"})]})}),(0,l.jsx)(r.Form.Item,{label:(0,l.jsxs)("span",{children:["Evaluation Criteria ",(0,l.jsx)(ej.Tooltip,{title:"Each criterion is something the judge checks. Weights must add up to 100%.",children:(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#8c8c8c"}})})]}),children:(0,l.jsx)(r.Form.List,{name:"criteria",initialValue:[{name:"",weight:100,description:""}],children:(e,{add:a,remove:s})=>(0,l.jsxs)(l.Fragment,{children:[e.map(({key:e,name:t,...a})=>(0,l.jsxs)("div",{style:{border:"1px solid #f0f0f0",borderRadius:6,padding:"12px 12px 0",marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-end"},children:[(0,l.jsx)(r.Form.Item,{...a,name:[t,"name"],rules:[{required:!0,message:"Enter criterion name"}],style:{flex:2,marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"Criterion name (e.g. Policy accuracy)"})}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"weight"],label:(0,l.jsx)(ej.Tooltip,{title:"How much this criterion counts toward the final score. All weights must add up to 100%.",children:(0,l.jsxs)("span",{style:{fontSize:12,color:"#595959"},children:["Weight ",(0,l.jsx)(e_.QuestionCircleOutlined,{style:{color:"#bfbfbf"}})]})}),rules:[{required:!0,message:"Enter weight"}],style:{flex:1,marginBottom:8},children:(0,l.jsx)(K.InputNumber,{min:0,max:100,addonAfter:"%",style:{width:"100%"},placeholder:"e.g. 50"})}),(0,l.jsx)("div",{style:{marginBottom:8},children:(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",onClick:()=>s(t),children:"×"})})]}),(0,l.jsx)(r.Form.Item,{...a,name:[t,"description"],rules:[{required:!0,message:"Describe what to check"}],style:{marginBottom:8},children:(0,l.jsx)(i.Input,{placeholder:"What should the judge check for this criterion?"})})]},e)),(0,l.jsx)(c.Button,{type:"dashed",block:!0,style:{marginTop:4},onClick:()=>a({name:"",weight:0,description:""}),icon:(0,l.jsx)(f.PlusOutlined,{}),children:"Add Criterion"}),e.length>0&&(0,l.jsx)(r.Form.Item,{shouldUpdate:!0,noStyle:!0,children:()=>{let e=(t.getFieldValue("criteria")||[]).reduce((e,t)=>e+(Number(t?.weight)||0),0),a=100===e;return(0,l.jsxs)("div",{style:{marginTop:6,fontSize:12,color:a?"#52c41a":"#faad14"},children:["Weights total: ",e,"%",a?" ✓":" — must add up to 100%"]})}})]})})})]});var ev=e.i(536916),ew=e.i(149192),eN=e.i(741585),eN=eN,eC=e.i(724154);e.i(247167);var eS=e.i(931067);let ek={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"};var eI=e.i(9583),eA=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:ek}))});let{Text:eO}=d.Typography,{Option:eP}=n.Select,eT=({categories:e,selectedCategories:t,onChange:a})=>(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-2",children:[(0,l.jsx)(eA,{className:"text-gray-500 mr-1"}),(0,l.jsx)(eO,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,l.jsx)(n.Select,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:a,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,l.jsx)(o.Tag,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:e.map(e=>(0,l.jsx)(eP,{value:e.category,children:e.category},e.category))})]}),eL=({onSelectAll:e,onUnselectAll:t,hasSelectedEntities:a})=>(0,l.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(eO,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,l.jsx)(ej.Tooltip,{title:"Apply action to all PII types at once",children:(0,l.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:t,disabled:!a,icon:(0,l.jsx)(ew.CloseOutlined,{}),children:"Unselect All"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(c.Button,{color:"primary",variant:"outlined",onClick:()=>e("MASK"),className:"h-10",block:!0,icon:(0,l.jsx)(eN.default,{}),children:"Select All & Mask"}),(0,l.jsx)(c.Button,{color:"danger",variant:"outlined",onClick:()=>e("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,l.jsx)(eC.StopOutlined,{}),children:"Select All & Block"})]})]}),eB=({entities:e,selectedEntities:t,selectedActions:a,actions:r,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:d})=>(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eO,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,l.jsx)(eO,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===e.length?(0,l.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):e.map(e=>(0,l.jsxs)("div",{className:`px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ${t.includes(e)?"bg-blue-50":""}`,children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)(ev.Checkbox,{checked:t.includes(e),onChange:()=>i(e),className:"mr-3"}),(0,l.jsx)(eO,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:e.replace(/_/g," ")}),d.get(e)&&(0,l.jsx)(o.Tag,{className:"ml-2 text-xs",color:"blue",children:d.get(e)})]}),(0,l.jsx)("div",{className:"w-32",children:(0,l.jsx)(n.Select,{value:t.includes(e)&&a[e]||"MASK",onChange:t=>s(e,t),style:{width:120},disabled:!t.includes(e),className:`${!t.includes(e)?"opacity-50":""}`,dropdownMatchSelectWidth:!1,children:r.map(e=>(0,l.jsx)(eP,{value:e,children:(0,l.jsxs)("div",{className:"flex items-center",children:[(e=>{switch(e){case"MASK":return(0,l.jsx)(eN.default,{style:{marginRight:4}});case"BLOCK":return(0,l.jsx)(eC.StopOutlined,{style:{marginRight:4}});default:return null}})(e),e]})},e))})})]},e))})]}),{Title:eF,Text:e$}=d.Typography,eE=({entities:e,actions:t,selectedEntities:a,selectedActions:r,onEntitySelect:i,onActionSelect:s,entityCategories:n=[]})=>{let[o,d]=(0,m.useState)([]),c=new Map;n.forEach(e=>{e.entities.forEach(t=>{c.set(t,e.category)})});let u=e.filter(e=>0===o.length||o.includes(c.get(e)||""));return(0,l.jsxs)("div",{className:"pii-configuration",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,l.jsx)("div",{className:"flex items-center",children:(0,l.jsx)(eF,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,l.jsxs)(e$,{className:"text-gray-500",children:[a.length," items selected"]})]}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)(eT,{categories:n,selectedCategories:o,onChange:d}),(0,l.jsx)(eL,{onSelectAll:t=>{e.forEach(e=>{a.includes(e)||i(e),s(e,t)})},onUnselectAll:()=>{a.forEach(e=>{i(e)})},hasSelectedEntities:a.length>0})]}),(0,l.jsx)(eB,{entities:u,selectedEntities:a,selectedActions:r,actions:t,onEntitySelect:i,onActionSelect:s,entityToCategoryMap:c})]})};var eM=e.i(304967),eR=e.i(599724),eG=e.i(312361),ez=e.i(21548),eD=e.i(827252);let eK={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eq=({value:e,onChange:t,disabled:a=!1})=>{let r={...eK,...e||{},rules:e?.rules?[...e.rules]:[]},s=e=>{let a={...r,...e};t?.(a)},o=(e,t)=>{s({rules:r.rules.map((a,l)=>l===e?{...a,...t}:a)})},d=(e,t)=>{let a=r.rules[e];if(!a)return;let l=Object.entries(a.allowed_param_patterns||{});t(l);let i={};l.forEach(([e,t])=>{i[e]=t}),o(e,{allowed_param_patterns:Object.keys(i).length>0?i:void 0})};return(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,l.jsx)(eR.Text,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!a&&(0,l.jsx)(c.Button,{icon:(0,l.jsx)(f.PlusOutlined,{}),type:"primary",onClick:()=>{s({rules:[...r.rules,{id:`rule_${Math.random().toString(36).slice(2,8)}`,decision:"allow",allowed_param_patterns:void 0}]})},className:"!bg-blue-600 !text-white hover:!bg-blue-500",children:"Add Rule"})]}),(0,l.jsx)(eG.Divider,{}),0===r.rules.length?(0,l.jsx)(ez.Empty,{description:"No tool rules added yet"}):(0,l.jsx)("div",{className:"space-y-4",children:r.rules.map((e,t)=>{let m;return(0,l.jsxs)(eM.Card,{className:"bg-gray-50",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,l.jsxs)(eR.Text,{className:"font-semibold",children:["Rule ",t+1]}),(0,l.jsx)(c.Button,{icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,type:"text",disabled:a,onClick:()=>{s({rules:r.rules.filter((e,a)=>a!==t)})},children:"Remove"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Rule ID"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"unique_rule_id",value:e.id,onChange:e=>o(t,{id:e.target.value})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^mcp__github_.*$",value:e.tool_name??"",onChange:e=>o(t,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^function$",value:e.tool_type??"",onChange:e=>o(t,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,l.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Decision"}),(0,l.jsxs)(n.Select,{disabled:a,value:e.decision,style:{width:200},onChange:e=>o(t,{decision:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsx)("div",{className:"mt-4",children:0===(m=Object.entries(e.allowed_param_patterns||{})).length?(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eR.Text,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),m.map(([r,s],n)=>(0,l.jsxs)(g.Space,{align:"start",children:[(0,l.jsx)(i.Input,{disabled:a,placeholder:"messages[0].content",value:r,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[,t]=e[n];e[n]=[a,t]})}}),(0,l.jsx)(i.Input,{disabled:a,placeholder:"^email@.*$",value:s,onChange:e=>{var a;return a=e.target.value,void d(t,e=>{if(!e[n])return;let[t]=e[n];e[n]=[t,a]})}}),(0,l.jsx)(c.Button,{disabled:a,icon:(0,l.jsx)(A.DeleteOutlined,{}),danger:!0,onClick:()=>d(t,e=>{e.splice(n,1)})})]},`${e.id||t}-${n}`)),(0,l.jsx)(c.Button,{disabled:a,size:"small",onClick:()=>o(t,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})})]},e.id||t)})}),(0,l.jsx)(eG.Divider,{}),(0,l.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Default action"}),(0,l.jsxs)(n.Select,{disabled:a,value:r.default_action,onChange:e=>s({default_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"allow",children:"Allow"}),(0,l.jsx)(n.Select.Option,{value:"deny",children:"Deny"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(eR.Text,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,l.jsx)(ej.Tooltip,{title:"Block returns an error when a forbidden tool is invoked. Rewrite strips the tool call but lets the rest of the response continue.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})})]}),(0,l.jsxs)(n.Select,{disabled:a,value:r.on_disallowed_action,onChange:e=>s({on_disallowed_action:e}),children:[(0,l.jsx)(n.Select.Option,{value:"block",children:"Block"}),(0,l.jsx)(n.Select.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)(eR.Text,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,l.jsx)(i.Input.TextArea,{disabled:a,rows:3,placeholder:"This violates our org policy...",value:r.violation_message_template,onChange:e=>s({violation_message_template:e.target.value})})]})]})},{Title:eH,Text:eJ,Link:eU}=d.Typography,{Option:eW}=n.Select,eV={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};e.s(["default",0,({visible:e,onClose:t,accessToken:a,onSuccess:d,preset:g})=>{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(0),[I,A]=(0,m.useState)(null),[O,P]=(0,m.useState)([]),[T,L]=(0,m.useState)(2),[B,F]=(0,m.useState)({}),[$,E]=(0,m.useState)([]),[M,R]=(0,m.useState)([]),[G,z]=(0,m.useState)([]),[D,K]=(0,m.useState)(""),[q,H]=(0,m.useState)(!1),[J,U]=(0,m.useState)(null),[W,V]=(0,m.useState)(""),[Y,X]=(0,m.useState)(void 0),[Z,en]=(0,m.useState)("warn"),[ed,ec]=(0,m.useState)(""),[eu,ep]=(0,m.useState)(!1),[eg,eh]=(0,m.useState)([]),[ef,ej]=(0,m.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),e_=(0,m.useMemo)(()=>!!y&&"tool_permission"===(ea[y]||"").toLowerCase(),[y]);(0,m.useEffect)(()=>{a&&(async()=>{try{let[e,t,l]=await Promise.all([(0,p.getGuardrailUISettings)(a),(0,p.getGuardrailProviderSpecificParams)(a),(0,p.modelAvailableCall)(a,"","").catch(()=>null)]);b(e),A(t),l?.data&&eh(l.data.map(e=>e.id)),ee(t),el(t)}catch(e){console.error("Error fetching guardrail data:",e),u.default.fromBackend("Failed to load guardrail configuration")}})()},[a]),(0,m.useEffect)(()=>{if(!g||!e||!_)return;j(g.provider);let t={provider:g.provider,guardrail_name:g.guardrailNameSuggestion,mode:g.mode,default_on:g.defaultOn,skip_system_message_choice:"inherit"};if("BlockCodeExecution"===g.provider&&(t.confidence_threshold=.5),x.setFieldsValue(t),g.categoryName&&_.content_filter_settings?.content_categories){let e=_.content_filter_settings.content_categories.find(e=>e.name===g.categoryName);e&&z([{id:`category-${Date.now()}`,category:e.name,display_name:e.display_name,action:e.default_action,severity_threshold:"medium"}])}},[g,e,_]);let ev=e=>{j(e);let t={config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0};"BlockCodeExecution"===e&&(t.confidence_threshold=.5),x.setFieldsValue(t),w([]),C({}),P([]),L(2),F({}),E([]),R([]),z([]),K(""),H(!1),U(null),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),"LlmAsAJudge"===e&&x.setFieldsValue({mode:"post_call"})},ew=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},eN=(e,t)=>{C(a=>({...a,[e]:t}))},eC=async()=>{try{if(0===S&&(await x.validateFields(["guardrail_name","provider","mode","default_on"]),y)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===y&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await x.validateFields(e)}if(1===S&&er(y)&&0===v.length)return void u.default.fromBackend("Please select at least one PII entity to continue");k(S+1)}catch(e){console.error("Form validation failed:",e)}},eS=()=>{x.resetFields(),j(null),w([]),C({}),P([]),L(2),F({}),E([]),R([]),z([]),K(""),ej({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),V(""),X(void 0),en("warn"),ec(""),ep(!1),k(0)},ek=()=>{eS(),t()},eI=async()=>{try{f(!0),await x.validateFields();let e=x.getFieldsValue(!0),l=ea[e.provider],r={guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}},i=em(e.skip_system_message_choice);if(void 0!==i&&(r.litellm_params.skip_system_message_in_guardrail=i),"PresidioPII"===e.provider&&v.length>0){let t={};v.forEach(e=>{t[e]=N[e]||"MASK"}),r.litellm_params.pii_entities_config=t,e.presidio_analyzer_api_base&&(r.litellm_params.presidio_analyzer_api_base=e.presidio_analyzer_api_base),e.presidio_anonymizer_api_base&&(r.litellm_params.presidio_anonymizer_api_base=e.presidio_anonymizer_api_base)}if(ei(e.provider)){let e=q&&J?.brand_self?.length>0;if(0===$.length&&0===M.length&&0===G.length&&!e){u.default.fromBackend("Please configure at least one content filter setting (category, pattern, keyword, or competitor intent)"),f(!1);return}$.length>0&&(r.litellm_params.patterns=$.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action}))),M.length>0&&(r.litellm_params.blocked_words=M.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))),G.length>0&&(r.litellm_params.categories=G.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),q&&J?.brand_self?.length>0&&(r.litellm_params.competitor_intent_config={competitor_intent_type:J.competitor_intent_type??"airline",brand_self:J.brand_self,locations:J.locations?.length>0?J.locations:void 0,competitors:"generic"===J.competitor_intent_type&&J.competitors?.length>0?J.competitors:void 0,policy:J.policy,threshold_high:J.threshold_high,threshold_medium:J.threshold_medium,threshold_low:J.threshold_low})}else if(e.config)try{r.guardrail_info=JSON.parse(e.config)}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}if("llm_as_a_judge"===l){let t=e.criteria||[];if(0===t.length){u.default.fromBackend("Add at least one evaluation criterion"),f(!1);return}let a=t.reduce((e,t)=>e+(Number(t?.weight)||0),0);if(100!==a){u.default.fromBackend(`Criterion weights must sum to 100% (currently ${a}%)`),f(!1);return}r.litellm_params.judge_model=e.judge_model,r.litellm_params.overall_threshold=e.overall_threshold??80,r.litellm_params.on_failure=e.on_failure??"block",r.litellm_params.criteria=t.map(e=>({name:e.name,weight:Number(e.weight),description:e.description||""}))}if("tool_permission"===l){if(0===ef.rules.length){u.default.fromBackend("Add at least one tool permission rule"),f(!1);return}r.litellm_params.rules=ef.rules,r.litellm_params.default_action=ef.default_action,r.litellm_params.on_disallowed_action=ef.on_disallowed_action,ef.violation_message_template&&(r.litellm_params.violation_message_template=ef.violation_message_template)}if(ei(e.provider)&&(void 0!==Y&&Y>0&&(r.litellm_params.end_session_after_n_fails=Y),Z&&"realtime"===W&&(r.litellm_params.on_violation=Z),ed.trim()&&(r.litellm_params.realtime_violation_message=ed.trim())),console.log("values: ",JSON.stringify(e)),I&&y&&"llm_as_a_judge"!==l){let t=ea[y]?.toLowerCase();console.log("providerKey: ",t);let a=I[t]||{},l=new Set;console.log("providerSpecificParams: ",JSON.stringify(a)),Object.keys(a).forEach(e=>{"optional_params"!==e&&l.add(e)}),a.optional_params&&a.optional_params.fields&&Object.keys(a.optional_params.fields).forEach(e=>{l.add(e)}),console.log("allowedParams: ",l),l.forEach(t=>{let a=e[t];(null==a||""===a)&&(a=e.optional_params?.[t]),null!=a&&""!==a&&(r.litellm_params[t]=a)})}if(!a)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(r)),await (0,p.createGuardrailCall)(a,r),u.default.success("Guardrail created successfully"),eS(),d(),t()}catch(e){console.error("Failed to create guardrail:",e),u.default.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}},eA=e=>{if(!_||!ei(y))return null;let t=_.content_filter_settings;return t?(0,l.jsx)(Q,{prebuiltPatterns:t.prebuilt_patterns||[],categories:t.pattern_categories||[],selectedPatterns:$,blockedWords:M,onPatternAdd:e=>E([...$,e]),onPatternRemove:e=>E($.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>{E($.map(a=>a.id===e?{...a,action:t}:a))},onBlockedWordAdd:e=>R([...M,e]),onBlockedWordRemove:e=>R(M.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>{R(M.map(l=>l.id===e?{...l,[t]:a}:l))},contentCategories:t.content_categories||[],selectedContentCategories:G,onContentCategoryAdd:e=>z([...G,e]),onContentCategoryRemove:e=>z(G.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>{z(G.map(l=>l.id===e?{...l,[t]:a}:l))},pendingCategorySelection:D,onPendingCategorySelectionChange:K,accessToken:a,showStep:e,competitorIntentEnabled:q,competitorIntentConfig:J,onCompetitorIntentChange:(e,t)=>{H(e),U(t)}}):null},eO=ei(y)?[{title:"Basic Info",optional:!1},{title:"Topics",optional:!1},{title:"Patterns",optional:!1},{title:"Keywords",optional:!1},{title:"Endpoint Settings (Optional)",optional:!0}]:er(y)?[{title:"Basic Info",optional:!1},{title:"PII Configuration",optional:!1}]:[{title:"Basic Info",optional:!1},{title:"Provider Configuration",optional:!1}];return(0,l.jsx)(s.Modal,{title:null,open:e,onCancel:ek,footer:null,width:1e3,closable:!1,className:"top-8",styles:{body:{padding:0}},children:(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 m-0",children:"Create guardrail"}),(0,l.jsx)("button",{onClick:ek,className:"text-gray-400 hover:text-gray-600 bg-transparent border-none cursor-pointer text-base leading-none p-1",children:"✕"})]}),(0,l.jsx)("div",{className:"overflow-auto px-6 py-4",style:{maxHeight:"calc(80vh - 120px)"},children:(0,l.jsx)(r.Form,{form:x,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1,skip_system_message_choice:"inherit"},children:eO.map((e,t)=>{let s=t{s&&k(t)},style:{minHeight:24},children:[(0,l.jsx)("span",{className:"text-sm",style:{fontWeight:d?600:500,color:d?"#1e293b":s?"#4f46e5":"#94a3b8"},children:e.title}),e.optional&&!d&&(0,l.jsx)("span",{className:"text-[11px] text-slate-400",children:"optional"}),s&&(0,l.jsx)("span",{className:"text-[11px] text-indigo-500 hover:underline",children:"Edit"})]}),d&&(0,l.jsx)("div",{className:"mt-3",children:(()=>{switch(S){case 0:return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:ev,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(eW,{value:e,label:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]}),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{optionLabelProp:"label",mode:"multiple",children:_?.supported_modes?.map(e=>(0,l.jsx)(eW,{value:e,label:e,children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:e}),"pre_call"===e&&(0,l.jsx)(o.Tag,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV[e]})]})},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eW,{value:"pre_call",label:"pre_call",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"pre_call"})," ",(0,l.jsx)(o.Tag,{color:"green",children:"Recommended"})]}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.pre_call})]})}),(0,l.jsx)(eW,{value:"during_call",label:"during_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"during_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.during_call})]})}),(0,l.jsx)(eW,{value:"post_call",label:"post_call",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"post_call"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.post_call})]})}),(0,l.jsx)(eW,{value:"logging_only",label:"logging_only",children:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"logging_only"})}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eV.logging_only})]})})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: omit role: system from guardrail evaluation input (OpenAI chat + Anthropic messages). The model still receives full messages. Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),!e_&&!ei(y)&&!es(y)&&(0,l.jsx)(ey,{selectedProvider:y,accessToken:a,providerParams:I})]});case 1:if(er(y))return _&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:ew,onActionSelect:eN,entityCategories:_.pii_entity_categories}):null;if(ei(y))return eA("categories");if(es(y))return(0,l.jsx)(eb,{availableModels:eg,form:x});if(!y)return null;if(e_)return(0,l.jsx)(eq,{value:ef,onChange:ej});if(!I)return null;console.log("guardrail_provider_map: ",ea),console.log("selectedProvider: ",y);let e=ea[y]?.toLowerCase(),t=I&&I[e];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null;case 2:if(ei(y))return eA("patterns");return null;case 3:if(ei(y))return eA("keywords");return null;case 4:return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Configure settings for a specific call type. Most guardrails don't need this — skip it unless you're using a specific endpoint like ",(0,l.jsx)("code",{children:"/v1/realtime"}),"."]})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Call type"}),(0,l.jsx)(n.Select,{placeholder:"Select a call type",value:W||void 0,onChange:e=>{V(e),ep(!1)},style:{width:260},allowClear:!0,options:[{value:"realtime",label:"/v1/realtime"}]}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"More call types coming soon."})]}),"realtime"===W&&(0,l.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>ep(e=>!e),className:"w-full flex items-center justify-between px-4 py-3 bg-gray-50 hover:bg-gray-100 text-sm font-medium text-gray-700",children:[(0,l.jsx)("span",{children:"/v1/realtime settings"}),(0,l.jsx)("svg",{className:`w-4 h-4 text-gray-500 transition-transform ${eu?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),eu&&(0,l.jsxs)("div",{className:"space-y-5 px-4 py-4 border-t border-gray-200",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"End session after X violations"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Automatically close the session after this many guardrail violations. Leave empty to never auto-close."}),(0,l.jsx)("input",{type:"number",min:1,placeholder:"e.g. 3",value:Y??"",onChange:e=>X(e.target.value?parseInt(e.target.value,10):void 0),className:"border border-gray-300 rounded px-3 py-1.5 text-sm w-32"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"On violation"}),(0,l.jsx)("div",{className:"space-y-2",children:["warn","end_session"].map(e=>(0,l.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"on_violation",value:e,checked:Z===e,onChange:()=>en(e),className:"mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"warn"===e?"Warn":"End session"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 m-0",children:"warn"===e?"Bot speaks the message, session continues":"Bot speaks the message, connection closes immediately"})]})]},e))})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Message the user hears"}),(0,l.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"What the bot says aloud when this guardrail fires. Falls back to the default violation message if empty."}),(0,l.jsx)("textarea",{rows:3,placeholder:"e.g. I'm not able to continue this conversation. Please contact us at 1-800-774-2678.",value:ed,onChange:e=>ec(e.target.value),className:"border border-gray-300 rounded px-3 py-2 text-sm w-full resize-none"})]})]})]})]});default:return null}})()})]})]},t)})})}),(0,l.jsxs)("div",{className:"flex items-center justify-end space-x-3 px-6 py-3 border-t border-gray-200",children:[(0,l.jsx)(c.Button,{onClick:ek,children:"Cancel"}),S>0&&(0,l.jsx)(c.Button,{onClick:()=>{k(S-1)},children:"Previous"}),S{let[x]=r.Form.useForm(),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)(g?.provider||null),[_,b]=(0,m.useState)(null),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({});(0,m.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);b(e)}catch(e){console.error("Error fetching guardrail settings:",e),u.default.fromBackend("Failed to load guardrail settings")}})()},[a]),(0,m.useEffect)(()=>{g?.pii_entities_config&&Object.keys(g.pii_entities_config).length>0&&(w(Object.keys(g.pii_entities_config)),C(g.pii_entities_config))},[g]);let S=e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},k=(e,t)=>{C(a=>({...a,[e]:t}))},I=async()=>{try{f(!0);let e=await x.validateFields(),l=ea[e.provider],r=c&&"object"==typeof c?{...c}:{};r.guardrail=l,r.mode=e.mode,r.default_on=e.default_on;let i=e.skip_system_message_choice;"yes"===i?r.skip_system_message_in_guardrail=!0:"no"===i?r.skip_system_message_in_guardrail=!1:delete r.skip_system_message_in_guardrail;let s={};if("PresidioPII"===e.provider&&v.length>0){let e={};v.forEach(t=>{e[t]=N[t]||"MASK"}),r.pii_entities_config=e}else if(e.config)try{let t=JSON.parse(e.config);"Bedrock"===e.provider&&t?(t.guardrail_id&&(r.guardrailIdentifier=t.guardrail_id),t.guardrail_version&&(r.guardrailVersion=t.guardrail_version)):s=t}catch(e){u.default.fromBackend("Invalid JSON in configuration"),f(!1);return}let n={guardrail_id:d,guardrail:{guardrail_name:e.guardrail_name,litellm_params:r,guardrail_info:s}};if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(n));let m=`/guardrails/${d}`,g=await fetch(m,{method:"PUT",headers:{[(0,p.getGlobalLitellmHeaderName)()]:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!g.ok){let e=await g.text();throw Error(e||"Failed to update guardrail")}u.default.success("Guardrail updated successfully"),o(),t()}catch(e){console.error("Failed to update guardrail:",e),u.default.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{f(!1)}};return(0,l.jsx)(s.Modal,{title:"Edit Guardrail",open:e,onCancel:t,footer:null,width:700,children:(0,l.jsxs)(r.Form,{form:x,layout:"vertical",initialValues:g,children:[(0,l.jsx)(r.Form.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,l.jsx)(tt.TextInput,{placeholder:"Enter a name for this guardrail"})}),(0,l.jsx)(r.Form.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,l.jsx)(n.Select,{placeholder:"Select a guardrail provider",onChange:e=>{j(e),x.setFieldsValue({config:void 0}),w([]),C({})},disabled:!0,optionLabelProp:"label",children:Object.entries(et()).map(([e,t])=>(0,l.jsx)(tr,{value:e,label:t,children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[eo[t]&&(0,l.jsx)("img",{src:eo[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,l.jsx)("span",{children:t})]})},e))})}),(0,l.jsx)(r.Form.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,l.jsx)(n.Select,{children:_?.supported_modes?.map(e=>(0,l.jsx)(tr,{value:e,children:e},e))||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tr,{value:"pre_call",children:"pre_call"}),(0,l.jsx)(tr,{value:"post_call",children:"post_call"})]})})}),(0,l.jsx)(r.Form.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,l.jsx)(D.Switch,{})}),(0,l.jsx)(r.Form.Item,{name:"skip_system_message_choice",label:"Skip system messages in guardrail",tooltip:"Unified guardrails only: whether role: system content is omitted from guardrail input (LLM still receives full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(tr,{value:"inherit",children:"Use global default"}),(0,l.jsx)(tr,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(tr,{value:"no",children:"No — always include in scan"})]})}),(()=>{if(!y)return null;if("PresidioPII"===y)return _&&y&&"PresidioPII"===y?(0,l.jsx)(eE,{entities:_.supported_entities,actions:_.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:S,onActionSelect:k,entityCategories:_.pii_entity_categories}):null;switch(y){case"Aporia":return(0,l.jsx)(r.Form.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_aporia_api_key",
+ "project_name": "your_project_name"
+}`})});case"AimSecurity":return(0,l.jsx)(r.Form.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_aim_api_key"
+}`})});case"Bedrock":return(0,l.jsx)(r.Form.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "guardrail_id": "your_guardrail_id",
+ "guardrail_version": "your_guardrail_version"
+}`})});case"GuardrailsAI":return(0,l.jsx)(r.Form.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_guardrails_api_key",
+ "guardrail_id": "your_guardrail_id"
+}`})});case"LakeraAI":return(0,l.jsx)(r.Form.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "api_key": "your_lakera_api_key"
+}`})});case"PromptInjection":return(0,l.jsx)(r.Form.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "threshold": 0.8
+}`})});default:return(0,l.jsx)(r.Form.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,l.jsx)(i.Input.TextArea,{rows:4,placeholder:`{
+ "key1": "value1",
+ "key2": "value2"
+}`})})}})(),(0,l.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:I,loading:h,children:"Update Guardrail"})]})]})})};var ts=((a={}).DB="db",a.CONFIG="config",a);e.s(["default",0,({guardrailsList:e,isLoading:t,onDeleteClick:a,accessToken:r,onGuardrailUpdated:i,isAdmin:s=!1,onGuardrailClick:n})=>{let[o,d]=(0,m.useState)([{id:"created_at",desc:!0}]),[c,u]=(0,m.useState)(!1),[p,g]=(0,m.useState)(null),x=e=>e?new Date(e).toLocaleString():"-",h=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,l.jsx)(ej.Tooltip,{title:String(e.getValue()||""),children:(0,l.jsx)(e4.Button,{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 overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?`${String(e.getValue()).slice(0,7)}...`:""})})},{header:"Name",accessorKey:"guardrail_name",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.guardrail_name,children:(0,l.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:({row:e})=>{let{logo:t,displayName:a}=ed(e.original.litellm_params.guardrail);return(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,l.jsx)("img",{src:t,alt:`${a} logo`,className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)("span",{className:"text-xs",children:a})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:({row:e})=>{let t=e.original;return(0,l.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(e7.Badge,{color:t.litellm_params?.default_on?"green":"gray",className:"text-xs font-normal",size:"xs",children:t.litellm_params?.default_on?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.created_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:({row:e})=>{let t=e.original;return(0,l.jsx)(ej.Tooltip,{title:t.updated_at,children:(0,l.jsx)("span",{className:"text-xs",children:x(t.updated_at)})})}},{id:"actions",header:"Actions",cell:({row:e})=>{let t=e.original,r=t.guardrail_definition_location===ts.CONFIG;return(0,l.jsx)("div",{className:"flex space-x-2",children:r?(0,l.jsx)(ej.Tooltip,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,l.jsx)(e2.Icon,{"data-testid":"config-delete-icon",icon:e5.TrashIcon,size:"sm",className:"cursor-not-allowed text-gray-400",title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.","aria-label":"Delete guardrail (config)"})}):(0,l.jsx)(ej.Tooltip,{title:"Delete guardrail",children:(0,l.jsx)(e2.Icon,{icon:e5.TrashIcon,size:"sm",onClick:()=>t.guardrail_id&&a(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],f=(0,e9.useReactTable)({data:e,columns:h,state:{sorting:o},onSortingChange:d,getCoreRowModel:(0,te.getCoreRowModel)(),getSortedRowModel:(0,te.getSortedRowModel)(),enableSorting:!0});return(0,l.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)(eY.Table,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,l.jsx)(eZ.TableHead,{children:f.getHeaderGroups().map(e=>(0,l.jsx)(e1.TableRow,{children:e.headers.map(e=>(0,l.jsx)(e0.TableHeaderCell,{className:`py-1 h-8 ${"actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,onClick:e.column.getToggleSortingHandler(),children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,e9.flexRender)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,l.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,l.jsx)(e8.ChevronUpIcon,{className:"h-4 w-4 text-blue-500"}),desc:(0,l.jsx)(e3.ChevronDownIcon,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,l.jsx)(e6.SwitchVerticalIcon,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,l.jsx)(eQ.TableBody,{children:t?(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eX.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"Loading..."})})})}):e.length>0?f.getRowModel().rows.map(e=>(0,l.jsx)(e1.TableRow,{className:"h-8",children:e.getVisibleCells().map(e=>(0,l.jsx)(eX.TableCell,{className:`py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ${"actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""}`,children:(0,e9.flexRender)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,l.jsx)(e1.TableRow,{children:(0,l.jsx)(eX.TableCell,{colSpan:h.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"No guardrails found"})})})})})]})}),p&&(0,l.jsx)(ti,{visible:c,onClose:()=>u(!1),accessToken:r,onSuccess:()=>{u(!1),g(null),i()},guardrailId:p.guardrail_id||"",fullLitellmParams:p.litellm_params,initialValues:{guardrail_name:p.guardrail_name||"",provider:Object.keys(ea).find(e=>ea[e]===p?.litellm_params.guardrail)||"",mode:p.litellm_params.mode,default_on:p.litellm_params.default_on,pii_entities_config:p.litellm_params.pii_entities_config,skip_system_message_choice:ec(p.litellm_params?.skip_system_message_in_guardrail),...p.guardrail_info}})]})}],782719);var tn=e.i(500330),to=e.i(245094),eN=eN,td=e.i(530212),tc=e.i(350967),tm=e.i(197647),tu=e.i(653824),tp=e.i(881073),tg=e.i(404206),tx=e.i(723731),th=e.i(629569),tf=e.i(678784),ty=e.i(118366),tj=e.i(560445);let{Text:t_}=d.Typography,{Option:tb}=n.Select,tv=({categories:e,onActionChange:t,onSeverityChange:a,onRemove:r,readOnly:i=!1})=>{let s=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(t_,{strong:!0,children:e}),e!==t.category&&(0,l.jsx)("div",{children:(0,l.jsx)(t_,{type:"secondary",style:{fontSize:12},children:t.category})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,t)=>i?(0,l.jsx)(o.Tag,{color:{high:"red",medium:"orange",low:"yellow"}[e],children:e.toUpperCase()}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>a?.(t.id,e),style:{width:150},size:"small",children:[(0,l.jsx)(tb,{value:"high",children:"High"}),(0,l.jsx)(tb,{value:"medium",children:"Medium"}),(0,l.jsx)(tb,{value:"low",children:"Low"})]})},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,a)=>i?(0,l.jsx)(o.Tag,{color:"BLOCK"===e?"red":"blue",children:e}):(0,l.jsxs)(n.Select,{value:e,onChange:e=>t?.(a.id,e),style:{width:120},size:"small",children:[(0,l.jsx)(tb,{value:"BLOCK",children:"Block"}),(0,l.jsx)(tb,{value:"MASK",children:"Mask"})]})}];return(i||s.push({title:"",key:"actions",width:100,render:(e,t)=>(0,l.jsx)(c.Button,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(A.DeleteOutlined,{}),onClick:()=>r?.(t.id),children:"Delete"})}),0===e.length)?(0,l.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No categories configured."}):(0,l.jsx)(I.Table,{dataSource:e,columns:s,rowKey:"id",pagination:!1,size:"small"})},tw=({patterns:e,blockedWords:t,categories:a=[],readOnly:r=!0,onPatternActionChange:i,onPatternRemove:s,onBlockedWordUpdate:n,onBlockedWordRemove:o,onCategoryActionChange:d,onCategorySeverityChange:c,onCategoryRemove:m})=>{if(0===e.length&&0===t.length&&0===a.length)return null;let u=()=>{};return(0,l.jsxs)(l.Fragment,{children:[a.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Content Categories"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[a.length," categories configured"]})]}),(0,l.jsx)(tv,{categories:a,onActionChange:r?void 0:d,onSeverityChange:r?void 0:c,onRemove:r?void 0:m,readOnly:r})]}),e.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[e.length," patterns configured"]})]}),(0,l.jsx)(T,{patterns:e,onActionChange:r?u:i||u,onRemove:r?u:s||u})]}),t.length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(eR.Text,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[t.length," keywords configured"]})]}),(0,l.jsx)(F,{keywords:t,onActionChange:r?u:n||u,onRemove:r?u:o||u})]})]})},{Text:tN}=d.Typography,tC=({guardrailData:e,guardrailSettings:t,isEditing:a,accessToken:r,onDataChange:i,onUnsavedChanges:s})=>{let[n,o]=(0,m.useState)([]),[d,c]=(0,m.useState)([]),[u,p]=(0,m.useState)([]),[g,x]=(0,m.useState)([]),[h,f]=(0,m.useState)([]),[y,j]=(0,m.useState)([]),[_,b]=(0,m.useState)(!1),[v,w]=(0,m.useState)(null),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(e?.litellm_params?.patterns){let t=e.litellm_params.patterns.map((e,t)=>({id:`pattern-${t}`,type:"prebuilt"===e.pattern_type?"prebuilt":"custom",name:e.pattern_name||e.name,display_name:e.display_name,pattern:e.pattern,action:e.action||"BLOCK"}));o(t),x(t)}else o([]),x([]);if(e?.litellm_params?.blocked_words){let t=e.litellm_params.blocked_words.map((e,t)=>({id:`word-${t}`,keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));c(t),f(t)}else c([]),f([]);if(e?.litellm_params?.categories?.length>0){let a=t?.content_filter_settings?.content_categories?Object.fromEntries(t.content_filter_settings.content_categories.map(e=>[e.name,e])):{},l=e.litellm_params.categories.map((e,t)=>{let l=a[e.category];return{id:`category-${t}`,category:e.category,display_name:l?.display_name??e.category,action:e.action||"BLOCK",severity_threshold:e.severity_threshold||"medium"}});p(l),j(l)}else p([]),j([]);let a=e?.litellm_params?.competitor_intent_config;if(a&&"object"==typeof a){let e=!!(a.brand_self&&Array.isArray(a.brand_self)&&a.brand_self.length>0),t={competitor_intent_type:a.competitor_intent_type??"airline",brand_self:Array.isArray(a.brand_self)?a.brand_self:[],locations:Array.isArray(a.locations)?a.locations:[],competitors:Array.isArray(a.competitors)?a.competitors:[],policy:a.policy??{competitor_comparison:"refuse",possible_competitor_comparison:"reframe"},threshold_high:"number"==typeof a.threshold_high?a.threshold_high:.7,threshold_medium:"number"==typeof a.threshold_medium?a.threshold_medium:.45,threshold_low:"number"==typeof a.threshold_low?a.threshold_low:.3};b(e),w(t),C(e),k(t)}else b(!1),w(null),C(!1),k(null)},[e,t?.content_filter_settings?.content_categories]),(0,m.useEffect)(()=>{i&&i(n,d,u,_,v)},[n,d,u,_,v,i]);let I=m.default.useMemo(()=>{let e=JSON.stringify(n)!==JSON.stringify(g),t=JSON.stringify(d)!==JSON.stringify(h),a=JSON.stringify(u)!==JSON.stringify(y),l=_!==N||JSON.stringify(v)!==JSON.stringify(S);return e||t||a||l},[n,d,u,_,v,g,h,y,N,S]);return((0,m.useEffect)(()=>{a&&s&&s(I)},[I,a,s]),e?.litellm_params?.guardrail!=="litellm_content_filter")?null:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"Content Filter Configuration"}),I&&(0,l.jsx)(tj.Alert,{type:"warning",showIcon:!0,className:"mb-4",message:(0,l.jsx)(tN,{children:'You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,l.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,l.jsx)(Q,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:n,blockedWords:d,onPatternAdd:e=>o([...n,e]),onPatternRemove:e=>o(n.filter(t=>t.id!==e)),onPatternActionChange:(e,t)=>o(n.map(a=>a.id===e?{...a,action:t}:a)),onBlockedWordAdd:e=>c([...d,e]),onBlockedWordRemove:e=>c(d.filter(t=>t.id!==e)),onBlockedWordUpdate:(e,t,a)=>c(d.map(l=>l.id===e?{...l,[t]:a}:l)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r,contentCategories:t.content_filter_settings.content_categories||[],selectedContentCategories:u,onContentCategoryAdd:e=>p([...u,e]),onContentCategoryRemove:e=>p(u.filter(t=>t.id!==e)),onContentCategoryUpdate:(e,t,a)=>p(u.map(l=>l.id===e?{...l,[t]:a}:l)),competitorIntentEnabled:_,competitorIntentConfig:v,onCompetitorIntentChange:(e,t)=>{b(e),w(t)}})})]}):(0,l.jsx)(tw,{patterns:n,blockedWords:d,categories:u,readOnly:!0})};var tS=e.i(788191),tk=e.i(245704),tI=e.i(518617);let tA={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};var tO=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tA}))}),tP=e.i(987432);let tT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M892 772h-80v-80c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v80h-80c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h80v80c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-80h80c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM373.5 498.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.8-1.7-203.2 89.2-203.2 200 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.8-1.1 6.4-4.8 5.9-8.8zM824 472c0-109.4-87.9-198.3-196.9-200C516.3 270.3 424 361.2 424 472c0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C357 742.6 326 814.8 324 891.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.5C505.8 695.7 563 672 624 672c110.4 0 200-89.5 200-200zm-109.5 90.5C690.3 586.7 658.2 600 624 600s-66.3-13.3-90.5-37.5a127.26 127.26 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-.1 34.2-13.4 66.3-37.6 90.5z"}}]},name:"usergroup-add",theme:"outlined"};var tL=m.forwardRef(function(e,t){return m.createElement(eI.default,(0,eS.default)({},e,{ref:t,icon:tT}))}),tB=e.i(872934);let{Panel:tF}=$.Collapse,{TextArea:t$}=i.Input,tE={empty:{name:"Empty Template",code:`async def apply_guardrail(inputs, request_data, input_type):
+ # inputs: {texts, images, tools, tool_calls, structured_messages, model}
+ # request_data: {model, user_id, team_id, end_user_id, metadata}
+ # input_type: "request" or "response"
+ return allow()`},blockSSN:{name:"Block SSN",code:`def apply_guardrail(inputs, request_data, input_type):
+ for text in inputs["texts"]:
+ if regex_match(text, r"\\d{3}-\\d{2}-\\d{4}"):
+ return block("SSN detected")
+ return allow()`},redactEmail:{name:"Redact Emails",code:`def apply_guardrail(inputs, request_data, input_type):
+ pattern = r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
+ modified = []
+ for text in inputs["texts"]:
+ modified.append(regex_replace(text, pattern, "[EMAIL REDACTED]"))
+ return modify(texts=modified)`},blockSQL:{name:"Block SQL Injection",code:`def apply_guardrail(inputs, request_data, input_type):
+ if input_type != "request":
+ return allow()
+ for text in inputs["texts"]:
+ if contains_code_language(text, ["sql"]):
+ return block("SQL code not allowed")
+ return allow()`},validateJSON:{name:"Validate JSON",code:`def apply_guardrail(inputs, request_data, input_type):
+ if input_type != "response":
+ return allow()
+
+ schema = {"type": "object", "required": ["name", "value"]}
+
+ for text in inputs["texts"]:
+ obj = json_parse(text)
+ if obj is None:
+ return block("Invalid JSON response")
+ if not json_schema_valid(obj, schema):
+ return block("Response missing required fields")
+ return allow()`},externalAPI:{name:"External API Check (async)",code:`async def apply_guardrail(inputs, request_data, input_type):
+ # Call an external moderation API (async for non-blocking)
+ for text in inputs["texts"]:
+ response = await http_post(
+ "https://api.example.com/moderate",
+ body={"text": text, "user_id": request_data["user_id"]},
+ headers={"Authorization": "Bearer YOUR_API_KEY"},
+ timeout=10
+ )
+
+ if not response["success"]:
+ # API call failed, allow by default or block
+ return allow()
+
+ if response["body"].get("flagged"):
+ return block(response["body"].get("reason", "Content flagged"))
+
+ return allow()`}},tM={"Return Values":[{name:"allow()",desc:"Let request/response through"},{name:"block(reason)",desc:"Reject with message"},{name:"modify(texts=[], images=[], tool_calls=[])",desc:"Transform content"}],"HTTP Requests (async)":[{name:"await http_request(url, method, headers, body)",desc:"Make async HTTP request"},{name:"await http_get(url, headers)",desc:"Async GET request"},{name:"await http_post(url, body, headers)",desc:"Async POST request"}],"Regex Functions":[{name:"regex_match(text, pattern)",desc:"Returns True if pattern found"},{name:"regex_replace(text, pattern, replacement)",desc:"Replace all matches"},{name:"regex_find_all(text, pattern)",desc:"Return list of matches"}],"JSON Functions":[{name:"json_parse(text)",desc:"Parse JSON string, returns None on error"},{name:"json_stringify(obj)",desc:"Convert to JSON string"},{name:"json_schema_valid(obj, schema)",desc:"Validate against JSON schema"}],"URL Functions":[{name:"extract_urls(text)",desc:"Extract all URLs from text"},{name:"is_valid_url(url)",desc:"Check if URL is valid"},{name:"all_urls_valid(text)",desc:"Check all URLs in text are valid"}],"Code Detection":[{name:"detect_code(text)",desc:"Returns True if code detected"},{name:"detect_code_languages(text)",desc:"Returns list of detected languages"},{name:'contains_code_language(text, ["sql"])',desc:"Check for specific languages"}],"Text Utilities":[{name:"contains(text, substring)",desc:"Check if substring exists"},{name:"contains_any(text, [substr1, substr2])",desc:"Check if any substring exists"},{name:"word_count(text)",desc:"Count words"},{name:"char_count(text)",desc:"Count characters"},{name:"lower(text) / upper(text) / trim(text)",desc:"String transforms"}]},tR=[{value:"pre_call",label:"pre_call (Request)"},{value:"post_call",label:"post_call (Response)"},{value:"during_call",label:"during_call (Parallel)"},{value:"logging_only",label:"logging_only"},{value:"pre_mcp_call",label:"pre_mcp_call (Before MCP Tool Call)"},{value:"post_mcp_call",label:"post_mcp_call (After MCP Tool Call)"},{value:"during_mcp_call",label:"during_mcp_call (During MCP Tool Call)"}],tG=({visible:e,onClose:t,onSuccess:a,accessToken:r,editData:i})=>{let o=!!i,[d,c]=(0,m.useState)(""),[g,x]=(0,m.useState)(["pre_call"]),[h,f]=(0,m.useState)(!1),[y,j]=(0,m.useState)("empty"),[_,b]=(0,m.useState)(tE.empty.code),[v,w]=(0,m.useState)(!1),[N,C]=(0,m.useState)(!1),[S,k]=(0,m.useState)(!1),I={texts:["Hello, my SSN is 123-45-6789"],images:[],tools:[{type:"function",function:{name:"get_weather",description:"Get the current weather in a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"}},required:["location"]}}}],tool_calls:[],structured_messages:[{role:"system",content:"You are a helpful assistant."},{role:"user",content:"Hello, my SSN is 123-45-6789"}],model:"gpt-4"},A={texts:["The weather in San Francisco is 72°F and sunny."],images:[],tools:[],tool_calls:[{id:"call_abc123",type:"function",function:{name:"get_weather",arguments:'{"location": "San Francisco"}'}}],structured_messages:[],model:"gpt-4"},O={texts:['Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'],images:[],tools:[{type:"function",function:{name:"read_wiki_structure",description:"Read the structure of a GitHub repository (MCP tool passed as OpenAI tool)",parameters:{type:"object",properties:{repoName:{type:"string",description:"Repository name, e.g. BerriAI/litellm"}},required:["repoName"]}}}],tool_calls:[{id:"call_mcp_001",type:"function",function:{name:"read_wiki_structure",arguments:'{"repoName": "BerriAI/litellm"}'}}],structured_messages:[{role:"user",content:'Tool: read_wiki_structure\nArguments: {"repoName": "BerriAI/litellm"}'}],model:"mcp-tool-call"},[P,T]=(0,m.useState)(JSON.stringify(I,null,2)),[L,B]=(0,m.useState)(null),[F,E]=(0,m.useState)(null),M=(0,m.useRef)(null),R=e=>null==e?["pre_call"]:Array.isArray(e)?e.length?e:["pre_call"]:[e];(0,m.useEffect)(()=>{e&&(i?(c(i.guardrail_name||""),x(R(i.litellm_params?.mode)),f(i.litellm_params?.default_on||!1),b(i.litellm_params?.custom_code||tE.empty.code),j("")):(c(""),x(["pre_call"]),f(!1),j("empty"),b(tE.empty.code)),B(null),k(!1))},[e,i]);let G=async e=>{try{await navigator.clipboard.writeText(e),E(e),setTimeout(()=>E(null),2e3)}catch(e){console.error("Failed to copy:",e)}},z=async()=>{if(!d.trim())return void u.default.fromBackend("Please enter a guardrail name");if(!_.trim())return void u.default.fromBackend("Please enter custom code");if(!r)return void u.default.fromBackend("No access token available");w(!0);try{if(o&&i){let e={litellm_params:{custom_code:_}};d!==i.guardrail_name&&(e.guardrail_name=d);let t=R(i.litellm_params?.mode);(g.length!==t.length||g.some((e,a)=>e!==t[a]))&&(e.litellm_params.mode=g),h!==i.litellm_params?.default_on&&(e.litellm_params.default_on=h),await (0,p.updateGuardrailCall)(r,i.guardrail_id,e),u.default.success("Custom code guardrail updated successfully")}else await (0,p.createGuardrailCall)(r,{guardrail_name:d,litellm_params:{guardrail:"custom_code",mode:g,default_on:h,custom_code:_},guardrail_info:{}}),u.default.success("Custom code guardrail created successfully");a(),t()}catch(e){console.error("Failed to save guardrail:",e),u.default.fromBackend(`Failed to ${o?"update":"create"} guardrail: `+(e instanceof Error?e.message:String(e)))}finally{w(!1)}},K=async()=>{if(!r)return void B({error:"No access token available"});C(!0),B(null);try{let e;try{e=JSON.parse(P)}catch(e){B({error:"Invalid test input JSON"}),C(!1);return}e.texts||(e.texts=[]);let t=["pre_call","pre_mcp_call"],a=["post_call","post_mcp_call"],l=g.some(e=>t.includes(e))?"request":g.some(e=>a.includes(e))?"response":"request",i=await (0,p.testCustomCodeGuardrail)(r,{custom_code:_,test_input:e,input_type:l,request_data:{model:"test-model",metadata:{}}});i.success&&i.result?B(i.result):i.error?B({error:i.error,error_type:i.error_type}):B({error:"Unknown error occurred"})}catch(e){console.error("Failed to test custom code:",e),B({error:e instanceof Error?e.message:"Failed to test custom code"})}finally{C(!1)}},q=_.split("\n").length;return(0,l.jsxs)(s.Modal,{open:e,onCancel:t,footer:null,width:1400,className:"custom-code-modal",closable:!0,destroyOnClose:!0,children:[(0,l.jsxs)("div",{className:"flex flex-col h-[80vh]",children:[(0,l.jsxs)("div",{className:"pb-4 border-b border-gray-200",children:[(0,l.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:o?"Edit Custom Guardrail":"Create Custom Guardrail"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Define custom logic using Python-like syntax"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4 py-4 border-b border-gray-100",children:[(0,l.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Guardrail Name"}),(0,l.jsx)(tt.TextInput,{value:d,onValueChange:c,placeholder:"e.g., block-pii-custom"})]}),(0,l.jsxs)("div",{className:"w-[280px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Mode (can select multiple)"}),(0,l.jsx)(n.Select,{mode:"multiple",value:g,onChange:x,options:tR,className:"w-full",size:"middle",placeholder:"Select modes"})]}),(0,l.jsxs)("div",{className:"w-[180px]",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Template"}),(0,l.jsx)(n.Select,{value:y,onChange:e=>{j(e),b(tE[e].code)},className:"w-full",size:"middle",dropdownRender:e=>(0,l.jsxs)(l.Fragment,{children:[e,(0,l.jsx)(eG.Divider,{style:{margin:"8px 0"}}),(0,l.jsxs)("div",{style:{padding:"8px 12px",cursor:"pointer",color:"#1890ff",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},onClick:e=>{e.preventDefault(),window.open("https://models.litellm.ai/guardrails","_blank")},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f0f0f0"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,l.jsx)(tL,{}),(0,l.jsx)("span",{children:"Browse Community templates"}),(0,l.jsx)(tB.ExportOutlined,{style:{fontSize:"10px"}})]})]}),children:(0,l.jsx)(n.Select.OptGroup,{label:"STANDARD",children:Object.entries(tE).map(([e,t])=>(0,l.jsx)(n.Select.Option,{value:e,children:t.name},e))})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pt-5",children:[(0,l.jsx)("span",{className:"text-sm text-gray-600",children:"Default On"}),(0,l.jsx)(D.Switch,{checked:h,onChange:f})]})]}),(0,l.jsxs)("div",{className:"flex flex-1 overflow-hidden mt-4 gap-6",children:[(0,l.jsxs)("div",{className:"flex-[2] flex flex-col min-w-0 overflow-y-auto",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2 flex-shrink-0",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Python Logic"}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Restricted environment (no imports)"})]}),(0,l.jsxs)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e] flex-shrink-0",style:{minHeight:"300px",maxHeight:"400px"},children:[(0,l.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-12 bg-[#1e1e1e] border-r border-gray-700 text-right pr-3 pt-3 select-none overflow-hidden",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6"},children:Array.from({length:Math.max(q,20)},(e,t)=>(0,l.jsx)("div",{className:"text-gray-500 h-[22.4px]",children:t+1},t+1))}),(0,l.jsx)("textarea",{ref:M,value:_,onChange:e=>b(e.target.value),onKeyDown:e=>{if("Tab"===e.key){e.preventDefault();let t=e.currentTarget,a=t.selectionStart,l=t.selectionEnd;b(_.substring(0,a)+" "+_.substring(l)),setTimeout(()=>{t.selectionStart=t.selectionEnd=a+4},0)}},spellCheck:!1,className:"w-full h-full pl-14 pr-4 pt-3 pb-3 resize-none focus:outline-none bg-transparent text-gray-200",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace",fontSize:"14px",lineHeight:"1.6",tabSize:4}})]}),(0,l.jsx)($.Collapse,{activeKey:S?["test"]:[],onChange:e=>k(e.includes("test")),className:"mt-3 bg-white border border-gray-200 rounded-lg flex-shrink-0",expandIcon:({isActive:e})=>(0,l.jsx)(tO,{rotate:90*!!e}),children:(0,l.jsx)(tF,{header:(0,l.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,l.jsx)(tS.PlayCircleOutlined,{className:"text-blue-500"}),"Test Your Guardrail"]}),children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("label",{className:"block text-xs font-medium text-gray-600",children:"Test Input (JSON)"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs text-gray-500",children:"Load example:"}),(0,l.jsx)("button",{type:"button",onClick:()=>T(JSON.stringify(I,null,2)),className:"px-2 py-1 text-xs rounded border border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 transition-colors",children:"Pre-call"}),(0,l.jsx)("button",{type:"button",onClick:()=>T(JSON.stringify(O,null,2)),className:"px-2 py-1 text-xs rounded border border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 transition-colors",children:"Pre MCP"}),(0,l.jsx)("button",{type:"button",onClick:()=>T(JSON.stringify(A,null,2)),className:"px-2 py-1 text-xs rounded border border-green-200 bg-green-50 text-green-700 hover:bg-green-100 transition-colors",children:"Post-call"})]})]}),(0,l.jsx)("div",{className:"mb-2 p-2 bg-gray-50 rounded text-xs text-gray-600 border border-gray-200",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"texts"}),": Message content (always)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"images"}),": Base64 images (vision)"]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tools"}),": Tool definitions ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"}),", MCP as OpenAI tool ",(0,l.jsx)("span",{className:"text-purple-600",children:"(pre_mcp_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"tool_calls"}),": LLM tool calls ",(0,l.jsx)("span",{className:"text-green-600",children:"(post_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"structured_messages"}),": Full messages ",(0,l.jsx)("span",{className:"text-orange-600",children:"(pre_call)"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"model"}),": Model name (always)"]})]})}),(0,l.jsx)(t$,{value:P,onChange:e=>T(e.target.value),rows:8,className:"font-mono text-xs",placeholder:'{"texts": ["test message"], ...}'})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{size:"xs",onClick:K,disabled:N,icon:tS.PlayCircleOutlined,children:N?"Running...":"Run Test"}),L&&(0,l.jsx)("div",{className:`flex items-center gap-2 text-sm ${L.error?"text-red-600":"allow"===L.action?"text-green-600":"block"===L.action?"text-orange-600":"text-blue-600"}`,children:L.error?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{}),(0,l.jsxs)("span",{children:[L.error_type&&(0,l.jsxs)("span",{className:"font-medium",children:["[",L.error_type,"] "]}),L.error]})]}):"allow"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Allowed"]}):"block"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tI.CloseCircleOutlined,{})," Blocked: ",L.reason]}):"modify"===L.action?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Modified",L.texts&&L.texts.length>0&&(0,l.jsxs)("span",{className:"text-xs text-gray-500 ml-1",children:["→ ",L.texts[0].substring(0,50),L.texts[0].length>50?"...":""]})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," ",L.action||"Unknown"]})})]})]})},"test")}),(0,l.jsxs)("div",{className:"mt-3 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-lg flex items-center justify-between flex-shrink-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"bg-blue-100 rounded-full p-2",children:(0,l.jsx)(tL,{className:"text-blue-600 text-lg"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm font-medium text-gray-900",children:"Built a useful guardrail?"}),(0,l.jsx)("div",{className:"text-xs text-gray-600",children:"Share it with the community and help others build faster"})]})]}),(0,l.jsx)(e4.Button,{size:"xs",onClick:()=>window.open("https://github.com/BerriAI/litellm-guardrails","_blank"),icon:tB.ExportOutlined,className:"bg-blue-600 hover:bg-blue-700 text-white border-0",children:"Contribute Template"})]})]}),(0,l.jsxs)("div",{className:"w-[300px] flex-shrink-0 overflow-auto border-l border-gray-200 pl-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)("span",{className:"font-semibold text-gray-700",children:"Available Primitives"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Click to copy functions to clipboard"}),(0,l.jsx)($.Collapse,{defaultActiveKey:["Return Values"],className:"primitives-collapse bg-transparent border-0",expandIconPosition:"end",children:Object.entries(tM).map(([e,t])=>(0,l.jsx)(tF,{header:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e}),className:"bg-white mb-2 rounded-lg border border-gray-200",children:(0,l.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,l.jsx)("button",{onClick:()=>G(e.name),className:`w-full text-left px-2 py-2 rounded transition-colors ${F===e.name?"bg-green-100":"bg-gray-50 hover:bg-blue-50"}`,children:F===e.name?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-xs font-mono text-green-700",children:[(0,l.jsx)(tk.CheckCircleOutlined,{})," Copied!"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-xs font-mono text-gray-800",children:e.name}),(0,l.jsx)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:e.desc})]})},e.name))})},e))})]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-gray-200",children:[(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Changes are auto-saved to local draft"}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)(e4.Button,{variant:"secondary",onClick:t,children:"Cancel"}),(0,l.jsx)(e4.Button,{onClick:z,loading:v,disabled:v||!d.trim(),icon:tP.SaveOutlined,children:o?"Update Guardrail":"Save Guardrail"})]})]})]}),(0,l.jsx)("style",{children:`
+ .custom-code-modal .ant-modal-content {
+ padding: 24px;
+ }
+ .custom-code-modal .ant-modal-close {
+ top: 20px;
+ right: 20px;
+ }
+ .primitives-collapse .ant-collapse-item {
+ border: none !important;
+ }
+ .primitives-collapse .ant-collapse-header {
+ padding: 8px 12px !important;
+ }
+ .primitives-collapse .ant-collapse-content-box {
+ padding: 8px 12px !important;
+ }
+ `})]})};e.s(["default",0,({guardrailId:e,onClose:t,accessToken:a,isAdmin:s})=>{let o,[d,g]=(0,m.useState)(null),[x,h]=(0,m.useState)(null),[f,y]=(0,m.useState)(!0),[j,_]=(0,m.useState)(!1),[b]=r.Form.useForm(),[v,w]=(0,m.useState)([]),[N,C]=(0,m.useState)({}),[S,k]=(0,m.useState)(null),[I,A]=(0,m.useState)({}),[O,P]=(0,m.useState)(!1),T={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[L,B]=(0,m.useState)(T),[F,$]=(0,m.useState)(!1),[E,M]=(0,m.useState)(!1),R=m.default.useRef({patterns:[],blockedWords:[],categories:[]}),G=(0,m.useCallback)((e,t,a,l,r)=>{R.current={patterns:e,blockedWords:t,categories:a||[],competitorIntentEnabled:l,competitorIntentConfig:r}},[]),z=async()=>{try{if(y(!0),!a)return;let t=await (0,p.getGuardrailInfo)(a,e);if(g(t),t.litellm_params?.pii_entities_config){let e=t.litellm_params.pii_entities_config;if(w([]),C({}),Object.keys(e).length>0){let t=[],a={};Object.entries(e).forEach(([e,l])=>{t.push(e),a[e]="string"==typeof l?l:"MASK"}),w(t),C(a)}}else w([]),C({})}catch(e){u.default.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{y(!1)}},D=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailProviderSpecificParams)(a);h(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},K=async()=>{try{if(!a)return;let e=await (0,p.getGuardrailUISettings)(a);k(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,m.useEffect)(()=>{D()},[a]),(0,m.useEffect)(()=>{z(),K()},[e,a]),(0,m.useEffect)(()=>{if(d&&b){let e={...d.litellm_params||{}};delete e.skip_system_message_in_guardrail,b.setFieldsValue({guardrail_name:d.guardrail_name,...e,skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}})}},[d,x,b]);let q=(0,m.useCallback)(()=>{d?.litellm_params?.guardrail==="tool_permission"?B({rules:d.litellm_params?.rules||[],default_action:(d.litellm_params?.default_action||"deny").toLowerCase(),on_disallowed_action:(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),violation_message_template:d.litellm_params?.violation_message_template||""}):B(T),$(!1)},[d]);(0,m.useEffect)(()=>{q()},[q]);let H=async t=>{try{if(!a)return;let o={litellm_params:{}};t.guardrail_name!==d.guardrail_name&&(o.guardrail_name=t.guardrail_name),t.default_on!==d.litellm_params?.default_on&&(o.litellm_params.default_on=t.default_on);let c=ec(d.litellm_params?.skip_system_message_in_guardrail),m=t.skip_system_message_choice;void 0!==m&&m!==c&&("inherit"===m?o.litellm_params.skip_system_message_in_guardrail=null:"yes"===m?o.litellm_params.skip_system_message_in_guardrail=!0:o.litellm_params.skip_system_message_in_guardrail=!1);let g=d.guardrail_info,h=t.guardrail_info?JSON.parse(t.guardrail_info):void 0;JSON.stringify(g)!==JSON.stringify(h)&&(o.guardrail_info=h);let f=d.litellm_params?.pii_entities_config||{},y={};if(v.forEach(e=>{y[e]=N[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(y)&&(o.litellm_params.pii_entities_config=y),d.litellm_params?.guardrail==="litellm_content_filter"&&O){var l,r,i,s,n;let e,t=(l=R.current.patterns||[],r=R.current.blockedWords||[],i=R.current.categories||[],s=R.current.competitorIntentEnabled,n=R.current.competitorIntentConfig,e={patterns:l.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action})),blocked_words:r.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))},void 0!==i&&(e.categories=i.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"}))),s&&n&&n.brand_self.length>0&&(e.competitor_intent_config={competitor_intent_type:n.competitor_intent_type,brand_self:n.brand_self,locations:n.locations?.length?n.locations:void 0,competitors:"generic"===n.competitor_intent_type&&n.competitors?.length?n.competitors:void 0,policy:n.policy,threshold_high:n.threshold_high,threshold_medium:n.threshold_medium,threshold_low:n.threshold_low}),e);o.litellm_params.patterns=t.patterns,o.litellm_params.blocked_words=t.blocked_words,o.litellm_params.categories=t.categories,o.litellm_params.competitor_intent_config=t.competitor_intent_config??null}if(d.litellm_params?.guardrail==="tool_permission"){let e=d.litellm_params?.rules||[],t=L.rules||[],a=JSON.stringify(e)!==JSON.stringify(t),l=(d.litellm_params?.default_action||"deny").toLowerCase(),r=(L.default_action||"deny").toLowerCase(),i=l!==r,s=(d.litellm_params?.on_disallowed_action||"block").toLowerCase(),n=(L.on_disallowed_action||"block").toLowerCase(),c=s!==n,m=d.litellm_params?.violation_message_template||"",u=L.violation_message_template||"",p=m!==u;(F||a||i||c||p)&&(o.litellm_params.rules=t,o.litellm_params.default_action=r,o.litellm_params.on_disallowed_action=n,o.litellm_params.violation_message_template=u||null)}let j=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);console.log("values: ",JSON.stringify(t)),console.log("currentProvider: ",j);let b=d.litellm_params?.guardrail==="tool_permission";if(x&&j&&!b){let e=x[ea[j]?.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(e)),Object.keys(e).forEach(e=>{"optional_params"!==e&&a.add(e)}),e.optional_params&&e.optional_params.fields&&Object.keys(e.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{if("patterns"===e||"blocked_words"===e||"categories"===e)return;let a=t[e];(null==a||""===a)&&(a=t.optional_params?.[e]);let l=d.litellm_params?.[e];JSON.stringify(a)!==JSON.stringify(l)&&(null!=a&&""!==a?o.litellm_params[e]=a:null!=l&&""!==l&&(o.litellm_params[e]=null))})}if(0===Object.keys(o.litellm_params).length&&delete o.litellm_params,0===Object.keys(o).length){u.default.info("No changes detected"),_(!1);return}await (0,p.updateGuardrailCall)(a,e,o),u.default.success("Guardrail updated successfully"),P(!1),z(),_(!1)}catch(e){console.error("Error updating guardrail:",e),u.default.fromBackend("Failed to update guardrail")}};if(f)return(0,l.jsx)("div",{className:"p-4",children:"Loading..."});if(!d)return(0,l.jsx)("div",{className:"p-4",children:"Guardrail not found"});let J=e=>e?new Date(e).toLocaleString():"-",{logo:U,displayName:W}=ed(d.litellm_params?.guardrail||""),V=async(e,t)=>{await (0,tn.copyToClipboard)(e)&&(A(e=>({...e,[t]:!0})),setTimeout(()=>{A(e=>({...e,[t]:!1}))},2e3))},Y="config"===d.guardrail_definition_location;return(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(c.Button,{type:"text",icon:(0,l.jsx)(td.ArrowLeftIcon,{className:"w-4 h-4"}),onClick:t,className:"mb-4",children:"Back to Guardrails"}),(0,l.jsx)(th.Title,{children:d.guardrail_name||"Unnamed Guardrail"}),(0,l.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,l.jsx)(eR.Text,{className:"text-gray-500 font-mono",children:d.guardrail_id}),(0,l.jsx)(c.Button,{type:"text",size:"small",icon:I["guardrail-id"]?(0,l.jsx)(tf.CheckIcon,{size:12}):(0,l.jsx)(ty.CopyIcon,{size:12}),onClick:()=>V(d.guardrail_id,"guardrail-id"),className:`left-2 z-10 transition-all duration-200 ${I["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"}`})]})]}),(0,l.jsxs)(tu.TabGroup,{children:[(0,l.jsxs)(tp.TabList,{className:"mb-4",children:[(0,l.jsx)(tm.Tab,{children:"Overview"},"overview"),s?(0,l.jsx)(tm.Tab,{children:"Settings"},"settings"):(0,l.jsx)(l.Fragment,{})]}),(0,l.jsxs)(tx.TabPanels,{children:[(0,l.jsxs)(tg.TabPanel,{children:[(0,l.jsxs)(tc.Grid,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Provider"}),(0,l.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[U&&(0,l.jsx)("img",{src:U,alt:`${W} logo`,className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,l.jsx)(th.Title,{children:W})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Mode"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:d.litellm_params?.mode||"-"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Default On":"Default Off"})]})]}),(0,l.jsxs)(eM.Card,{children:[(0,l.jsx)(eR.Text,{children:"Created At"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(th.Title,{children:J(d.created_at)}),(0,l.jsxs)(eR.Text,{children:["Last Updated: ",J(d.updated_at)]})]})]})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsx)(eR.Text,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,l.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,l.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,l.jsx)(eR.Text,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,l.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(d.litellm_params?.pii_entities_config).map(([e,t])=>(0,l.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,l.jsx)(eR.Text,{className:"flex-1 font-medium text-gray-900",children:e}),(0,l.jsx)(eR.Text,{className:"flex-1",children:(0,l.jsxs)("span",{className:`inline-flex items-center gap-1.5 ${"MASK"===t?"text-blue-600":"text-red-600"}`,children:["MASK"===t?(0,l.jsx)(eN.default,{}):(0,l.jsx)(eC.StopOutlined,{}),String(t)]})})]},e))})]})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eM.Card,{className:"mt-6",children:(0,l.jsx)(eq,{value:L,disabled:!0})}),d.litellm_params?.guardrail==="custom_code"&&d.litellm_params?.custom_code&&(0,l.jsxs)(eM.Card,{className:"mt-6",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(to.CodeOutlined,{className:"text-blue-500"}),(0,l.jsx)(eR.Text,{className:"font-medium text-lg",children:"Custom Code"})]}),s&&!Y&&(0,l.jsx)(c.Button,{size:"small",icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"})]}),(0,l.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-gray-700 bg-[#1e1e1e]",children:(0,l.jsx)("pre",{className:"p-4 text-sm text-gray-200 overflow-x-auto",style:{fontFamily:"'Fira Code', 'Monaco', 'Consolas', monospace"},children:(0,l.jsx)("code",{children:d.litellm_params.custom_code})})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!1,accessToken:a})]}),s&&(0,l.jsx)(tg.TabPanel,{children:(0,l.jsxs)(eM.Card,{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)(th.Title,{children:"Guardrail Settings"}),Y&&(0,l.jsx)(ej.Tooltip,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,l.jsx)(eD.InfoCircleOutlined,{})}),!j&&!Y&&(d.litellm_params?.guardrail==="custom_code"?(0,l.jsx)(c.Button,{icon:(0,l.jsx)(to.CodeOutlined,{}),onClick:()=>M(!0),children:"Edit Code"}):(0,l.jsx)(c.Button,{onClick:()=>_(!0),children:"Edit Settings"}))]}),j?(0,l.jsxs)(r.Form,{form:b,onFinish:H,initialValues:{guardrail_name:d.guardrail_name,...(o={...d.litellm_params||{}},delete o.skip_system_message_in_guardrail,o),skip_system_message_choice:ec(d.litellm_params?.skip_system_message_in_guardrail),guardrail_info:d.guardrail_info?JSON.stringify(d.guardrail_info,null,2):"",...d.litellm_params?.optional_params&&{optional_params:d.litellm_params.optional_params}},layout:"vertical",children:[(0,l.jsx)(r.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,l.jsx)(i.Input,{placeholder:"Enter guardrail name"})}),(0,l.jsx)(r.Form.Item,{label:"Default On",name:"default_on",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:!0,children:"Yes"}),(0,l.jsx)(n.Select.Option,{value:!1,children:"No"})]})}),(0,l.jsx)(r.Form.Item,{label:"Skip system messages in guardrail",name:"skip_system_message_choice",tooltip:"Unified guardrails: omit role: system from guardrail input (LLM still gets full messages). Use global default follows litellm_settings.skip_system_message_in_guardrail.",children:(0,l.jsxs)(n.Select,{children:[(0,l.jsx)(n.Select.Option,{value:"inherit",children:"Use global default"}),(0,l.jsx)(n.Select.Option,{value:"yes",children:"Yes — exclude from guardrail scan"}),(0,l.jsx)(n.Select.Option,{value:"no",children:"No — always include in scan"})]})}),d.litellm_params?.guardrail==="presidio"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eG.Divider,{orientation:"left",children:"PII Protection"}),(0,l.jsx)("div",{className:"mb-6",children:S&&(0,l.jsx)(eE,{entities:S.supported_entities,actions:S.supported_actions,selectedEntities:v,selectedActions:N,onEntitySelect:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onActionSelect:(e,t)=>{C(a=>({...a,[e]:t}))},entityCategories:S.pii_entity_categories})})]}),(0,l.jsx)(tC,{guardrailData:d,guardrailSettings:S,isEditing:!0,accessToken:a,onDataChange:G,onUnsavedChanges:P}),(d.litellm_params?.guardrail==="tool_permission"||x)&&(0,l.jsx)(eG.Divider,{orientation:"left",children:"Provider Settings"}),d.litellm_params?.guardrail==="tool_permission"?(0,l.jsx)(eq,{value:L,onChange:B}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey,{selectedProvider:Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail)||null,accessToken:a,providerParams:x,value:d.litellm_params}),x&&(()=>{let e=Object.keys(ea).find(e=>ea[e]===d.litellm_params?.guardrail);if(!e)return null;let t=x[ea[e]?.toLowerCase()];return t&&t.optional_params?(0,l.jsx)(ex,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:d.litellm_params}):null})()]}),(0,l.jsx)(eG.Divider,{orientation:"left",children:"Advanced Settings"}),(0,l.jsx)(r.Form.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,l.jsx)(i.Input.TextArea,{rows:5})}),(0,l.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,l.jsx)(c.Button,{onClick:()=>{_(!1),P(!1),q()},children:"Cancel"}),(0,l.jsx)(c.Button,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]}):(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail ID"}),(0,l.jsx)("div",{className:"font-mono",children:d.guardrail_id})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Guardrail Name"}),(0,l.jsx)("div",{children:d.guardrail_name||"Unnamed Guardrail"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Provider"}),(0,l.jsx)("div",{children:W})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Mode"}),(0,l.jsx)("div",{children:d.litellm_params?.mode||"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Default On"}),(0,l.jsx)(e7.Badge,{color:d.litellm_params?.default_on?"green":"gray",children:d.litellm_params?.default_on?"Yes":"No"})]}),d.litellm_params?.pii_entities_config&&Object.keys(d.litellm_params.pii_entities_config).length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"PII Protection"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsxs)(e7.Badge,{color:"blue",children:[Object.keys(d.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Created At"}),(0,l.jsx)("div",{children:J(d.created_at)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(eR.Text,{className:"font-medium",children:"Last Updated"}),(0,l.jsx)("div",{children:J(d.updated_at)})]}),d.litellm_params?.guardrail==="tool_permission"&&(0,l.jsx)(eq,{value:L,disabled:!0})]})]})})]})]}),(0,l.jsx)(tG,{visible:E,onClose:()=>M(!1),onSuccess:()=>{M(!1),z()},accessToken:a,editData:d?{guardrail_id:d.guardrail_id,guardrail_name:d.guardrail_name,litellm_params:d.litellm_params}:null})]})}],969641);var tz=e.i(573421),tD=e.i(19732),tK=e.i(928685),tq=e.i(166406),tH=e.i(637235),tJ=e.i(755151),tU=e.i(240647);let{Text:tW}=d.Typography,tV=function({results:e,errors:t}){let[a,r]=(0,m.useState)(new Set),i=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),r(t)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return e||t?(0,l.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),e&&e.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-green-50 border-green-200",children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>i(e.guardrailName),children:[t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"}),(0,l.jsx)(tk.CheckCircleOutlined,{className:"text-green-600 text-lg"}),(0,l.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tH.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!t&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tq.CopyOutlined,onClick:async()=>{await s(e.response_text)?u.default.success("Result copied to clipboard"):u.default.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,l.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,l.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,l.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,l.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),t&&t.map(e=>{let t=a.has(e.guardrailName);return(0,l.jsx)(eM.Card,{className:"bg-red-50 border-red-200",children:(0,l.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,l.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>i(e.guardrailName),children:t?(0,l.jsx)(tU.RightOutlined,{className:"text-gray-500 text-xs"}):(0,l.jsx)(tJ.DownOutlined,{className:"text-gray-500 text-xs"})}),(0,l.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,l.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,l.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>i(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,l.jsx)(tH.ClockCircleOutlined,{}),(0,l.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!t&&(0,l.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null},{TextArea:tY}=i.Input,{Text:tQ}=d.Typography,tX=function({guardrailNames:e,onSubmit:t,isLoading:a,results:r,errors:i,onClose:s}){let[n,o]=(0,m.useState)(""),d=()=>{n.trim()?t(n):u.default.fromBackend("Please enter text to test")},c=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();let a=document.execCommand("copy");if(document.body.removeChild(t),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},p=async()=>{await c(n)?u.default.success("Input copied to clipboard"):u.default.fromBackend("Failed to copy input")};return(0,l.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,l.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,l.jsx)("div",{className:"flex items-center space-x-3",children:(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,l.jsx)("div",{className:"inline-flex items-center space-x-1 bg-blue-50 px-3 py-1 rounded-md border border-blue-200",children:(0,l.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,l.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",e.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,l.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,l.jsx)(ej.Tooltip,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,l.jsx)(eD.InfoCircleOutlined,{className:"text-gray-400 cursor-help"})})]}),n&&(0,l.jsx)(e4.Button,{size:"xs",variant:"secondary",icon:tq.CopyOutlined,onClick:p,children:"Copy Input"})]}),(0,l.jsx)(tY,{value:n,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),d())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,l.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Press ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,l.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Shift+Enter"})," for new line"]}),(0,l.jsxs)(tQ,{className:"text-xs text-gray-500",children:["Characters: ",n.length]})]})]}),(0,l.jsx)("div",{className:"pt-2",children:(0,l.jsx)(e4.Button,{onClick:d,loading:a,disabled:!n.trim(),className:"w-full",children:a?`Testing ${e.length} guardrail${e.length>1?"s":""}...`:`Test ${e.length} guardrail${e.length>1?"s":""}`})})]}),(0,l.jsx)(tV,{results:r,errors:i})]})]})};e.s(["default",0,({guardrailsList:e,isLoading:t,accessToken:a,onClose:r})=>{let[s,n]=(0,m.useState)(new Set),[o,c]=(0,m.useState)(""),[g,x]=(0,m.useState)([]),[f,y]=(0,m.useState)([]),[j,_]=(0,m.useState)(!1),b=e.filter(e=>e.guardrail_name?.toLowerCase().includes(o.toLowerCase())),v=async e=>{if(0===s.size||!a)return;_(!0),x([]),y([]);let t=[],l=[];await Promise.all(Array.from(s).map(async r=>{let i=Date.now();try{let l=await (0,p.applyGuardrail)(a,r,e,null,null),s=Date.now()-i;t.push({guardrailName:r,response_text:l.response_text,latency:s})}catch(t){let e=Date.now()-i;console.error(`Error testing guardrail ${r}:`,t),l.push({guardrailName:r,error:t,latency:e})}})),x(t),y(l),_(!1),t.length>0&&u.default.success(`${t.length} guardrail${t.length>1?"s":""} applied successfully`),l.length>0&&u.default.fromBackend(`${l.length} guardrail${l.length>1?"s":""} failed`)};return(0,l.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,l.jsx)(h.Card,{className:"h-full",styles:{body:{padding:0,height:"100%"}},children:(0,l.jsxs)("div",{className:"flex h-full",children:[(0,l.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,l.jsx)(i.Input,{prefix:(0,l.jsx)(tK.SearchOutlined,{}),placeholder:"Search guardrails...",value:o,onChange:e=>c(e.target.value)})]})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto",children:t?(0,l.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,l.jsx)(eh.Spin,{})}):0===b.length?(0,l.jsx)("div",{className:"p-4",children:(0,l.jsx)(ez.Empty,{description:o?"No guardrails match your search":"No guardrails available"})}):(0,l.jsx)(tz.List,{dataSource:b,renderItem:e=>(0,l.jsx)(tz.List.Item,{onClick:()=>{var t;let a;e.guardrail_name&&(t=e.guardrail_name,(a=new Set(s)).has(t)?a.delete(t):a.add(t),n(a))},style:{paddingLeft:24,paddingRight:16},className:`cursor-pointer hover:bg-gray-50 transition-colors ${s.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"}`,children:(0,l.jsx)(tz.List.Item.Meta,{title:(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(tD.ExperimentOutlined,{className:"text-gray-400"}),(0,l.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,l.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Type: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,l.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,l.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,l.jsxs)(d.Typography.Text,{className:"text-xs text-gray-600",children:[s.size," of ",b.length," selected"]})})]}),(0,l.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,l.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,l.jsx)(d.Typography.Title,{level:2,className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,l.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===s.size?(0,l.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,l.jsx)(tD.ExperimentOutlined,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,l.jsx)(d.Typography.Paragraph,{className:"text-center text-gray-500 max-w-md",children:"Choose one or more guardrails from the left sidebar to start testing and comparing results."})]}):(0,l.jsx)("div",{className:"h-full",children:(0,l.jsx)(tX,{guardrailNames:Array.from(s),onSubmit:v,results:g.length>0?g:null,errors:f.length>0?f:null,isLoading:j,onClose:()=>n(new Set)})})})]})]})})})}],476993),e.s([],824296),e.s(["CustomCodeModal",0,tG],64352);let tZ="../ui/assets/logos/",t0=[{id:"cf_denied_financial",name:"Denied Financial Advice",description:"Detects requests for personalized financial advice, investment recommendations, or financial planning.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:207,latency:"<0.1ms"}},{id:"cf_denied_insults",name:"Insults & Personal Attacks",description:"Detects insults, name-calling, and personal attacks directed at the chatbot, staff, or other people.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"],eval:{f1:100,precision:100,recall:100,testCases:299,latency:"<0.1ms"}},{id:"cf_denied_legal",name:"Denied Legal Advice",description:"Detects requests for unauthorized legal advice, case analysis, or legal recommendations.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_denied_medical",name:"Denied Medical Advice",description:"Detects requests for medical diagnosis, treatment recommendations, or health advice.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Topic Blocker"]},{id:"cf_harmful_violence",name:"Harmful Violence",description:"Detects content related to violence, criminal planning, attacks, and violent threats.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_self_harm",name:"Harmful Self-Harm",description:"Detects content related to self-harm, suicide, and dangerous self-destructive behavior.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_child_safety",name:"Harmful Child Safety",description:"Detects content that could endanger child safety or exploit minors.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_harmful_illegal_weapons",name:"Harmful Illegal Weapons",description:"Detects content related to illegal weapons manufacturing, distribution, or acquisition.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Safety"]},{id:"cf_bias_gender",name:"Bias: Gender",description:"Detects gender-based discrimination, stereotypes, and biased language.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_racial",name:"Bias: Racial",description:"Detects racial discrimination, stereotypes, and racially biased content.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_religious",name:"Bias: Religious",description:"Detects religious discrimination, intolerance, and religiously biased content.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_bias_sexual_orientation",name:"Bias: Sexual Orientation",description:"Detects discrimination based on sexual orientation and related biased content.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Bias"]},{id:"cf_prompt_injection_jailbreak",name:"Prompt Injection: Jailbreak",description:"Detects jailbreak attempts designed to bypass AI safety guidelines and restrictions.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_data_exfil",name:"Prompt Injection: Data Exfiltration",description:"Detects attempts to extract sensitive data through prompt manipulation.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_sql",name:"Prompt Injection: SQL",description:"Detects SQL injection attempts embedded in prompts.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_malicious_code",name:"Prompt Injection: Malicious Code",description:"Detects attempts to inject malicious code through prompts.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_prompt_injection_system_prompt",name:"Prompt Injection: System Prompt",description:"Detects attempts to extract or override system prompts.",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Prompt Injection"]},{id:"cf_toxic_abuse",name:"Toxic & Abusive Language",description:"Detects toxic, abusive, and hateful language across multiple languages (EN, AU, DE, ES, FR).",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Toxicity"]},{id:"cf_patterns",name:"Pattern Matching",description:"Detect and block sensitive data patterns like SSNs, credit card numbers, API keys, and custom regex patterns.",category:"litellm",subcategory:"Patterns",logo:`${tZ}litellm_logo.jpg`,tags:["PII","Regex","Data Protection"]},{id:"cf_keywords",name:"Keyword Blocking",description:"Block or mask content containing specific keywords or phrases. Upload custom word lists or add individual terms.",category:"litellm",subcategory:"Keywords",logo:`${tZ}litellm_logo.jpg`,tags:["Keywords","Blocklist"]},{id:"block_code_execution",name:"Block Code Execution",description:"Detects markdown fenced code blocks in requests and responses. Block or mask executable code (e.g. Python, JavaScript, Bash) by language with configurable confidence.",category:"litellm",subcategory:"Code Safety",logo:`${tZ}litellm_logo.jpg`,tags:["Code","Safety","Prompt Injection"]},{id:"cf_competitor_intent",name:"Competitor Name Blocking",description:"Block or reframe competitor comparison and ranking intent. Detect when users ask to compare or recommend competitors (airline or generic competitor lists).",category:"litellm",subcategory:"Content Category",logo:`${tZ}litellm_logo.jpg`,tags:["Content Category","Competitor","Topic Blocker"]},{id:"presidio",name:"Presidio PII",description:"Microsoft Presidio for PII detection and anonymization. Supports 30+ entity types with configurable actions.",category:"partner",logo:`${tZ}microsoft_azure.svg`,tags:["PII","Microsoft"],providerKey:"PresidioPII"},{id:"bedrock",name:"Bedrock Guardrail",description:"AWS Bedrock Guardrails for content filtering, topic avoidance, and sensitive information detection.",category:"partner",logo:`${tZ}bedrock.svg`,tags:["AWS","Content Safety"],providerKey:"Bedrock"},{id:"lakera",name:"Lakera",description:"AI security platform protecting against prompt injections, data leakage, and harmful content.",category:"partner",logo:`${tZ}lakeraai.jpeg`,tags:["Security","Prompt Injection"],providerKey:"Lakera"},{id:"openai_moderation",name:"OpenAI Moderation",description:"OpenAI's content moderation API for detecting harmful content across multiple categories.",category:"partner",logo:`${tZ}openai_small.svg`,tags:["Content Moderation","OpenAI"]},{id:"google_model_armor",name:"Google Cloud Model Armor",description:"Google Cloud's model protection service for safe and responsible AI deployments.",category:"partner",logo:`${tZ}google.svg`,tags:["Google Cloud","Safety"]},{id:"guardrails_ai",name:"Guardrails AI",description:"Open-source framework for adding structural, type, and quality guarantees to LLM outputs.",category:"partner",logo:`${tZ}guardrails_ai.jpeg`,tags:["Open Source","Validation"]},{id:"zscaler",name:"Zscaler AI Guard",description:"Enterprise AI security from Zscaler for monitoring and protecting AI/ML workloads.",category:"partner",logo:`${tZ}zscaler.svg`,tags:["Enterprise","Security"]},{id:"panw",name:"PANW Prisma AIRS",description:"Palo Alto Networks Prisma AI Runtime Security for securing AI applications in production.",category:"partner",logo:`${tZ}palo_alto_networks.jpeg`,tags:["Enterprise","Security"]},{id:"noma",name:"Noma Security",description:"AI security platform for detecting and preventing AI-specific threats and vulnerabilities.",category:"partner",logo:`${tZ}noma_security.png`,tags:["Security","Threat Detection"]},{id:"aporia",name:"Aporia AI",description:"Real-time AI guardrails for hallucination detection, topic control, and policy enforcement.",category:"partner",logo:`${tZ}aporia.png`,tags:["Hallucination","Policy"]},{id:"aim",name:"AIM Guardrail",description:"AIM Security guardrails for comprehensive AI threat detection and mitigation.",category:"partner",logo:`${tZ}aim_security.jpeg`,tags:["Security","Threat Detection"]},{id:"prompt_security",name:"Prompt Security",description:"Protect against prompt injection attacks, data leakage, and other LLM security threats.",category:"partner",logo:`${tZ}prompt_security.png`,tags:["Prompt Injection","Security"]},{id:"lasso",name:"Lasso Guardrail",description:"Content moderation and safety guardrails for responsible AI deployments.",category:"partner",logo:`${tZ}lasso.png`,tags:["Content Moderation"]},{id:"pangea",name:"Pangea Guardrail",description:"Pangea's AI guardrails for secure, compliant, and trustworthy AI applications.",category:"partner",logo:`${tZ}pangea.png`,tags:["Compliance","Security"]},{id:"enkryptai",name:"EnkryptAI",description:"AI security and governance platform for enterprise AI safety and compliance.",category:"partner",logo:`${tZ}enkrypt_ai.avif`,tags:["Enterprise","Governance"]},{id:"javelin",name:"Javelin Guardrails",description:"AI gateway with built-in guardrails for secure and compliant AI operations.",category:"partner",logo:`${tZ}javelin.png`,tags:["Gateway","Security"]},{id:"pillar",name:"Pillar Guardrail",description:"AI safety platform for monitoring, testing, and securing AI systems.",category:"partner",logo:`${tZ}pillar.jpeg`,tags:["Monitoring","Safety"]},{id:"akto",name:"Akto Guardrail",description:"AI security platform from Akto.io with automatic monitoring and guardrails for AI/ML applications.",category:"partner",logo:`${tZ}akto.svg`,tags:["Security","Safety","Monitoring"]},{id:"promptguard",name:"PromptGuard",description:"AI security gateway with prompt injection detection, PII redaction, topic filtering, entity blocklists, and hallucination detection. Self-hostable with drop-in proxy integration.",category:"partner",logo:`${tZ}promptguard.svg`,tags:["Security","Prompt Injection","PII"],providerKey:"Promptguard",eval:{f1:94.9,precision:100,recall:90.4,testCases:5384,latency:"~150ms"}},{id:"xecguard",name:"XecGuard",description:"CyCraft XecGuard AI security gateway. Multi-policy scanning (prompt injection, harmful content, PII, system-prompt enforcement) plus RAG context grounding.",category:"partner",logo:`${tZ}xecguard.svg`,tags:["Security","Policy","Grounding","RAG"],providerKey:"Xecguard"}];e.s(["ALL_CARDS",0,t0],230312)},487304,168118,e=>{"use strict";var t=e.i(843476),a=e.i(271645),l=e.i(464571),r=e.i(326373),i=e.i(653496),s=e.i(755151),n=e.i(646563),o=e.i(245094),d=e.i(764205),c=e.i(185357),m=e.i(782719),u=e.i(708347),p=e.i(969641),g=e.i(476993),x=e.i(727749),h=e.i(127952),f=e.i(180766);e.i(824296);var y=e.i(64352),j=e.i(311451),_=e.i(928685),b=e.i(266537),v=e.i(230312),w=e.i(826910);let N=({src:e,name:l})=>{let[r,i]=(0,a.useState)(!1);return r||!e?(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:6,backgroundColor:"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:600,color:"#6b7280",flexShrink:0},children:l?.charAt(0)||"?"}):(0,t.jsx)("img",{src:e,alt:"",style:{width:28,height:28,borderRadius:6,objectFit:"contain",flexShrink:0},onError:()=>i(!0)})},C=({card:e,onClick:l})=>{let[r,i]=(0,a.useState)(!1);return(0,t.jsxs)("div",{onClick:l,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,border:r?"1px solid #93c5fd":"1px solid #e5e7eb",backgroundColor:"#ffffff",padding:"20px 20px 16px 20px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s",display:"flex",flexDirection:"column",minHeight:170,boxShadow:r?"0 1px 6px rgba(59,130,246,0.08)":"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[(0,t.jsx)(N,{src:e.logo,name:e.name}),(0,t.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"#111827",lineHeight:1.3},children:e.name})]}),(0,t.jsx)("p",{className:"line-clamp-3",style:{fontSize:12,color:"#6b7280",lineHeight:1.6,margin:0,flex:1},children:e.description}),e.eval&&(0,t.jsxs)("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:4},children:[(0,t.jsx)(w.CheckCircleFilled,{style:{color:"#16a34a",fontSize:12}}),(0,t.jsxs)("span",{style:{fontSize:11,color:"#16a34a",fontWeight:500},children:["F1: ",e.eval.f1,"% · ",e.eval.testCases," test cases"]})]})]})};var S=e.i(447566);let k={cf_denied_financial:{provider:"LitellmContentFilter",categoryName:"denied_financial_advice",guardrailNameSuggestion:"Denied Financial Advice",mode:"pre_call",defaultOn:!1},cf_denied_legal:{provider:"LitellmContentFilter",categoryName:"denied_legal_advice",guardrailNameSuggestion:"Denied Legal Advice",mode:"pre_call",defaultOn:!1},cf_denied_medical:{provider:"LitellmContentFilter",categoryName:"denied_medical_advice",guardrailNameSuggestion:"Denied Medical Advice",mode:"pre_call",defaultOn:!1},cf_denied_insults:{provider:"LitellmContentFilter",categoryName:"denied_insults",guardrailNameSuggestion:"Insults & Personal Attacks",mode:"pre_call",defaultOn:!1},cf_harmful_violence:{provider:"LitellmContentFilter",categoryName:"harmful_violence",guardrailNameSuggestion:"Harmful Violence",mode:"pre_call",defaultOn:!1},cf_harmful_self_harm:{provider:"LitellmContentFilter",categoryName:"harmful_self_harm",guardrailNameSuggestion:"Harmful Self-Harm",mode:"pre_call",defaultOn:!1},cf_harmful_child_safety:{provider:"LitellmContentFilter",categoryName:"harmful_child_safety",guardrailNameSuggestion:"Harmful Child Safety",mode:"pre_call",defaultOn:!1},cf_harmful_illegal_weapons:{provider:"LitellmContentFilter",categoryName:"harmful_illegal_weapons",guardrailNameSuggestion:"Harmful Illegal Weapons",mode:"pre_call",defaultOn:!1},cf_bias_gender:{provider:"LitellmContentFilter",categoryName:"bias_gender",guardrailNameSuggestion:"Bias: Gender",mode:"pre_call",defaultOn:!1},cf_bias_racial:{provider:"LitellmContentFilter",categoryName:"bias_racial",guardrailNameSuggestion:"Bias: Racial",mode:"pre_call",defaultOn:!1},cf_bias_religious:{provider:"LitellmContentFilter",categoryName:"bias_religious",guardrailNameSuggestion:"Bias: Religious",mode:"pre_call",defaultOn:!1},cf_bias_sexual_orientation:{provider:"LitellmContentFilter",categoryName:"bias_sexual_orientation",guardrailNameSuggestion:"Bias: Sexual Orientation",mode:"pre_call",defaultOn:!1},cf_prompt_injection_jailbreak:{provider:"LitellmContentFilter",categoryName:"prompt_injection_jailbreak",guardrailNameSuggestion:"Prompt Injection: Jailbreak",mode:"pre_call",defaultOn:!1},cf_prompt_injection_data_exfil:{provider:"LitellmContentFilter",categoryName:"prompt_injection_data_exfiltration",guardrailNameSuggestion:"Prompt Injection: Data Exfiltration",mode:"pre_call",defaultOn:!1},cf_prompt_injection_sql:{provider:"LitellmContentFilter",categoryName:"prompt_injection_sql",guardrailNameSuggestion:"Prompt Injection: SQL",mode:"pre_call",defaultOn:!1},cf_prompt_injection_malicious_code:{provider:"LitellmContentFilter",categoryName:"prompt_injection_malicious_code",guardrailNameSuggestion:"Prompt Injection: Malicious Code",mode:"pre_call",defaultOn:!1},cf_prompt_injection_system_prompt:{provider:"LitellmContentFilter",categoryName:"prompt_injection_system_prompt",guardrailNameSuggestion:"Prompt Injection: System Prompt",mode:"pre_call",defaultOn:!1},cf_toxic_abuse:{provider:"LitellmContentFilter",categoryName:"harm_toxic_abuse",guardrailNameSuggestion:"Toxic & Abusive Language",mode:"pre_call",defaultOn:!1},cf_patterns:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Pattern Matching",mode:"pre_call",defaultOn:!1},cf_keywords:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Keyword Blocking",mode:"pre_call",defaultOn:!1},block_code_execution:{provider:"BlockCodeExecution",guardrailNameSuggestion:"Block Code Execution",mode:"pre_call",defaultOn:!1},cf_competitor_intent:{provider:"LitellmContentFilter",guardrailNameSuggestion:"Competitor Name Blocking",mode:"pre_call",defaultOn:!1},presidio:{provider:"PresidioPII",guardrailNameSuggestion:"Presidio PII",mode:"pre_call",defaultOn:!1},bedrock:{provider:"Bedrock",guardrailNameSuggestion:"Bedrock Guardrail",mode:"pre_call",defaultOn:!1},lakera:{provider:"Lakera",guardrailNameSuggestion:"Lakera",mode:"pre_call",defaultOn:!1},openai_moderation:{provider:"OpenaiModeration",guardrailNameSuggestion:"OpenAI Moderation",mode:"pre_call",defaultOn:!1},google_model_armor:{provider:"ModelArmor",guardrailNameSuggestion:"Google Cloud Model Armor",mode:"pre_call",defaultOn:!1},guardrails_ai:{provider:"GuardrailsAi",guardrailNameSuggestion:"Guardrails AI",mode:"pre_call",defaultOn:!1},zscaler:{provider:"ZscalerAiGuard",guardrailNameSuggestion:"Zscaler AI Guard",mode:"pre_call",defaultOn:!1},panw:{provider:"PanwPrismaAirs",guardrailNameSuggestion:"PANW Prisma AIRS",mode:"pre_call",defaultOn:!1},noma:{provider:"Noma",guardrailNameSuggestion:"Noma Security",mode:"pre_call",defaultOn:!1},aporia:{provider:"AporiaAi",guardrailNameSuggestion:"Aporia AI",mode:"pre_call",defaultOn:!1},aim:{provider:"Aim",guardrailNameSuggestion:"AIM Guardrail",mode:"pre_call",defaultOn:!1},prompt_security:{provider:"PromptSecurity",guardrailNameSuggestion:"Prompt Security",mode:"pre_call",defaultOn:!1},lasso:{provider:"Lasso",guardrailNameSuggestion:"Lasso Guardrail",mode:"pre_call",defaultOn:!1},pangea:{provider:"Pangea",guardrailNameSuggestion:"Pangea Guardrail",mode:"pre_call",defaultOn:!1},enkryptai:{provider:"Enkryptai",guardrailNameSuggestion:"EnkryptAI",mode:"pre_call",defaultOn:!1},javelin:{provider:"Javelin",guardrailNameSuggestion:"Javelin Guardrails",mode:"pre_call",defaultOn:!1},pillar:{provider:"Pillar",guardrailNameSuggestion:"Pillar Guardrail",mode:"pre_call",defaultOn:!1},akto:{provider:"Akto",guardrailNameSuggestion:"Akto Guardrail",mode:"pre_call",defaultOn:!1},promptguard:{provider:"Promptguard",guardrailNameSuggestion:"PromptGuard",mode:"pre_call",defaultOn:!1},xecguard:{provider:"Xecguard",guardrailNameSuggestion:"XecGuard",mode:"pre_call",defaultOn:!1}},I=({card:e,onBack:r,accessToken:i,onGuardrailCreated:s})=>{let[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)("overview"),u=[{property:"Provider",value:"litellm"===e.category?"LiteLLM Content Filter":"Partner Guardrail"},...e.subcategory?[{property:"Subcategory",value:e.subcategory}]:[],..."litellm"===e.category?[{property:"Cost",value:"$0 / request"}]:[],..."litellm"===e.category?[{property:"External Dependencies",value:"None"}]:[],..."litellm"===e.category?[{property:"Latency",value:e.eval?.latency||"<1ms"}]:[]],p=e.eval?[{metric:"Precision",value:`${e.eval.precision}%`},{metric:"Recall",value:`${e.eval.recall}%`},{metric:"F1 Score",value:`${e.eval.f1}%`},{metric:"Test Cases",value:String(e.eval.testCases)},{metric:"False Positives",value:"0"},{metric:"False Negatives",value:"0"},{metric:"Latency (p50)",value:e.eval.latency}]:[],g=[{key:"overview",label:"Overview"},...e.eval?[{key:"eval",label:"Eval Results"}]:[]];return(0,t.jsxs)("div",{style:{maxWidth:960,margin:"0 auto"},children:[(0,t.jsxs)("div",{onClick:r,style:{display:"inline-flex",alignItems:"center",gap:6,color:"#5f6368",cursor:"pointer",fontSize:14,marginBottom:24},children:[(0,t.jsx)(S.ArrowLeftOutlined,{style:{fontSize:11}}),(0,t.jsx)("span",{children:e.name})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginBottom:8},children:[(0,t.jsx)("img",{src:e.logo,alt:"",style:{width:40,height:40,borderRadius:8,objectFit:"contain"},onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("h1",{style:{fontSize:28,fontWeight:400,color:"#202124",margin:0,lineHeight:1.2},children:e.name})]}),(0,t.jsx)("p",{style:{fontSize:14,color:"#5f6368",margin:"0 0 20px 0",lineHeight:1.6},children:e.description}),(0,t.jsx)("div",{style:{display:"flex",gap:10,marginBottom:32},children:(0,t.jsx)(l.Button,{onClick:()=>o(!0),style:{borderRadius:20,padding:"4px 20px",height:36,borderColor:"#dadce0",color:"#1a73e8",fontWeight:500,fontSize:14},children:"Create Guardrail"})}),(0,t.jsx)("div",{style:{borderBottom:"1px solid #dadce0",marginBottom:28},children:(0,t.jsx)("div",{style:{display:"flex",gap:0},children:g.map(e=>(0,t.jsx)("div",{onClick:()=>m(e.key),style:{padding:"12px 20px",fontSize:14,color:d===e.key?"#1a73e8":"#5f6368",borderBottom:d===e.key?"3px solid #1a73e8":"3px solid transparent",cursor:"pointer",fontWeight:d===e.key?500:400,marginBottom:-1},children:e.label},e.key))})}),"overview"===d&&(0,t.jsxs)("div",{style:{display:"flex",gap:64},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 12px 0"},children:"Overview"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#3c4043",lineHeight:1.7,margin:"0 0 32px 0"},children:e.description}),(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 4px 0"},children:"Guardrail Details"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#5f6368",margin:"0 0 16px 0"},children:"Details are as follows"}),(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500,width:200},children:"Property"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 0",color:"#5f6368",fontWeight:500},children:e.name})]})}),(0,t.jsx)("tbody",{children:u.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 0",color:"#3c4043"},children:e.property}),(0,t.jsx)("td",{style:{padding:"12px 0",color:"#202124"},children:e.value})]},a))})]})]}),(0,t.jsxs)("div",{style:{width:240,flexShrink:0},children:[(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Guardrail ID"}),(0,t.jsxs)("div",{style:{fontSize:13,color:"#202124",wordBreak:"break-all"},children:["litellm/",e.id]})]}),(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:4},children:"Type"}),(0,t.jsx)("div",{style:{fontSize:13,color:"#202124"},children:"litellm"===e.category?"Content Filter":"Partner"})]}),e.tags.length>0&&(0,t.jsxs)("div",{style:{marginBottom:28},children:[(0,t.jsx)("div",{style:{fontSize:12,color:"#5f6368",marginBottom:8},children:"Tags"}),(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:e.tags.map(e=>(0,t.jsx)("span",{style:{fontSize:12,padding:"4px 12px",borderRadius:16,border:"1px solid #dadce0",color:"#3c4043",backgroundColor:"#fff"},children:e},e))})]})]})]}),"eval"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:18,fontWeight:400,color:"#202124",margin:"0 0 16px 0"},children:"Eval Results"}),(0,t.jsxs)("table",{style:{width:"100%",maxWidth:560,borderCollapse:"collapse",fontSize:14},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{backgroundColor:"#f8f9fa",borderBottom:"1px solid #dadce0"},children:[(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Metric"}),(0,t.jsx)("th",{style:{textAlign:"left",padding:"12px 16px",color:"#5f6368",fontWeight:500},children:"Value"})]})}),(0,t.jsx)("tbody",{children:p.map((e,a)=>(0,t.jsxs)("tr",{style:{borderBottom:"1px solid #f1f3f4"},children:[(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#3c4043"},children:e.metric}),(0,t.jsx)("td",{style:{padding:"12px 16px",color:"#202124",fontWeight:500},children:e.value})]},a))})]})]}),(0,t.jsx)(c.default,{visible:n,onClose:()=>o(!1),accessToken:i,onSuccess:()=>{o(!1),s()},preset:k[e.id]})]})},A=({accessToken:e,onGuardrailCreated:l})=>{let[r,i]=(0,a.useState)(""),[s,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),c=v.ALL_CARDS.filter(e=>{if(!r)return!0;let t=r.toLowerCase();return e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))}),m=c.filter(e=>"litellm"===e.category),u=c.filter(e=>"partner"===e.category);return s?(0,t.jsx)(I,{card:s,onBack:()=>n(null),accessToken:e,onGuardrailCreated:l}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{marginBottom:24},children:(0,t.jsx)(j.Input,{size:"large",placeholder:"Search guardrails",prefix:(0,t.jsx)(_.SearchOutlined,{style:{color:"#9ca3af"}}),value:r,onChange:e=>i(e.target.value),style:{borderRadius:8}})}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:0},children:"LiteLLM Content Filter"}),(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:14,color:"#1a73e8",cursor:"pointer"},onClick:()=>d(!o),children:o?(0,t.jsx)(t.Fragment,{children:"Show less"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.ArrowRightOutlined,{style:{fontSize:12}}),`Show all (${m.length})`]})})]}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Built-in guardrails powered by LiteLLM. Zero latency, no external dependencies, no additional cost."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:(o?m:m.slice(0,10)).map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]}),(0,t.jsxs)("div",{style:{marginBottom:40},children:[(0,t.jsx)("h2",{style:{fontSize:20,fontWeight:600,color:"#111827",margin:"0 0 4px 0"},children:"Partner Guardrails"}),(0,t.jsx)("p",{style:{fontSize:13,color:"#6b7280",margin:"4px 0 20px 0"},children:"Third-party guardrail integrations from leading AI security providers."}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:16},children:u.map(e=>(0,t.jsx)(C,{card:e,onClick:()=>n(e)},e.id))})]})]})};var O=e.i(988846),P=e.i(837007),T=e.i(409797),L=e.i(54131),B=e.i(995926),F=e.i(678784),$=e.i(634831),E=e.i(438100),M=e.i(302202),R=e.i(328196),G=e.i(879664);e.s(["InfoIcon",()=>G.default],168118);var G=G,z=e.i(212931),D=e.i(808613),K=e.i(199133),q=e.i(663435),H=e.i(954616),J=e.i(912598),U=e.i(135214),W=e.i(243652);let V=async(e,t)=>{let a=(0,d.getProxyBaseUrl)(),l=`${a}/guardrails/register`,r=await fetch(l,{method:"POST",headers:{[(0,d.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.json().catch(()=>({})),t=(0,d.deriveErrorMessage)(e);throw(0,d.handleError)(t),Error(t)}return r.json()},Y=(0,W.createQueryKeys)("guardrails");function Q(e){var t;let a=e.litellm_params??{},l=e.guardrail_info??{},r=a.headers,i=Array.isArray(r)?r.map(e=>({key:(e.key??e.name??"").toString(),value:String(e.value??"")})):"object"==typeof r&&null!==r?Object.entries(r).map(([e,t])=>({key:e,value:String(t??"")})):[],s=a.api_base??a.url??"",n=l.model??a.model??"—",o=a.forward_api_key??!0,d=Array.isArray(a.extra_headers)?a.extra_headers.filter(e=>"string"==typeof e):[];return{id:e.guardrail_id,team:e.team_id??"—",name:e.guardrail_name,endpoint:s,status:"pending_review"===(t=e.status)?"pending":"active"===t||"rejected"===t?t:"active",model:n,forwardKey:o,description:l.description??"",method:a.method??"POST",customHeaders:i,extraHeaders:d,submittedAt:function(e){if(!e)return"—";try{let t=new Date(e);return isNaN(t.getTime())?e:t.toISOString().slice(0,10)}catch{return e}}(e.submitted_at),submittedBy:e.submitted_by_email??e.submitted_by_user_id??"—",mode:a.mode,unreachable_fallback:a.unreachable_fallback,additionalProviderParams:a.additional_provider_specific_params,guardrailType:a.guardrail}}let X={active:{label:"Active",bg:"bg-green-50",text:"text-green-700",dot:"bg-green-500"},pending:{label:"Pending Review",bg:"bg-yellow-50",text:"text-yellow-700",dot:"bg-yellow-500"},rejected:{label:"Rejected",bg:"bg-red-50",text:"text-red-700",dot:"bg-red-500"}},Z={"ML Platform":"bg-purple-100 text-purple-700","Data Science":"bg-blue-100 text-blue-700",Security:"bg-red-100 text-red-700","Customer Success":"bg-orange-100 text-orange-700",Legal:"bg-gray-100 text-gray-700",Finance:"bg-green-100 text-green-700"};function ee({label:e,value:a,color:l}){return(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg px-4 py-3",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${l}`,children:a}),(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e})]})}function et({enabled:e,onToggle:a}){return(0,t.jsx)("button",{type:"button",onClick:a,role:"switch","aria-checked":e,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${e?"bg-blue-500":"bg-gray-200"}`,children:(0,t.jsx)("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ${e?"translate-x-4":"translate-x-0.5"}`})})}function ea({guardrail:e,isSelected:a,isHeadersExpanded:l,onSelect:r,onToggleForwardKey:i,onToggleHeaders:s,onApprove:n,onReject:o}){let d=X[e.status],c=Z[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsxs)("div",{className:`bg-white border rounded-lg p-4 transition-all ${a?"border-blue-400 ring-1 ring-blue-200":"border-gray-200"}`,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${c}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${d.bg} ${d.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${d.dot}`}),d.label]})]}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-2 line-clamp-1",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(M.ServerIcon,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-gray-500 font-mono truncate",children:e.endpoint})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-gray-500",children:[(0,t.jsxs)("span",{children:["Model: ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.model})]}),(0,t.jsxs)("span",{children:["Submitted:"," ",(0,t.jsx)("span",{className:"font-medium text-gray-700",children:e.submittedAt})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:"Forward API Key"}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:i})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"text-xs border border-gray-300 text-gray-600 hover:bg-gray-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:a?"Close":"Review"}),"pending"===e.status&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:n,className:"text-xs bg-green-500 hover:bg-green-600 text-white px-3 py-1.5 rounded-md transition-colors font-medium",children:"Approve"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"text-xs border border-red-300 text-red-600 hover:bg-red-50 px-3 py-1.5 rounded-md transition-colors font-medium",children:"Reject"})]})]})]})]}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[(0,t.jsxs)("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-700 transition-colors",children:[l?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5"}):(0,t.jsx)(T.ChevronDownIcon,{className:"h-3.5 w-3.5"}),"Static headers",e.customHeaders.length>0&&(0,t.jsx)("span",{className:"ml-1 bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),l&&(0,t.jsx)("div",{className:"mt-2",children:0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic",children:"No static headers configured."}):(0,t.jsx)("div",{className:"space-y-1",children:e.customHeaders.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-mono",children:[(0,t.jsx)("span",{className:"text-gray-500 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.key}),(0,t.jsx)("span",{className:"text-gray-400",children:":"}),(0,t.jsx)("span",{className:"text-gray-700 bg-gray-50 border border-gray-200 rounded px-2 py-0.5",children:e.value})]},`${e.key}-${a}`))})})]})]})}function el({label:e,children:a}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),(0,t.jsx)("div",{children:a})]})}function er({guardrail:e,onClose:l,onApprove:r,onReject:i,onToggleForwardKey:s,onUpdateCustomHeaders:n,onUpdateExtraHeaders:o}){let[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[p,g]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),f=X[e.status],y=Z[e.team]??"bg-gray-100 text-gray-700";return(0,t.jsx)("div",{className:"w-96 flex-shrink-0 bg-white overflow-auto",children:(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${y}`,children:["Team: ",e.team]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded-full ${f.bg} ${f.text}`,children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${f.dot}`}),f.label]})]}),(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-900",children:e.name}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["Submitted by ",e.submittedBy," on ",e.submittedAt]})]}),(0,t.jsx)("button",{type:"button",onClick:l,className:"text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close detail panel",children:(0,t.jsx)(B.XIcon,{className:"h-4 w-4"})})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mb-5",children:e.description}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(el,{label:"Endpoint",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("code",{className:"text-xs font-mono text-gray-700 break-all",children:e.endpoint}),(0,t.jsx)("a",{href:e.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-blue-500 flex-shrink-0",children:(0,t.jsx)($.ExternalLinkIcon,{className:"h-3.5 w-3.5"})})]})}),(0,t.jsx)(el,{label:"Method",children:(0,t.jsx)("span",{className:"text-xs font-mono font-medium text-gray-700 bg-gray-100 px-2 py-0.5 rounded",children:e.method})}),(0,t.jsxs)("div",{className:"border border-blue-100 bg-blue-50 rounded-lg p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(E.KeyIcon,{className:"h-3.5 w-3.5 text-blue-500"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-blue-800",children:"Forward LiteLLM API Key"})]}),(0,t.jsx)(et,{enabled:e.forwardKey,onToggle:s})]}),(0,t.jsxs)("p",{className:"text-xs text-blue-700 leading-relaxed",children:["When enabled, the caller's LiteLLM API key is forwarded as an"," ",(0,t.jsx)("code",{className:"font-mono bg-blue-100 px-1 rounded",children:"Authorization"})," ","header to your guardrail endpoint. This allows your guardrail to authenticate model calls using the original caller's credentials."]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Static headers"}),e.customHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.customHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Sent with every request to the guardrail."}),0===e.customHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No static headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.customHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsxs)("span",{className:"text-gray-700 truncate",children:[a.key,": ",a.value]}),(0,t.jsx)("button",{type:"button",onClick:()=>n(e.customHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a.key}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a.key}-${l}`))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:"Header name (e.g. X-API-Key)",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"Value",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=p.trim(),l=x.trim();a&&!e.customHeaders.some(e=>e.key.toLowerCase()===a.toLowerCase())&&(n([...e.customHeaders,{key:a,value:l}]),g(""),h(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=p.trim(),a=x.trim();t&&!e.customHeaders.some(e=>e.key.toLowerCase()===t.toLowerCase())&&(n([...e.customHeaders,{key:t,value:a}]),g(""),h(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors flex-shrink-0",children:"Add"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-gray-700",children:"Forward client headers"}),e.extraHeaders.length>0&&(0,t.jsx)("span",{className:"bg-gray-100 text-gray-600 rounded-full px-1.5 py-0.5 text-xs",children:e.extraHeaders.length})]}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:"Allowed header names to forward from the client request to the guardrail (e.g. x-request-id)."}),0===e.extraHeaders.length?(0,t.jsx)("p",{className:"text-xs text-gray-400 italic mb-2",children:"No forward client headers configured."}):(0,t.jsx)("ul",{className:"list-none space-y-1 mb-2",children:e.extraHeaders.map((a,l)=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs font-mono bg-gray-50 border border-gray-200 rounded px-2 py-1.5",children:[(0,t.jsx)("span",{className:"text-gray-700 truncate",children:a}),(0,t.jsx)("button",{type:"button",onClick:()=>o(e.extraHeaders.filter((e,t)=>t!==l)),className:"text-gray-400 hover:text-red-600 flex-shrink-0","aria-label":`Remove ${a}`,children:(0,t.jsx)(B.XIcon,{className:"h-3.5 w-3.5"})})]},`${a}-${l}`))}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"e.g. x-request-id",className:"flex-1 min-w-0 text-xs font-mono border border-gray-200 rounded px-2 py-1.5 text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500",onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let a=m.trim().toLowerCase();a&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(a)&&(o([...e.extraHeaders,a]),u(""))}}}),(0,t.jsx)("button",{type:"button",onClick:()=>{let t=m.trim().toLowerCase();t&&!e.extraHeaders.map(e=>e.toLowerCase()).includes(t)&&(o([...e.extraHeaders,t]),u(""))},className:"text-xs font-medium text-blue-600 hover:text-blue-700 border border-blue-200 bg-blue-50 hover:bg-blue-100 px-2 py-1.5 rounded transition-colors",children:"Add"})]})]}),(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>c(!d),className:"w-full flex items-center justify-between px-3 py-2 text-left text-xs font-semibold text-gray-700 bg-gray-50 hover:bg-gray-100 transition-colors",children:[(0,t.jsx)("span",{children:"Equivalent config"}),d?(0,t.jsx)(L.ChevronUpIcon,{className:"h-3.5 w-3.5 text-gray-500"}):(0,t.jsx)(T.ChevronDownIcon,{className:"h-3.5 w-3.5 text-gray-500"})]}),d&&(0,t.jsx)("pre",{className:"p-3 text-xs font-mono text-gray-700 bg-white border-t border-gray-200 overflow-x-auto whitespace-pre-wrap break-all",children:function(e){let t=["litellm_settings:"," guardrails:",` - guardrail_name: "${e.name.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`," litellm_params:",` guardrail: ${e.guardrailType??"generic_guardrail_api"}`,` mode: ${e.mode??"pre_call"} # or post_call, during_call`,` api_base: ${e.endpoint||"https://your-guardrail-api.com"}`," api_key: os.environ/YOUR_GUARDRAIL_API_KEY # optional",` unreachable_fallback: ${e.unreachable_fallback??"fail_closed"} # default: fail_closed. Set to fail_open to proceed if the guardrail endpoint is unreachable.`,` forward_api_key: ${e.forwardKey}`];if(e.model&&"—"!==e.model&&t.push(` model: "${e.model}" # LLM model name sent to the guardrail for context`),e.customHeaders.length>0)for(let a of(t.push(" headers: # static headers (sent with every request)"),e.customHeaders))t.push(` ${a.key}: "${String(a.value).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`);if(e.extraHeaders.length>0)for(let a of(t.push(" extra_headers: # forward these client request headers to the guardrail"),e.extraHeaders))t.push(` - ${a}`);if(e.additionalProviderParams&&Object.keys(e.additionalProviderParams).length>0)for(let[a,l]of(t.push(" additional_provider_specific_params:"),Object.entries(e.additionalProviderParams))){let e="string"==typeof l?`"${l}"`:String(l);t.push(` ${a}: ${e}`)}return t.join("\n")}(e)})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,t.jsx)(G.default,{className:"h-3.5 w-3.5 text-gray-400 flex-shrink-0 mt-0.5"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 leading-relaxed",children:["This guardrail runs on a separate instance. It receives the user request and forwards the result to the next step in the pipeline. See"," ",(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/adding_provider/generic_guardrail_api",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:"LiteLLM Generic Guardrail API docs"})," ","for configuration details."]})]})]}),(0,t.jsxs)("div",{className:"mt-5 pt-4 border-t border-gray-100 space-y-2",children:[(0,t.jsxs)("button",{type:"button",className:"w-full flex items-center justify-center gap-2 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)($.ExternalLinkIcon,{className:"h-4 w-4"}),"Test Endpoint"]}),"pending"===e.status&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:r,className:"flex-1 flex items-center justify-center gap-1.5 bg-green-500 hover:bg-green-600 text-white text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(F.CheckIcon,{className:"h-4 w-4"}),"Approve"]}),(0,t.jsxs)("button",{type:"button",onClick:i,className:"flex-1 flex items-center justify-center gap-1.5 border border-red-300 text-red-600 hover:bg-red-50 text-sm font-medium py-2 rounded-md transition-colors",children:[(0,t.jsx)(B.XIcon,{className:"h-4 w-4"}),"Reject"]})]})]})]})})}function ei({action:e,guardrailName:a,onConfirm:l,onCancel:r}){let i="approve"===e;return(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-50",children:(0,t.jsxs)("div",{className:"bg-white rounded-xl shadow-xl p-6 max-w-sm w-full mx-4",children:[(0,t.jsx)("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mb-4 ${i?"bg-green-100":"bg-red-100"}`,children:i?(0,t.jsx)(F.CheckIcon,{className:"h-5 w-5 text-green-600"}):(0,t.jsx)(R.AlertCircleIcon,{className:"h-5 w-5 text-red-600"})}),(0,t.jsx)("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:i?"Approve Guardrail":"Reject Guardrail"}),(0,t.jsxs)("p",{className:"text-sm text-gray-500 mb-5",children:["Are you sure you want to ",e," ",(0,t.jsxs)("span",{className:"font-medium text-gray-700",children:['"',a,'"']}),"?"," ",i?"This will make it active and available for use.":"This will mark it as rejected and notify the team."]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("button",{type:"button",onClick:r,className:"flex-1 border border-gray-300 text-gray-700 hover:bg-gray-50 text-sm font-medium py-2 rounded-md transition-colors",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:l,className:`flex-1 text-white text-sm font-medium py-2 rounded-md transition-colors ${i?"bg-green-500 hover:bg-green-600":"bg-red-500 hover:bg-red-600"}`,children:i?"Approve":"Reject"})]})]})})}function es({accessToken:e}){let[l,r]=(0,a.useState)([]),[i,s]=(0,a.useState)({total:0,pending_review:0,active:0,rejected:0}),[n,o]=(0,a.useState)(""),[c,m]=(0,a.useState)("all"),[u,p]=(0,a.useState)(null),[g,h]=(0,a.useState)(new Set),[f,y]=(0,a.useState)(null),[_,b]=(0,a.useState)(!0),[v,w]=(0,a.useState)(null),[N,C]=(0,a.useState)(""),[S,k]=(0,a.useState)(!1),[I]=D.Form.useForm(),A=(()=>{let{accessToken:e}=(0,U.default)(),t=(0,J.useQueryClient)();return(0,H.useMutation)({mutationFn:async t=>{if(!e)throw Error("Access token is required");return V(e,t)},onSuccess:()=>{t.invalidateQueries({queryKey:Y.all})}})})();(0,a.useEffect)(()=>{let e=setTimeout(()=>C(n),300);return()=>clearTimeout(e)},[n]);let T=(0,a.useCallback)(async()=>{if(!e)return void b(!1);b(!0),w(null);try{let t="all"===c?void 0:"pending"===c?"pending_review":c,a=await (0,d.listGuardrailSubmissions)(e,{status:t,search:N.trim()||void 0});r(a.submissions.map(Q)),s(a.summary)}catch(e){w(e instanceof Error?e.message:"Failed to load submissions"),r([])}finally{b(!1)}},[e,c,N]);(0,a.useEffect)(()=>{T()},[T]);let L=l.find(e=>e.id===u)??null,B=i.total,F=i.pending_review,$=i.active,E=i.rejected;async function M(t){if(!e)return;let a=l.find(e=>e.id===t);if(!a)return;let i=!a.forwardKey;try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{forward_api_key:i}}),r(e=>e.map(e=>e.id===t?{...e,forwardKey:i}:e)),x.default.success(i?"Forward API key enabled":"Forward API key disabled")}catch{x.default.fromBackend("Failed to update forward API key")}}async function R(t,a){if(!e)return;let l={};for(let{key:e,value:t}of a)e.trim()&&(l[e.trim()]=t);try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{headers:l}}),r(e=>e.map(e=>e.id===t?{...e,customHeaders:a.filter(e=>e.key.trim())}:e)),x.default.success("Static headers updated")}catch{x.default.fromBackend("Failed to update static headers")}}async function G(t,a){if(e)try{await (0,d.updateGuardrailCall)(e,t,{litellm_params:{extra_headers:a}}),r(e=>e.map(e=>e.id===t?{...e,extraHeaders:a}:e)),x.default.success("Forward client headers updated")}catch{x.default.fromBackend("Failed to update forward client headers")}}async function W(t){if(e)try{await (0,d.approveGuardrailSubmission)(e,t),y(null),u===t&&p(null),await T(),x.default.success("Guardrail approved")}catch{x.default.fromBackend("Failed to approve guardrail")}}async function X(t){if(e)try{await (0,d.rejectGuardrailSubmission)(e,t),y(null),u===t&&p(null),await T(),x.default.success("Guardrail rejected")}catch{x.default.fromBackend("Failed to reject guardrail")}}return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:`flex-1 min-w-0 p-6 overflow-auto ${L?"border-r border-gray-200":""}`,children:[(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[(0,t.jsx)(ee,{label:"Total Submitted",value:B,color:"text-gray-900"}),(0,t.jsx)(ee,{label:"Pending Review",value:F,color:"text-yellow-600"}),(0,t.jsx)(ee,{label:"Active",value:$,color:"text-green-600"}),(0,t.jsx)(ee,{label:"Rejected",value:E,color:"text-red-600"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(O.SearchIcon,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,t.jsx)("input",{type:"text",placeholder:"Search guardrails...",value:n,onChange:e=>o(e.target.value),className:"w-full pl-9 pr-4 py-2 border border-gray-200 rounded-md text-sm text-gray-700 placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"})]}),(0,t.jsxs)("select",{value:c,onChange:e=>m(e.target.value),className:"border border-gray-200 rounded-md px-3 py-2 text-sm text-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 bg-white",children:[(0,t.jsx)("option",{value:"all",children:"All Status"}),(0,t.jsx)("option",{value:"pending",children:"Pending Review"}),(0,t.jsx)("option",{value:"active",children:"Active"}),(0,t.jsx)("option",{value:"rejected",children:"Rejected"})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>k(!0),className:"ml-auto flex items-center gap-2 bg-blue-500 hover:bg-blue-600 text-white text-sm font-medium px-4 py-2 rounded-md transition-colors",children:[(0,t.jsx)(P.PlusIcon,{className:"h-4 w-4"}),"Add Guardrail"]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[_&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-500 text-sm",children:"Loading submissions…"}),v&&(0,t.jsx)("div",{className:"text-center py-12 text-red-600 text-sm",children:v}),!_&&!v&&0===l.length&&(0,t.jsx)("div",{className:"text-center py-12 text-gray-400 text-sm",children:"No guardrails match your filters."}),!_&&!v&&l.map(e=>(0,t.jsx)(ea,{guardrail:e,isSelected:u===e.id,isHeadersExpanded:g.has(e.id),onSelect:()=>p(u===e.id?null:e.id),onToggleForwardKey:()=>M(e.id),onToggleHeaders:()=>{var t;return t=e.id,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},onApprove:()=>y({id:e.id,action:"approve"}),onReject:()=>y({id:e.id,action:"reject"})},e.id))]})]}),L&&(0,t.jsx)(er,{guardrail:L,onClose:()=>p(null),onApprove:()=>y({id:L.id,action:"approve"}),onReject:()=>y({id:L.id,action:"reject"}),onToggleForwardKey:()=>M(L.id),onUpdateCustomHeaders:e=>R(L.id,e),onUpdateExtraHeaders:e=>G(L.id,e)}),f&&(0,t.jsx)(ei,{action:f.action,guardrailName:l.find(e=>e.id===f.id)?.name??"",onConfirm:()=>"approve"===f.action?W(f.id):X(f.id),onCancel:()=>y(null)}),(0,t.jsxs)(z.Modal,{title:"Submit Guardrail for Review",open:S,onCancel:()=>{k(!1),I.resetFields()},onOk:()=>I.submit(),okText:"Submit for Review",children:[(0,t.jsx)("div",{className:"rounded-md bg-blue-50 border border-blue-200 px-4 py-3 text-sm text-blue-800 mb-4",children:"Your guardrail will be sent for admin review before it becomes active."}),(0,t.jsxs)(D.Form,{form:I,layout:"vertical",initialValues:{mode:"pre_call"},onFinish:async e=>{let t={...e.extra_litellm_params?JSON.parse(e.extra_litellm_params):{},guardrail:"generic_guardrail_api",mode:e.mode,api_base:e.api_base};try{await A.mutateAsync({team_id:e.team_id,guardrail_name:e.guardrail_name,litellm_params:t,guardrail_info:e.guardrail_info?JSON.parse(e.guardrail_info):void 0}),x.default.success("Guardrail submitted for review"),k(!1),I.resetFields(),T()}catch{}},children:[(0,t.jsx)(D.Form.Item,{label:"Team",name:"team_id",rules:[{required:!0,message:"Select a team"}],children:(0,t.jsx)(q.default,{})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Enter a guardrail name"}],children:(0,t.jsx)(j.Input,{placeholder:"e.g. pii-detection"})}),(0,t.jsx)(D.Form.Item,{label:"Mode",name:"mode",rules:[{required:!0,message:"Select a mode"}],children:(0,t.jsxs)(K.Select,{children:[(0,t.jsx)(K.Select.Option,{value:"pre_call",children:"Pre Call"}),(0,t.jsx)(K.Select.Option,{value:"post_call",children:"Post Call"}),(0,t.jsx)(K.Select.Option,{value:"during_call",children:"During Call"})]})}),(0,t.jsx)(D.Form.Item,{label:"API Base URL",name:"api_base",rules:[{required:!0,message:"Enter the API base URL"},{type:"url",message:"Must be a valid URL"}],children:(0,t.jsx)(j.Input,{placeholder:"https://your-guardrail-api.com/v1/check",className:"font-mono"})}),(0,t.jsx)(D.Form.Item,{label:"Additional litellm_params (optional)",name:"extra_litellm_params",tooltip:"JSON object merged into litellm_params. e.g. forward_api_key, headers, model, unreachable_fallback",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{let e=JSON.parse(t);if("object"!=typeof e||Array.isArray(e))return Promise.reject("Must be a JSON object");return Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"forward_api_key": true, "headers": {"X-Custom": "value"}}'})}),(0,t.jsx)(D.Form.Item,{label:"Guardrail Info (optional)",name:"guardrail_info",rules:[{validator:(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch{return Promise.reject("Invalid JSON")}}}],children:(0,t.jsx)(j.Input.TextArea,{rows:3,className:"font-mono text-xs",placeholder:'{"description": "Detects PII in requests"}'})})]})]})]})}e.s(["default",0,({accessToken:e,userRole:j})=>{let[_,b]=(0,a.useState)([]),[v,w]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),[S,k]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[P,T]=(0,a.useState)(null),[L,B]=(0,a.useState)(!1),[F,$]=(0,a.useState)(null),E=!!j&&(0,u.isAdminRole)(j),M=async()=>{if(e){k(!0);try{let t=await (0,d.getGuardrailsList)(e);console.log(`guardrails: ${JSON.stringify(t)}`),b(t.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{k(!1)}}};(0,a.useEffect)(()=>{M()},[e]);let R=()=>{M()},G=async()=>{if(P&&e){O(!0);try{await (0,d.deleteGuardrailCall)(e,P.guardrail_id),x.default.success(`Guardrail "${P.guardrail_name}" deleted successfully`),await M()}catch(e){console.error("Error deleting guardrail:",e),x.default.fromBackend("Failed to delete guardrail")}finally{O(!1),B(!1),T(null)}}},z=P&&P.litellm_params?(0,f.getGuardrailLogoAndName)(P.litellm_params.guardrail).displayName:void 0;return(0,t.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,t.jsx)(i.Tabs,{defaultActiveKey:"submitted",items:[...E?[{key:"garden",label:"Guardrail Garden",children:(0,t.jsx)(A,{accessToken:e,onGuardrailCreated:R})},{key:"guardrails",label:"Guardrails",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,t.jsx)(r.Dropdown,{menu:{items:[{key:"provider",icon:(0,t.jsx)(n.PlusOutlined,{}),label:"Add Provider Guardrail",onClick:()=>{F&&$(null),w(!0)}},{key:"custom_code",icon:(0,t.jsx)(o.CodeOutlined,{}),label:"Create Custom Code Guardrail",onClick:()=>{F&&$(null),C(!0)}}]},trigger:["click"],disabled:!e,children:(0,t.jsxs)(l.Button,{disabled:!e,children:["+ Add New Guardrail ",(0,t.jsx)(s.DownOutlined,{className:"ml-2"})]})})}),F?(0,t.jsx)(p.default,{guardrailId:F,onClose:()=>$(null),accessToken:e,isAdmin:E}):(0,t.jsx)(m.default,{guardrailsList:_,isLoading:S,onDeleteClick:(e,t)=>{T(_.find(t=>t.guardrail_id===e)||null),B(!0)},accessToken:e,onGuardrailUpdated:M,isAdmin:E,onGuardrailClick:e=>$(e)}),(0,t.jsx)(c.default,{visible:v,onClose:()=>{w(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(y.CustomCodeModal,{visible:N,onClose:()=>{C(!1)},accessToken:e,onSuccess:R}),(0,t.jsx)(h.default,{isOpen:L,title:"Delete Guardrail",message:`Are you sure you want to delete guardrail: ${P?.guardrail_name}? This action cannot be undone.`,resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:P?.guardrail_name},{label:"ID",value:P?.guardrail_id,code:!0},{label:"Provider",value:z},{label:"Mode",value:P?.litellm_params.mode},{label:"Default On",value:P?.litellm_params.default_on?"Yes":"No"}],onCancel:()=>{B(!1),T(null)},onOk:G,confirmLoading:I})]})},{key:"playground",label:"Test Playground",disabled:!e,children:(0,t.jsx)(g.default,{guardrailsList:_,isLoading:S,accessToken:e,onClose:()=>{}})}]:[],{key:"submitted",label:"Submitted Guardrails",children:(0,t.jsx)(es,{accessToken:e})}]})})}],487304)}]);
\ No newline at end of file
diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/a230559fcabaea23.js b/litellm/proxy/_experimental/out/_next/static/chunks/406bbb9c89fee7ee.js
similarity index 99%
rename from litellm/proxy/_experimental/out/_next/static/chunks/a230559fcabaea23.js
rename to litellm/proxy/_experimental/out/_next/static/chunks/406bbb9c89fee7ee.js
index b1b0797563..60a711ff22 100644
--- a/litellm/proxy/_experimental/out/_next/static/chunks/a230559fcabaea23.js
+++ b/litellm/proxy/_experimental/out/_next/static/chunks/406bbb9c89fee7ee.js
@@ -4,7 +4,7 @@ ${t}`)}return n})(tN);class tE extends tw{list(e={},t){let{betas:s,...r}=e??{};r
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let a=this._client._options.timeout;if(!r.stream&&null==a){let e=t$[r.model]??void 0;a=this._client.calculateNonstreamingTimeout(r.max_tokens,e)}return this._client.post("/v1/messages?beta=true",{body:r,timeout:a??6e5,...t,headers:t_([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}stream(e,t){return tM.createMessage(this,e,t)}countTokens(e,t){let{betas:s,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...t,headers:t_([{"anthropic-beta":[...s??[],"token-counting-2024-11-01"].toString()},t?.headers])})}}tD.Batches=tA;class tB extends tw{constructor(){super(...arguments),this.models=new tC(this._client),this.messages=new tD(this._client),this.files=new tE(this._client)}}tB.Models=tC,tB.Messages=tD,tB.Files=tE;class tq extends tw{create(e,t){let{betas:s,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...t,headers:t_([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}let tW="__json_buf";function tz(e){return"tool_use"===e.type||"server_tool_use"===e.type}class tH{constructor(){P.add(this),this.messages=[],this.receivedMessages=[],O.set(this,void 0),this.controller=new AbortController,R.set(this,void 0),I.set(this,()=>{}),M.set(this,()=>{}),L.set(this,void 0),$.set(this,()=>{}),U.set(this,()=>{}),D.set(this,{}),B.set(this,!1),q.set(this,!1),W.set(this,!1),z.set(this,!1),H.set(this,void 0),F.set(this,void 0),V.set(this,e=>{if(e_(this,q,!0,"f"),eE(e)&&(e=new eP),e instanceof eP)return e_(this,W,!0,"f"),this._emit("abort",e);if(e instanceof eT)return this._emit("error",e);if(e instanceof Error){let t=new eT(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new eT(String(e)))}),e_(this,R,new Promise((e,t)=>{e_(this,I,e,"f"),e_(this,M,t,"f")}),"f"),e_(this,L,new Promise((e,t)=>{e_(this,$,e,"f"),e_(this,U,t,"f")}),"f"),eN(this,R,"f").catch(()=>{}),eN(this,L,"f").catch(()=>{})}get response(){return eN(this,H,"f")}get request_id(){return eN(this,F,"f")}async withResponse(){let e=await eN(this,R,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new tH;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,s){let r=new tH;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...s,headers:{...s?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},eN(this,V,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,s){let r=s?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),eN(this,P,"m",K).call(this);let{response:a,data:n}=await e.create({...t,stream:!0},{...s,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(a),n))eN(this,P,"m",X).call(this,e);if(n.controller.signal?.aborted)throw new eP;eN(this,P,"m",Y).call(this)}_connected(e){this.ended||(e_(this,H,e,"f"),e_(this,F,e?.headers.get("request-id"),"f"),eN(this,I,"f").call(this,e),this._emit("connect"))}get ended(){return eN(this,B,"f")}get errored(){return eN(this,q,"f")}get aborted(){return eN(this,W,"f")}abort(){this.controller.abort()}on(e,t){return(eN(this,D,"f")[e]||(eN(this,D,"f")[e]=[])).push({listener:t}),this}off(e,t){let s=eN(this,D,"f")[e];if(!s)return this;let r=s.findIndex(e=>e.listener===t);return r>=0&&s.splice(r,1),this}once(e,t){return(eN(this,D,"f")[e]||(eN(this,D,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,s)=>{e_(this,z,!0,"f"),"error"!==e&&this.once("error",s),this.once(e,t)})}async done(){e_(this,z,!0,"f"),await eN(this,L,"f")}get currentMessage(){return eN(this,O,"f")}async finalMessage(){return await this.done(),eN(this,P,"m",J).call(this)}async finalText(){return await this.done(),eN(this,P,"m",G).call(this)}_emit(e,...t){if(eN(this,B,"f"))return;"end"===e&&(e_(this,B,!0,"f"),eN(this,$,"f").call(this));let s=eN(this,D,"f")[e];if(s&&(eN(this,D,"f")[e]=s.filter(e=>!e.once),s.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];eN(this,z,"f")||s?.length||Promise.reject(e),eN(this,M,"f").call(this,e),eN(this,U,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];eN(this,z,"f")||s?.length||Promise.reject(e),eN(this,M,"f").call(this,e),eN(this,U,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",eN(this,P,"m",J).call(this))}async _fromReadableStream(e,t){let s=t?.signal;s&&(s.aborted&&this.controller.abort(),s.addEventListener("abort",()=>this.controller.abort())),eN(this,P,"m",K).call(this),this._connected(null);let r=te.fromReadableStream(e,this.controller);for await(let e of r)eN(this,P,"m",X).call(this,e);if(r.controller.signal?.aborted)throw new eP;eN(this,P,"m",Y).call(this)}[(O=new WeakMap,R=new WeakMap,I=new WeakMap,M=new WeakMap,L=new WeakMap,$=new WeakMap,U=new WeakMap,D=new WeakMap,B=new WeakMap,q=new WeakMap,W=new WeakMap,z=new WeakMap,H=new WeakMap,F=new WeakMap,V=new WeakMap,P=new WeakSet,J=function(){if(0===this.receivedMessages.length)throw new eT("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},G=function(){if(0===this.receivedMessages.length)throw new eT("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(e=>"text"===e.type).map(e=>e.text);if(0===e.length)throw new eT("stream ended without producing a content block with type=text");return e.join(" ")},K=function(){this.ended||e_(this,O,void 0,"f")},X=function(e){if(this.ended)return;let t=eN(this,P,"m",Q).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let s=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===s.type&&this._emit("text",e.delta.text,s.text||"");break;case"citations_delta":"text"===s.type&&this._emit("citation",e.delta.citation,s.citations??[]);break;case"input_json_delta":tz(s)&&s.input&&this._emit("inputJson",e.delta.partial_json,s.input);break;case"thinking_delta":"thinking"===s.type&&this._emit("thinking",e.delta.thinking,s.thinking);break;case"signature_delta":"thinking"===s.type&&this._emit("signature",s.signature);break;default:tF(e.delta)}break}case"message_stop":this._addMessageParam(t),this._addMessage(t,!0);break;case"content_block_stop":this._emit("contentBlock",t.content.at(-1));break;case"message_start":e_(this,O,t,"f")}},Y=function(){if(this.ended)throw new eT("stream has ended, this shouldn't happen");let e=eN(this,O,"f");if(!e)throw new eT("request ended without sending any chunks");return e_(this,O,void 0,"f"),e},Q=function(e){let t=eN(this,O,"f");if("message_start"===e.type){if(t)throw new eT(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new eT(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":case"content_block_stop":return t;case"message_delta":return t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,null!=e.usage.input_tokens&&(t.usage.input_tokens=e.usage.input_tokens),null!=e.usage.cache_creation_input_tokens&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),null!=e.usage.cache_read_input_tokens&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),null!=e.usage.server_tool_use&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case"content_block_start":return t.content.push(e.content_block),t;case"content_block_delta":{let s=t.content.at(e.index);switch(e.delta.type){case"text_delta":s?.type==="text"&&(s.text+=e.delta.text);break;case"citations_delta":s?.type==="text"&&(s.citations??(s.citations=[]),s.citations.push(e.delta.citation));break;case"input_json_delta":if(s&&tz(s)){let t=s[tW]||"";Object.defineProperty(s,tW,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t&&(s.input=tO(t))}break;case"thinking_delta":s?.type==="thinking"&&(s.thinking+=e.delta.thinking);break;case"signature_delta":s?.type==="thinking"&&(s.signature=e.delta.signature);break;default:tF(e.delta)}return t}}},Symbol.asyncIterator)](){let e=[],t=[],s=!1;return this.on("streamEvent",s=>{let r=t.shift();r?r.resolve(s):e.push(s)}),this.on("end",()=>{for(let e of(s=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(s=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(s=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:s?{value:void 0,done:!0}:new Promise((e,s)=>t.push({resolve:e,reject:s})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new te(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function tF(e){}class tJ extends tw{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(tk`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",tc,{query:e,...t})}delete(e,t){return this._client.delete(tk`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(tk`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let s=await this.retrieve(e);if(!s.results_url)throw new eT(`No batch \`results_url\`; Has it finished processing? ${s.processing_status} - ${s.id}`);return this._client.get(s.results_url,{...t,headers:t_([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tT.fromResponse(t.response,t.controller))}}class tG extends tw{constructor(){super(...arguments),this.batches=new tJ(this._client)}create(e,t){e.model in tV&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${tV[e.model]}
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let s=this._client._options.timeout;if(!e.stream&&null==s){let t=t$[e.model]??void 0;s=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}return this._client.post("/v1/messages",{body:e,timeout:s??6e5,...t,stream:e.stream??!1})}stream(e,t){return tH.createMessage(this,e,t)}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}let tV={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};tG.Batches=tJ;class tK extends tw{retrieve(e,t={},s){let{betas:r}=t??{};return this._client.get(tk`/v1/models/${e}`,{...s,headers:t_([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},s?.headers])})}list(e={},t){let{betas:s,...r}=e??{};return this._client.getAPIList("/v1/models",tc,{query:r,...t,headers:t_([{...s?.toString()!=null?{"anthropic-beta":s?.toString()}:void 0},t?.headers])})}}let tX=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()??void 0:void 0!==globalThis.Deno?globalThis.Deno.env?.get?.(e)?.trim():void 0;class tY{constructor({baseURL:e=tX("ANTHROPIC_BASE_URL"),apiKey:t=tX("ANTHROPIC_API_KEY")??null,authToken:s=tX("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){Z.set(this,void 0);const a={apiKey:t,authToken:s,...r,baseURL:e||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&"u">typeof window&&void 0!==window.document&&"u">typeof navigator)throw new eT("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n");this.baseURL=a.baseURL,this.timeout=a.timeout??tQ.DEFAULT_TIMEOUT,this.logger=a.logger??console;const n="warn";this.logLevel=n,this.logLevel=eJ(a.logLevel,"ClientOptions.logLevel",this)??eJ(tX("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??n,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??function(){if("u">typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),e_(this,Z,e6,"f"),this._options=a,this.apiKey=t,this.authToken=s}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(this.apiKey&&e.get("x-api-key")||t.has("x-api-key")||this.authToken&&e.get("authorization"))&&!t.has("authorization"))throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}authHeaders(e){return t_([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(null!=this.apiKey)return t_([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(null!=this.authToken)return t_([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new eT(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${eZ}`}defaultIdempotencyKey(){return`stainless-node-retry-${ek()}`}makeStatusError(e,t,s,r){return eA.generate(e,t,s,r)}buildURL(e,t){let s=new URL(eW.test(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return!function(e){if(!e)return!0;for(let t in e)return!1;return!0}(r)&&(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(s.search=this.stringifyQuery(t)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new eT("Streaming is strongly recommended for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:t,options:s}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,s){return this.request(Promise.resolve(s).then(s=>({method:e,path:t,...s})))}request(e,t=null){return new ti(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,s){let r=await e,a=r.maxRetries??this.maxRetries;null==t&&(t=a),await this.prepareOptions(r);let{req:n,url:i,timeout:o}=this.buildRequest(r,{retryCount:a-t});await this.prepareRequest(n,{url:i,options:r});let l="log_"+(0x1000000*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===s?"":`, retryOf: ${s}`,d=Date.now();if(eY(this).debug(`[${l}] sending request`,eQ({retryOfRequestLogID:s,method:r.method,url:i,options:r,headers:n.headers})),r.signal?.aborted)throw new eP;let u=new AbortController,h=await this.fetchWithTimeout(i,n,o,u).catch(eC),m=Date.now();if(h instanceof Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new eP;let a=eE(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):""));if(t)return eY(this).info(`[${l}] connection ${a?"timed out":"failed"} - ${e}`),eY(this).debug(`[${l}] connection ${a?"timed out":"failed"} (${e})`,eQ({retryOfRequestLogID:s,url:i,durationMs:m-d,message:h.message})),this.retryRequest(r,t,s??l);if(eY(this).info(`[${l}] connection ${a?"timed out":"failed"} - error; no more retries left`),eY(this).debug(`[${l}] connection ${a?"timed out":"failed"} (error; no more retries left)`,eQ({retryOfRequestLogID:s,url:i,durationMs:m-d,message:h.message})),a)throw new eR;throw new eO({cause:h})}let p=[...h.headers.entries()].filter(([e])=>"request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),f=`[${l}${c}${p}] ${n.method} ${i} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${m-d}ms`;if(!h.ok){let e=this.shouldRetry(h);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await e5(h.body),eY(this).info(`${f} - ${e}`),eY(this).debug(`[${l}] response error (${e})`,eQ({retryOfRequestLogID:s,url:h.url,status:h.status,headers:h.headers,durationMs:m-d})),this.retryRequest(r,t,s??l,h.headers)}let a=e?"error; no more retries left":"error; not retryable";eY(this).info(`${f} - ${a}`);let n=await h.text().catch(e=>eC(e).message),i=eH(n),o=i?void 0:n;throw eY(this).debug(`[${l}] response error (${a})`,eQ({retryOfRequestLogID:s,url:h.url,status:h.status,headers:h.headers,message:o,durationMs:Date.now()-d})),this.makeStatusError(h.status,i,o,h.headers)}return eY(this).info(f),eY(this).debug(`[${l}] response start`,eQ({retryOfRequestLogID:s,url:h.url,status:h.status,headers:h.headers,durationMs:m-d})),{response:h,options:r,controller:u,requestLogID:l,retryOfRequestLogID:s,startTime:d}}getAPIList(e,t,s){return this.requestAPIList(t,{method:"get",path:e,...s})}requestAPIList(e,t){return new tl(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,s,r){let{signal:a,method:n,...i}=t||{};a&&a.addEventListener("abort",()=>r.abort());let o=setTimeout(()=>r.abort(),s),l=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||"object"==typeof i.body&&null!==i.body&&Symbol.asyncIterator in i.body,c={signal:r.signal,...l?{duplex:"half"}:{},method:"GET",...i};n&&(c.method=n.toUpperCase());try{return await this.fetch.call(void 0,e,c)}finally{clearTimeout(o)}}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||!!(e.status>=500))}async retryRequest(e,t,s,r){let a,n,i=r?.get("retry-after-ms");if(i){let e=parseFloat(i);Number.isNaN(e)||(a=e)}let o=r?.get("retry-after");if(o&&!a){let e=parseFloat(o);a=Number.isNaN(e)?Date.parse(o)-Date.now():1e3*e}if(!(a&&0<=a&&a<6e4)){let s=e.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(t,s)}return await (n=a,new Promise(e=>setTimeout(e,n))),this.makeRequest(e,t-1,s)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}calculateNonstreamingTimeout(e,t){if(36e5*e/128e3>6e5||null!=t&&e>t)throw new eT("Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}buildRequest(e,{retryCount:t=0}={}){let s={...e},{method:r,path:a,query:n}=s,i=this.buildURL(a,n);"timeout"in s&&((e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new eT(`${e} must be an integer`);if(t<0)throw new eT(`${e} must be a positive integer`)})("timeout",s.timeout),s.timeout=s.timeout??this.timeout;let{bodyHeaders:o,body:l}=this.buildBody({options:s}),c=this.buildHeaders({options:e,method:r,bodyHeaders:o,retryCount:t});return{req:{method:r,headers:c,...s.signal&&{signal:s.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...s.fetchOptions??{}},url:i,timeout:s.timeout}}buildHeaders({options:e,method:t,bodyHeaders:r,retryCount:a}){let n={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),n[this.idempotencyHeader]=e.idempotencyKey);let i=t_([n,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...s??(s=(()=>{let e="u">typeof Deno&&null!=Deno.build?"deno":"u">typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eZ,"X-Stainless-OS":e1(Deno.build.os),"X-Stainless-Arch":e0(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("u">typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eZ,"X-Stainless-OS":e1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":e0(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("u"0&&(g["x-litellm-tags"]=a.join(","));let y=new tQ({apiKey:r,baseURL:f,dangerouslyAllowBrowser:!0,defaultHeaders:g});try{let r=Date.now(),a=!1,m={model:s,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(m.vector_store_ids=d),u&&(m.guardrails=u),h&&(m.policies=h),y.messages.stream(m,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let n=e.delta;if(!a){a=!0;let e=Date.now()-r;console.log("First token received! Time:",e,"ms"),o&&o(e)}"text_delta"===n.type?t("assistant",n.text,s):"reasoning_delta"===n.type&&i&&i(n.text)}if("message_delta"===e.type&&e.usage&&l){let t=e.usage;console.log("Usage data found:",t);let s={completionTokens:t.output_tokens,promptTokens:t.input_tokens,totalTokens:t.input_tokens+t.output_tokens};l(s)}}}catch(e){throw n?.aborted?console.log("Anthropic messages request was cancelled"):t1.default.fromBackend(`Error occurred while generating model response. Please try again. Error: ${e}`),e}}e.s(["makeAnthropicMessagesRequest",()=>t2],434788);var t4=e.i(356449);async function t3(e,t,s,r,a,n,i,o,l,c){console.log=function(){},console.log("isLocal:",!1);let d=c||(0,ev.getProxyBaseUrl)(),u=new t4.default.OpenAI({apiKey:a,baseURL:d,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let a=await u.audio.speech.create({model:r,input:e,voice:t,...o?{response_format:o}:{},...l?{speed:l}:{}},{signal:i}),n=await a.blob(),c=URL.createObjectURL(n);s(c,r)}catch(e){throw i?.aborted?console.log("Audio speech request was cancelled"):t1.default.fromBackend(`Error occurred while generating speech. Please try again. Error: ${e}`),e}}async function t5(e,t,s,r,a,n,i,o,l,c,d){console.log=function(){},console.log("isLocal:",!1);let u=d||(0,ev.getProxyBaseUrl)(),h=new t4.default.OpenAI({apiKey:r,baseURL:u,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{console.log("Processing audio file for transcription:",e.name);let r=await h.audio.transcriptions.create({model:s,file:e,...i?{language:i}:{},...o?{prompt:o}:{},...l?{response_format:l}:{},...void 0!==c?{temperature:c}:{}},{signal:n});if(console.log("Transcription response:",r),r&&r.text)t(r.text,s),t1.default.success("Audio transcribed successfully");else throw Error("No transcription text in response")}catch(e){if(console.error("Error making audio transcription request:",e),n?.aborted)console.log("Audio transcription request was cancelled");else{let t="Failed to transcribe audio";e?.error?.message?t=e.error.message:e?.message&&(t=e.message),t1.default.fromBackend(`Audio transcription failed: ${t}`)}throw e}}async function t6(e,t,s,r,a,n){if(!r)throw Error("Virtual Key is required");console.log=function(){};let i=n||(0,ev.getProxyBaseUrl)(),o={};a&&a.length>0&&(o["x-litellm-tags"]=a.join(","));try{let a=i.endsWith("/")?i.slice(0,-1):i,n=`${a}/embeddings`,l=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",[(0,ev.getGlobalLitellmHeaderName)()]:`Bearer ${r}`,...o},body:JSON.stringify({model:s,input:e})});if(!l.ok){let e=await l.text();throw Error(e||`Request failed with status ${l.status}`)}let c=await l.json(),d=c?.data?.[0]?.embedding;if(!d)throw Error("No embedding returned from server");t(JSON.stringify(d),c?.model??s)}catch(e){throw t1.default.fromBackend(`Error occurred while making embeddings request. Please try again. Error: ${e}`),e}}e.s(["makeOpenAIAudioSpeechRequest",()=>t3],512882),e.s(["makeOpenAIAudioTranscriptionRequest",()=>t5],584976),e.s(["makeOpenAIEmbeddingsRequest",()=>t6],720762)},921687,e=>{"use strict";var t=e.i(764205);let s=async(e,s)=>{try{let r=s||(0,t.getProxyBaseUrl)(),a=r?`${r}/v1/agents`:"/v1/agents",n=await fetch(a,{method:"GET",headers:{[(0,t.getGlobalLitellmHeaderName)()]:`Bearer ${e}`,"Content-Type":"application/json"}});if(!n.ok){let e=await n.json();throw Error(e.detail||"Failed to fetch agents")}let i=await n.json();return console.log("Fetched agents:",i),i.sort((e,t)=>{let s=e.agent_name||e.agent_id,r=t.agent_name||t.agent_id;return s.localeCompare(r)}),i}catch(e){throw console.error("Error fetching agents:",e),e}},r=async(e,s,r,a)=>{try{let a=await (0,t.modelInfoCall)(e,s,r,1,200),n=a?.data??[],i=(Array.isArray(n)?n:[]).filter(e=>"string"==typeof e?.litellm_params?.model&&e.litellm_params.model.startsWith("litellm_agent/")).map(e=>({model_name:e.model_name??e.model_group??"",litellm_params:{...e.litellm_params,model:e.litellm_params.model,litellm_system_prompt:e.litellm_params?.litellm_system_prompt,tools:Array.isArray(e.litellm_params?.tools)?e.litellm_params.tools:void 0},model_info:e.model_info??null}));return i.sort((e,t)=>e.model_name.localeCompare(t.model_name)),i}catch(e){throw console.error("Error fetching agent models:",e),e}};e.s(["fetchAvailableAgentModels",0,r,"fetchAvailableAgents",0,s])},488143,(e,t,s)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:s,blurHeight:r,blurDataURL:a,objectFit:n}){let i=s?40*s:e,o=r?40*r:t,l=i&&o?`viewBox='0 0 ${i} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${l}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${l?"none":"contain"===n?"xMidYMid":"cover"===n?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${a}'/%3E%3C/svg%3E`}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},987690,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return n},imageConfigDefault:function(){return i}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let n=["default","imgix","cloudinary","akamai","custom"],i={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1}},908927,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getImgProps",{enumerable:!0,get:function(){return c}}),e.r(233525);let r=e.r(543369),a=e.r(488143),n=e.r(987690),i=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function c({src:e,sizes:t,unoptimized:s=!1,priority:c=!1,preload:d=!1,loading:u,className:h,quality:m,width:p,height:f,fill:g=!1,style:y,overrideSrc:x,onLoad:b,onLoadingComplete:v,placeholder:w="empty",blurDataURL:j,fetchPriority:S,decoding:_="async",layout:N,objectFit:k,objectPosition:E,lazyBoundary:C,lazyRoot:T,...A},P){var O;let R,I,M,{imgConf:L,showAltText:$,blurComplete:U,defaultLoader:D}=P,B=L||n.imageConfigDefault;if("allSizes"in B)R=B;else{let e=[...B.deviceSizes,...B.imageSizes].sort((e,t)=>e-t),t=B.deviceSizes.sort((e,t)=>e-t),s=B.qualities?.sort((e,t)=>e-t);R={...B,allSizes:e,deviceSizes:t,qualities:s}}if(void 0===D)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let q=A.loader||D;delete A.loader,delete A.srcSet;let W="__next_img_default"in q;if(W){if("custom"===R.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=q;q=t=>{let{config:s,...r}=t;return e(r)}}if(N){"fill"===N&&(g=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[N];e&&(y={...y,...e});let s={responsive:"100vw",fill:"100vw"}[N];s&&!t&&(t=s)}let z="",H=l(p),F=l(f);if((O=e)&&"object"==typeof O&&(o(O)||void 0!==O.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(I=t.blurWidth,M=t.blurHeight,j=j||t.blurDataURL,z=t.src,!g)if(H||F){if(H&&!F){let e=H/t.width;F=Math.round(t.height*e)}else if(!H&&F){let e=F/t.height;H=Math.round(t.width*e)}}else H=t.width,F=t.height}let J=!c&&!d&&("lazy"===u||void 0===u);(!(e="string"==typeof e?e:z)||e.startsWith("data:")||e.startsWith("blob:"))&&(s=!0,J=!1),R.unoptimized&&(s=!0),W&&!R.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(s=!0);let G=l(m),V=Object.assign(g?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:k,objectPosition:E}:{},$?{}:{color:"transparent"},y),K=U||"empty"===w?null:"blur"===w?`url("data:image/svg+xml;charset=utf-8,${(0,a.getImageBlurSvg)({widthInt:H,heightInt:F,blurWidth:I,blurHeight:M,blurDataURL:j||"",objectFit:V.objectFit})}")`:`url("${w}")`,X=i.includes(V.objectFit)?"fill"===V.objectFit?"100% 100%":"cover":V.objectFit,Y=K?{backgroundSize:X,backgroundPosition:V.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},Q=function({config:e,src:t,unoptimized:s,width:a,quality:n,sizes:i,loader:o}){if(s){let e=(0,r.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")&&e){let s=t.includes("?")?"&":"?";t=`${t}${s}dpl=${e}`}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:c}=function({deviceSizes:e,allSizes:t},s,r){if(r){let s=/(^|\s)(1?\d?\d)vw/g,a=[];for(let e;e=s.exec(r);)a.push(parseInt(e[2]));if(a.length){let s=.01*Math.min(...a);return{widths:t.filter(t=>t>=e[0]*s),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof s?{widths:e,kind:"w"}:{widths:[...new Set([s,2*s].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,i),d=l.length-1;return{sizes:i||"w"!==c?i:"100vw",srcSet:l.map((s,r)=>`${o({config:e,src:t,quality:n,width:s})} ${"w"===c?s:r+1}${c}`).join(", "),src:o({config:e,src:t,quality:n,width:l[d]})}}({config:R,src:e,unoptimized:s,width:H,quality:G,sizes:t,loader:q}),Z=J?"lazy":u;return{props:{...A,loading:Z,fetchPriority:S,width:H,height:F,decoding:_,className:h,style:{...V,...Y},sizes:Q.sizes,srcSet:Q.srcSet,src:x||Q.src},meta:{unoptimized:s,preload:d||c,placeholder:w,fill:g}}}},898879,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return o}});let r=e.r(271645),a="u"{}:r.useLayoutEffect,i=a?()=>{}:r.useEffect;function o(e){let{headManager:t,reduceComponentsToState:s}=e;function o(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(s(e))}}return a&&(t?.mountedInstances?.add(e.children),o()),n(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),n(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},325633,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={default:function(){return f},defaultHead:function(){return u}};for(var a in r)Object.defineProperty(s,a,{enumerable:!0,get:r[a]});let n=e.r(563141),i=e.r(151836),o=e.r(843476),l=i._(e.r(271645)),c=n._(e.r(898879)),d=e.r(742732);function u(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(233525);let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,s,r,a;return e.reduce(h,[]).reverse().concat(u().reverse()).filter((t=new Set,s=new Set,r=new Set,a={},e=>{let n=!0,i=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){i=!0;let s=e.key.slice(e.key.indexOf("$")+1);t.has(s)?n=!1:t.add(s)}switch(e.type){case"title":case"base":s.has(e.type)?n=!1:s.add(e.type);break;case"meta":for(let t=0,s=m.length;t{let s=e.key||t;return l.default.cloneElement(e,{key:s})})}let f=function({children:e}){let t=(0,l.useContext)(d.HeadManagerContext);return(0,o.jsx)(c.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},918556,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ImageConfigContext",{enumerable:!0,get:function(){return n}});let r=e.r(563141)._(e.r(271645)),a=e.r(987690),n=r.default.createContext(a.imageConfigDefault)},65856,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(563141)._(e.r(271645)).default.createContext(null)},670965,(e,t,s)=>{"use strict";function r(e,t){let s=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return i}});let r=e.r(670965),a=e.r(543369);function n({config:e,src:t,width:s,quality:n}){if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
-Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let i=(0,r.findClosestQuality)(n,e),o=(0,a.getDeploymentId)();return`${e.path}?url=${encodeURIComponent(t)}&w=${s}&q=${i}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}n.__next_img_default=!0;let i=n},605500,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"Image",{enumerable:!0,get:function(){return v}});let r=e.r(563141),a=e.r(151836),n=e.r(843476),i=a._(e.r(271645)),o=r._(e.r(174080)),l=r._(e.r(325633)),c=e.r(908927),d=e.r(987690),u=e.r(918556);e.r(233525);let h=e.r(65856),m=r._(e.r(1948)),p=e.r(818581),f={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,s,r,a,n,i){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&a(!0),s?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,a=!1;s.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>a,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{a=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function y(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"{let E=(0,i.useCallback)(e=>{e&&(_&&(e.src=e.src),e.complete&&g(e,u,x,b,v,m,j))},[e,u,x,b,v,_,m,j]),C=(0,p.useMergedRef)(k,E);return(0,n.jsx)("img",{...N,...y(d),loading:h,width:a,height:r,decoding:o,"data-nimg":f?"fill":"1",className:l,style:c,sizes:s,srcSet:t,src:e,ref:C,onLoad:e=>{g(e.currentTarget,u,x,b,v,m,j)},onError:e=>{w(!0),"empty"!==u&&v(!0),_&&_(e)}})});function b({isAppRouter:e,imgAttributes:t}){let s={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...y(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,s),null):(0,n.jsx)(l.default,{children:(0,n.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...s},"__nimg-"+t.src+t.srcSet+t.sizes)})}let v=(0,i.forwardRef)((e,t)=>{let s=(0,i.useContext)(h.RouterContext),r=(0,i.useContext)(u.ImageConfigContext),a=(0,i.useMemo)(()=>{let e=f||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),s=e.deviceSizes.sort((e,t)=>e-t),a=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:s,qualities:a,localPatterns:"u"